Cysharp / Cysharp/ObservableCollections
SynchronizedView with TView parameters only
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 1k
- Forks
- 73
- Avg merge
- 5d 4h
- Merged PRs (30d)
- 2
Description
I have never worked with mvvm targeted frameworks. I implement mvvm in Unity and learn pattern from articles. So I might be misunderstanding the pattern. Isn't SynchronizedViewChangedEventArgs<T, TView> violates encapsulation "view doesn't know about data" in that example?
var model = new ObservableList<SomeData>();
var vm = model.CreateView(data => CreateView(someData)); //generates view for model data
var view = new ScrollView(); //view has field vm
vm.ObserveAdd().Subscribe(evt => view.Add(evt.Value.View)); //view observes vm and have acces to the evt.Value.Value (model data)
Currently, I use a View.cs file alongside .uxml to just bind uxml to the code. So I put data related logic in the vm and appearance related logic in the view (drag&drop ScrollView element). This is why view wants to look at vm.SynchronizedView, but access only TView without T. Does it make sense to create TView only SynchronizedView?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the SynchronizedViewChangedEventArgs<T, TView> example in the issue and compare it with the described View.cs and .uxml separation. Determine whether a SynchronizedView exposing only TView fits the existing API, then document the decision and any required API changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, unity
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100