Simple F# ViewModel for Silverlight MVVM

Silverlight default architecture is Model-View-ViewModel. This code gives full design time support for Microsoft Expression Blend. The F# ViewModel is seen as strongly typed data source in the Blend UI. There are two properties binded to the view: HiLabel (OneWay data binding) and MyName (TwoWay data binding). ViewModel implements the INotifyPropertyChanged to support the binding. The view project (HelloApp) is made with Blend (by designers) and it is Silverlight 5.0 project. The view codebehind is c# file and it has only this.DataContext -assignment. The viewmodel project (HelloApp.ViewModel) is F# Silverlight 4.0 library. It is made with VS2010 and F# (by developers). It contains the logical functionality of the current view.

Copy Source

How to embed a snippet?

To embed the formatted F# source code to your web site, you also need to add a CSS file (that specifies colors of identifiers, keywords, strings, etc.) and a simple JavaScript that displays the tool tips. The script doesn't use jQuery or any other library and is self-contained.