Hello, Marc Clifton looked into creating GTK# UIs using MyXAML running under Mono.
Marc writes: I eventually got Visual Studio to compile and run a GTK# application (sans MyXaml). This was an arduous task in itself as the “how to“ in the above article falls far short of the reality needed to get things working. I'll probably write an article on how to do it. So, the next step was, OK, can XAML be used to instantiate a GTK# object graph? Sadly, the answer is no. I haven't done a lot of exploring, but I found two showstoppers right away. First, there is no default Window constructor. This breaks the first law of XAML compliant classes--you must have a parameterless constructor. OK, maybe this can be handled in the markup some day, but right now, no. And frankly, I think it's bad form to not support a parameterless constructor. Second, (and a very disappointing surprise) is how collections are handled. Take the Window class again. It's derived from Container. OK, well, Container has an Add() method. There is no "Items" property or similar implementation derived from something like IList or ICollection. One would be able to live with that if they used their own I... collection interface, but sadly no. And the real nail in the coffin is the read-only "Children" property, which simply returns an array. Not an Array object, but a straight forward array. In order words, you have to use the Add method. Even the Add method is dubious, as the documentation suggests that you should consider using functions such as Gtk.Box.Packstart and Gtk.Table.Attach as an alternative because Add will use default packing parameters that may not be correct. So, the conclusion is that GTK# needs to get on board with XAML compliance before it's useful as an alternative UI for declarative markup parsers. And after spending the good part of the morning researching all of this, I have a much better appreciation for the great job that the Microsoft folks did on .NET. Makes me wonder if they had a vision of XAML from the beginning, or were we all just lucky because the .NET framework had to be written in a specific way to support the serialization of UI into C#/VB, etc. Anyways, now I'm wondering whether the GTK# folks have any interest in making their library XAML compliant. As it stands now, GTK# is not usable for serializing/deserializing object graphs into XML with a generic parser. You'd have to write a GTK# custom parser. Source: http://myxaml.com/marcclifton/archive/2004/08/15/433.aspx If anyone is intersted if Qt# (http://qtcsharp.sourceforge.net ) or wx.NET (http://wxnet.sourceforge.net ) are any better, join us on the MyXAML Developers Group online @ http://groups.yahoo.com/group/myxaml - Gerald ------------------- Gerald Bauer XUL Alliance | http://xul.sourceforge.net United XAML | http://xaml.sourceforge.net Interested in hiring Gerald Bauer? Yes, I'm available. If you know of an opportunity in Toronto or Vancouver, please contact me today. ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ xul-announce mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xul-announce