Skip to content

Instantly share code, notes, and snippets.

@willsam100
Created August 27, 2018 18:13
Show Gist options
  • Save willsam100/99ea47b818c18b49ef2be5d1e6a7e5c1 to your computer and use it in GitHub Desktop.
Save willsam100/99ea47b818c18b49ef2be5d1e6a7e5c1 to your computer and use it in GitHub Desktop.
F# Simple View Model Base
namespace YourNameSpaceHere
open System.ComponentModel
type ViewModelBase() =
let propertyChanged = new Event<_, _>()
interface INotifyPropertyChanged with
[<CLIEvent>]
member this.PropertyChanged = propertyChanged.Publish
member this.OnPropertyChanged(propertyName : string) =
propertyChanged.Trigger(this, new PropertyChangedEventArgs(propertyName))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment