Snippets tagged wpf

  • Load XAML

    This example shows how to load a Xaml file allowing to use WPF from F#. It also shows how to access WPF objects and register event handlers.

    104 people like this

    Posted: 7 years ago by Antonio Cisternino

  • ObservableObject

    The ObservableObject type implements the INotifyPropertyChanged interface used in WPF and Silverlight to notify on changes to properties that are bound to a control. Specify property names type safely using F# Quotations, i.e. <@ this.PropertyName @> when invoking the NotifyPropertyChanged method. If you are following the MVVM pattern then your View Model class can inherit from the ObservableObject type.

    59 people like this

    Posted: 6 years ago by Phillip Trelford

  • WPF DepdencyProperty

    Declaring WPF DependencyProperty in F#

    21 people like this

    Posted: 6 years ago by Fahad

  • A fun-ny WPF DataTemplate DSL

    Parts of a little DSL to create WPF DataTemplate's in F#. Don't even want to think about the length of a corresponding C#. The F# code corresponds 1-to-1 to the visual tree constructed for the template.

    7 people like this

    Posted: 6 years ago by Cetin Sert

  • WPF Event to Command

    This snippet provides an example of a WPF Event to Command behavior.

    3 people like this

    Posted: 6 years ago by Daniel Mohl

  • Building a WPF application in functional way

    I started to write pure F# + WPF application in about half a year ago. Today, I found a good way to compose WPF controls with dependent values. It's only writing a dependency object type as a class and give it to constructors of GUI controls. In this snippet "Volume","ColorVolume" and "ShapeContainer" has no properties. But works as a View which represents internal Model and allows users to change internal data. You only need calling a constructor of them. It means that you can compose GUI controls and it's functionality as a immutable data structure. (Update 2011/12/02 8:33:00(UTC+09:00) : Removed some user defined operators and renamed a type similar to DependencyObject in this snippet Reactor to SharedValue.) (Update 2011/12/02 9:04:01(UTC+09:00) : renamed some variables..)

    18 people like this

    Posted: 6 years ago by nagat01

  • WPF Command in F#

    demonstrate how to use object expression to create a WPF/Silverlight command.

    22 people like this

    Posted: 5 years ago by Tao Liu

  • Flappy Bird clone using WPF

    Flappy bird clone script using WPF, click the mouse or hit space to flap, no collision detection.

    4 people like this

    Posted: 2 years ago by Phillip Trelford

  • WPF/Silverlight Attached Property

    Example of a WPF/Silverlight Attached Property (AP). This is a port of a C# AP implementation that can be found at

    0 people like this

    Posted: 1 year ago by Daniel Mohl