构建IronRuby WPF GUI [英] Building IronRuby WPF GUIs

查看:63
本文介绍了构建IronRuby WPF GUI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个愚蠢的问题,但是我给人的印象是,可以同时使用IronRuby和MS Visual Studio 2010在一个窗口中对构建接口进行编辑\编辑XAML,在另一个窗口中对ruby进行编码?

This may be a silly question but I was under the impression that it was possible to use IronRuby and MS Visual Studio 2010 together to sort of build interfaces\edit XAML in one window and code ruby in the other?

这只能与C#,Basic和C ++一起使用吗?

Is this only possible to do with C#, Basic and C++ ?

我已经浏览了SO,并看到了一些像这样的IronRuby片段:

I've browsed SO and seen some IronRuby snippets like this one:

button1.click do |sender, args|
    MessageBox.show("Hello World!")
end

因此,您可以以某种方式创建GUI是合理的,但是视觉gui创建器是否不适用于ironruby?

So it stands to reason you can create GUIs somehow, but is the visual gui creator not available for ironruby?

推荐答案

为了构建GUI,您应该将XAML与WPF一起使用.您可以使用Visual Studio中的编辑器创建XAML.可以通过以下方式运行XAML文件:

In order to build GUIs you should use XAML with WPF. You can create XAML with the editor in Visual Studio. Running a XAML file is possible with:

require "PresentationFramework"
include System::Windows
include System::Windows::Markup

xaml = File.Open('d:/app/window1/xaml', "r").read
@root = System::Windows::Markup::XamlReader.parse(xaml)

app = System::Windows::Application.new
app.run @root

请参阅《 IronRuby发行》以获取更多信息

Please refer to IronRuby Unleashed for more information

这篇关于构建IronRuby WPF GUI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆