There are some good F# templates in the online gallery (in the VS2010 'New Project' dialog, click 'Online Templates', type 'F#' into the search box, then scroll down) and some discussion here

[link:bloggemdano.blogspot.com]

You can use XAML fine that way. No code-behind; any features that require real new 'feature work' are unlikely to appear until the next version of Visual Studio. Do see e.g.

[link:v2matveev.blogspot.com]

and other things that appear in a Bing search for "F# WPF" for other advice and shortcuts to reducing the friction.

By on 8/8/2010 10:17 PM ()

The second link is very interesting.

Unfortunately I am using custom controls and template bindings which don't work well (if at all??) with XamlReader. My assumption is that any real solution would require to work at compile time, and my guess is that this would be new feature work. Are there any such features on the road map?

Bing / Google searches have not surfaced the solutions I'm looking for, although it is nice to know that my blog is ranked 5 and 6 on Bing :)

Cheers,

Matt

By on 8/9/2010 8:29 PM ()

The second link is very interesting.

Unfortunately I am using custom controls and template bindings which don't work well (if at all??) with XamlReader. My assumption is that any real solution would require to work at compile time, and my guess is that this would be new feature work.

Actually, I have found that custom controls and templates both work pretty well with F#. Two things to keep in mind:

1.) If your custom controls are defined in the same assembly, you have to doctor the XAML namespace to explicitly reference the assembly, because "assembly=" (local assembly) doesn't work through System.Windows.Markup.XamlReader. Also take out the x:Class tag that Expression Blend/VS generates for you.

2.) DataTemplates only work with System.Windows.Markup.XamlReader, not System.Xaml.XamlReader. And make sure not to use the .Load overload which takes a XamlReader becuase that uses System.Xaml.XamlReader under the hood--just use System.Windows.Markup.XamlReader.Parse().

With that in mind, you can pretty much just take the output of Expression Blend, tweak it slightly, and plop it right into F# and have it work, using the techniques Brian linked to above (overloaded "?" operator for instance). Tooling support for F# would be great but is not strictly necessary to be productive.

-Max

By on 10/11/2010 10:50 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