SynchronizedView with TView parameters only

Closed
#112 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
csharp, unity
Domain
game-dev

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.

Description

stale

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?

Dominant language
C#
Stars
1k
Forks
73
Avg merge
1d 14h
Merged PRs (30d)
3

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Cysharp/ObservableCollections

All issues in Cysharp/ObservableCollections

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.