Last active
May 24, 2018 08:53
-
-
Save ArthurFSharp/376752dcd8204674e74d06c90e7f32b3 to your computer and use it in GitHub Desktop.
Binding value WPF Elmish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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