A Nice Addition to the Empty WPF F# Template
Join the DZone community and get the full member experience.
Join For FreeA few days ago Steffen Formann announced a Xaml type provider
that he and Johann Deneux have created that makes writing WPF apps in
F# very easy. This type provider allows strongly typed access to the
XAML, effectively providing the missing piece to allowing full F# WPF
designer support. I've now updated the Empty WPF F# Template to include
this type provider.
To use it, all you have to due is download/install the latest version of the F# Empty Windows App (WPF) template in VS11. This will generate an F# project with all the needed WPF assembly references. It also automatically installs the FSharpx.TypeProviders NuGet package and provides the starting point for creating WPF apps with the new Xaml type provider.
Here's a screenshot that's pretty similar to what Steffen showed in the announcement post. Note: The button and label were manually added after creating the project from the updated template.

To use it, all you have to due is download/install the latest version of the F# Empty Windows App (WPF) template in VS11. This will generate an F# project with all the needed WPF assembly references. It also automatically installs the FSharpx.TypeProviders NuGet package and provides the starting point for creating WPF apps with the new Xaml type provider.
Here's a screenshot that's pretty similar to what Steffen showed in the announcement post. Note: The button and label were manually added after creating the project from the updated template.
One other piece that can be helpful when creating WPF apps in F# is the
XAML related item templates (i.e. Page, User Control, Window, etc). Item
templates are provided via the F# XAML Item Templates extension found
at http://visualstudiogallery.msdn.microsoft.com/06c6ece1-2084-4083-a0f7-934fce9d22fb.
Windows Presentation Foundation
Template
Opinions expressed by DZone contributors are their own.
Comments