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

return BindingExpressionBase from Binding.OfExpression #8

Closed dmitry-a-morozov closed 9 years ago

dmitry-a-morozov commented 9 years ago

To improve debug-ability/diagnostics

dmitry-a-morozov commented 9 years ago

@StefanBelo Do you think it will be helpful?

StefanBelo commented 9 years ago

I am sorry Dmitry, I did not notice your comment earlier.

Well, my binding problems were mainly with derived properties, and as you shortly summarized it this problem could be solved when Nullable<_> or Option<_> value is the last in a path when evaluating derived property.

So to return binding expression is not necessary, I learnt where was the problem, so it will not/did not occur in other parts of my mvc code.

Now I am maybe in 50% of features I would like to use in my app, and am used to use your great library, well maybe in my way.

I already mentioned my requirements, and I understand that you want to keep this library small and general, but there is one point. I think you already answered similar question, when I watched some of your videos, someone asked about DataTemplates and the way how to bind from your code to controls in DataTemplates. Well I know it is not possible for now, and so we must put binding code into xaml, and ones could still use your MVC approach, but then occurs another problem with derived properties.

As during binding in your view you create multibinding, and converter for such properties, in DataTemplete we must do so. So the question is would it possible to reuse some code from your library, maybe just converter part? Or would it be possible to create some listener in model, to emulate derived property behaviour?

I made short video showing my app, and derived property issue when using DataTemplate. My app uses dockable windows and documents, as your library does not allow dynamically add or remove components I solved it just by hiding unnecessary views. I know that it is not ideal, but I am progressing in F# coding, and for now I like it.

https://www.youtube.com/watch?v=-NMRb8g8aDs

dmitry-a-morozov commented 9 years ago

@StefanBelo Thank you for the feedback. I'm so happy to see you as real user of the library. I've been asked several times about DataTemplates. No easy problem to solve. I promise I'll think of it.