fsprojects-archive / zzarchive-FSharp.Desktop.UI

F# MVC framework for WPF.
http://fsprojects.github.io/FSharp.Desktop.UI/
Other
81 stars 21 forks source link

Added setting of binding properties individually for each model property... #13

Closed wezeku closed 9 years ago

wezeku commented 9 years ago

I've added the possibility to specify binding properties for individual model properties like this:

    <@
      view.Root.LastName.Text <- model.LastName |> UpdateSourceOnChange
      view.Root.Bitness.Text  <- model.Bitness |> OneWay
    @>

It's described in detail in this blog post: http://blog.wezeku.com/2013/07/10/adding-binding-options-to-morozovs-wpf-mvc-framework/

I mailed Dmitry about it when I coded it, and since the MVC framework is productized now, I've made a pull req with my changes. I hope this may be of interest for the MVC project!

dmitry-a-morozov commented 9 years ago

This is really nice but because we product now you need to add unit testing coverage before I'll merge. In here seems like most sensible place. https://github.com/fsprojects/FSharp.Desktop.UI/blob/master/tests/BindingTests.fs

wezeku commented 9 years ago

I've added unit tests for all BindingOptions cases in a separate module in BindingTests.fs. The Xunit in the project doesn't support the [Theory] attribute, is that because of the Xunit version? Anyway, I added separate test cases instead of using [Theory], rather than complicating the pull request with a migration to Xunit 2.x.