Open xperiandri opened 1 month ago
Doesnt 'NotifyCollectionChangedEventArgs' bind you to .Net? I mean, why can't notification be done with Msg + updates as usual?
But the collection is being modified from the UI. So I need to know when it happened from UI
I may be confused, so please correct me if I'm wrong, but my intuition is as follows:
1- if the library is to be linked to Net (which is inevitable for UNO/WPF), all Net functionality must be “hidden” (as in this file), i.e. the MVU part must not use anything from Net (with the exception of “Window” in “main”)
2- if I need to get data from the UI and “Mode=TwoWay” isn't enough, I use Behaviors to bind to events, or for any other scenarios (personnally, I use Behaviors a LOT to keep MVU independent and clean).
3- otherwise, I have an F# project called “[ProjectName].WPF.Fs” which depends on “[ProjectName].Core” (parallel to C# "[ProjectName].WPF") in which I do all my "WPF dependant" code; I used it recently to do some clean DataTemplateSelector code (for a Form Designer), and I think I'll do my behaviors in F# too (I really prefer the syntax + error handling).
Am I misunderstanding something? Is that the way to go @marner2?
Well, I do not argue that the API may be better than I implemented.
The issue is that if an ObservableCollection
is modified from UI you will never get such update. So we need to get it somehow
@xperiandri Well, too bad our efforts to spark conversation aren't taken into account. I hope you'll continue to be interested in ElmishWPF/UNO and use it, otherwise I'll be very lonely..
Thank you for sharing your code and insights.
Maybe you become a maintainer of this repo? @YkTru
Haha! I was thinking more of you!
You clearly understand the ins and outs of this library better than I do. I've been using F# since last October, so I'm in danger of breaking it all!
High-level description
TokenizingTextBox
from WCT modifies the collection supplied toItemsSource
. Hence changes must be propagated back to the model.I've implemented
TwoWaySeq
binding in my fork See commits in https://github.com/Ecierge/Elmish.Uno/commits/eCierge/Backport if you consider it useful