DataGrid - grid selection is reset when new Data is arrived

后端 未结 3 841
囚心锁ツ
囚心锁ツ 2021-01-25 00:29

I have such DataGrid



        
3条回答
  •  借酒劲吻你
    2021-01-25 01:08

    The way I've set up a updating lists in the past is:

    1. Create an Update method in you object (ConsoleData) that you can pass a copy of that object and the object updates itself. The object also needs to implement INotifyPropertyChanged.

    2. In you model_DataArrived method in the ViewModel find all matching objects and use the Update method from step 1 to update the objects.

    3. Find all new objects and add them to you list (DataList).

    4. Find all missing objects and remove them from you list (DataList).

提交回复
热议问题