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: 13 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: 13 years ago by Fahad

  • Calculator

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

    1 people like this

    Posted: 13 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: 13 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: 13 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: 13 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: 13 years ago by Tao Liu

  • WrapPanel

    Positions child elements in sequential position from left to right, breaking content to the next line at the edge of the containing box. Tryable at http://tryfsharp.org

    3 people like this

    Posted: 12 years ago by Phillip Trelford

  • Berzerk

    Zombie state machine code sample. Use arrow keys to move humanoid. Robots activate when in range of humanoids. Try it out in the browser with TryFSharp.org.

    6 people like this

    Posted: 12 years ago by Phillip Trelford

  • PacMan

    Single level retro game playable inside TryFsharp using the cursor keys.

    9 people like this

    Posted: 12 years ago by Phillip Trelford

  • Growing Tree Algorithm for Maze Generation

    There are several maze creation algorithms (http://www.astrolog.org/labyrnth/algrithm.htm). The interesting point about Growing Tree one is that it turns into the others (for example, Recursive Backtracker and Prim's algo) when we choose the next step in different ways. Check it with tryfsharp.org.

    4 people like this

    Posted: 7 years ago by Natallie Baikevich