Snippets tagged silverlight

  • 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.

    67 people like this

    Posted: 14 years ago by Phillip Trelford

  • F# Quotations with INotifyPropertyChanged

    ViewModelBase for F# users who want to use it in WPF / Silverlight

    16 people like this

    Posted: 14 years ago by Fahad

  • Calculator

    Simple Silverlight Calculator UI interactive sample runnable inside http://tryfsharp.org.

    1 people like this

    Posted: 14 years ago by Phillip Trelford

  • 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.

    5 people like this

    Posted: 14 years ago by Tuomas Hietanen

  • Tetris

    Playable Tetris mini-game. Use arrow keys to move left and right and up to rotate, down to drop. Try it out in the browser on TryFSharp.org

    18 people like this

    Posted: 14 years ago by Phillip Trelford

  • Still Mouse Click Event Using Scan

    Detects a mouse down then up event without a move.

    4 people like this

    Posted: 14 years ago by Zach Bray

  • WPF / SilverLight Converter II

    version 1 is http://fssnip.net/62. This new version support convert from any existing function to a converter function by using composition and pipeline. The convert function is to make the function signature agree to the IValueConverter interface. You can add new functions in the FunctionLibrary module and reuse the class definition to reduce the coding effort. The first sample is to show how to make the converter pipeline work, the second one is a debugger converter used to debug the data binding problem.

    90 people like this

    Posted: 14 years ago by Tao Liu

  • WPF Command in F#

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

    22 people like this

    Posted: 13 years ago by Tao Liu

  • Minesweeper Kata 2

    Solution to Minesweeper Kata second challenge at Goto Copenhagen 2012 conference "Programming with the Stars" track. Runnable at http://tryfsharp.org.

    2 people like this

    Posted: 13 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 http://www.silverlightshow.net/items/Attached-Properties-in-Silverlight.aspx.

    0 people like this

    Posted: 9 years ago by Daniel Mohl

  • WPF generic value converter for Discriminated Unions

    A generic value converter for discriminated unions, it allows to use a single converter for any discriminated union along with facilitating the creation of new ones with a default option value for when an incompatible union case is provided. Large part of this snippet uses http://fssnip.net/62 as a base, all credit on the ConverterBase goes to him, one of the authors also has a new version of it http://fssnip.net/7Q

    1 people like this

    Posted: 7 years ago by Micael Morais