Both versions are obviously highly redundant. However, you should be able to drastically reduce the size of the F# version by factoring the common code (look at all those repeated identifiers!).

I would expect F# to displace XAML as a consequence.

By on 6/10/2007 3:01 PM ()

I guess you could, but then you have to do a whole lot of casting which might not always work... (I had strated doing it on some parts of the code, but even then, the gain in coding programatically vs XML-ing wasn't that huge (especially with the VS auto completion feature)).

In addition to that, while trying to translate the XAML tags into code, I came upon a case where basically you couldn't "code" it because it required accessing some protected (or private? I can't remember) property...

FWIW, after seeing the samples (bag-o-tricks) on [link:blogs.msdn.com] I decided to use a different and simpler (more efficient?) approach : use the XAML for all widgets / styles / templates, and F# for the data structures, converters and custom widgets. You then only have to extend the namespace and voilà ! Much ado about ... well, not that much.

You may) keep the C# code for widgets, but externalize all the rest through functional programming and composition (ie your object has an F#-programmed object instead of having the properties itself)...

You lose a bit of time by not being able to have the F# project along the XAML one, but it's (IMO) a lesser pain...

By on 6/13/2007 6:18 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper