[Ironruby-core] How to run a XAML file?

Shay Friedman shay.friedman at gmail.com
Mon Nov 16 00:52:46 EST 2009


Thanks Jimmy :)

On Mon, Nov 16, 2009 at 5:32 AM, Jimmy Schementi <
Jimmy.Schementi at microsoft.com> wrote:

> I was looking through the mailing list archives for unanswered mails ...
> eek, sorry Shay! Well, if you still have this question ...
>
> You can also load XAML with System::Window::Application.LoadComponent:
>
> # This loads "foo.xaml" into the "canvas" variable
> include System
> include System::Windows
> include System::Windows::Controls
> canvas = Canvas.new
> Application.load_component canvas, Uri.new("foo.xaml", UriKind.relative)
>
> This only works when foo.xaml has a x:Class equal to the type passed to the
> first arg to load_component, like x:Class="System.Windows.Controls.Canvas".
>
> ~Jimmy
>
> > -----Original Message-----
> > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-
> > bounces at rubyforge.org] On Behalf Of Shay Friedman
> > Sent: Friday, July 24, 2009 2:34 AM
> > To: ironruby-core at rubyforge.org
> > Subject: [Ironruby-core] How to run a XAML file?
> >
> > Hi,
> >
> > I have a WPF xaml file and I'd like to execute it using IronRuby. I know
> I
> > can use the System::Windows::Markup::XamlReader.parse method, but is
> there
> > another way?
> >
> > Using the XamlReader class makes registering events, for example, kind of
> an
> > irritating task.
> >
> > Thanks,
> > Shay.
> > --
> > Posted via http://www.ruby-forum.com/.
> > _______________________________________________
> > Ironruby-core mailing list
> > Ironruby-core at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/ironruby-core
>
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>



-- 
--------------------------------------------------
Shay Friedman
Author of IronRuby Unleashed
http://www.IronShay.com
Follow me: http://twitter.com/ironshay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20091116/4c8cfbfa/attachment.html>


More information about the Ironruby-core mailing list