Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type IContextSource<'ctx>=
- abstract member Get:'ctx->unit
- abstract member Set:'ctx->'ctx
- type Context={Prop1:string;Prop2:string}
- type ViewModel()=
- member val Property1 ="" with get,set
- member val Property2 ="" with get,set
- interface IContextSource<Context>
- with member x.Get ctx=x.Property1<-ctx.Prop1
- member x.Set ctx={ctx with Prop1=x.Property1}
- let vmActorFun=function
- |(ctx,vm:obj) -> match vm with
- | :? IContextSource<Context> as v->
- v.Get(ctx)
- setVmToWindow vm
- let vmActorUpdaterFun=function
- |(ctx) -> match getVm() with
- | :? IContextSource<Context> as v->
- let ctxToUpdate=v.Set(ctx)
- contextActor.Tell(Update ctx)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement