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

Collection handling #17

Open theor opened 9 years ago

theor commented 9 years ago

Hi,

quick question, how would you handle collections ? Let's say, a list of ToDoItems. I can't find a nice solution.

Thanks !

theor commented 9 years ago

To add some details : adding a MVC per item of a collection seems not trivial, as it would involve composing everytime an item is added to the list, and decomposing when it's removed. So I guess adding a model per item is a better solution.

dmitry-a-morozov commented 9 years ago

Is it same as this question? https://github.com/dmitry-a-morozov/fsharp-wpf-mvc-series/issues/1

theor commented 9 years ago

Yes it is, sorry for the duplicate ! Moving over there.

theor commented 9 years ago

As you reopened this issue, I'll answer here.

I saw your comment in the other issue about data templates. Would it be possible instead to just replace the collection in the model with a reactive collection that would expose items added/removed events (Like this list from Rx UI) and then create views/controllers for each item and compose them with the main MVC ?

I have the feeling something like this would be doable, but you surely have a better understanding of your own architecture. However, this is something I could try to implement if you think it is viable.