Skip to content

Instantly share code, notes, and snippets.

@ArthurFSharp
Last active May 24, 2018 08:53
Show Gist options
  • Save ArthurFSharp/376752dcd8204674e74d06c90e7f32b3 to your computer and use it in GitHub Desktop.
Save ArthurFSharp/376752dcd8204674e74d06c90e7f32b3 to your computer and use it in GitHub Desktop.
Binding value WPF Elmish
type Model =
{
Count: int
}
type Msg =
| SetCount of int
let init() = { Count = 0 }
let update msg model =
match msg with
| SetCount n -> { model with Count = n }
let view _ _ =
[ "Count" |> Binding.twoWay (fun m -> (int m.Count)) (fun v m -> v |> int |> SetCount) ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment