DataContext should be set before SetBindings otherwise in initial binding there is a lot of errors:
System.Windows.Data Error: 40 : BindingExpression path error: 'ToDate' property not found on 'object' ''MainModelProxy' (HashCode=10737664)'. BindingExpression:Path=ToDate; DataItem='MainModelProxy' (HashCode=10737664); target element is 'DateEdit' (Name='deToDate'); target property is 'EditValue' (type 'Object')
member this.SetBindings model =
root.DataContext <- model
this.SetBindings model
DataContext should be set before SetBindings otherwise in initial binding there is a lot of errors:
System.Windows.Data Error: 40 : BindingExpression path error: 'ToDate' property not found on 'object' ''MainModelProxy' (HashCode=10737664)'. BindingExpression:Path=ToDate; DataItem='MainModelProxy' (HashCode=10737664); target element is 'DateEdit' (Name='deToDate'); target property is 'EditValue' (type 'Object')