Answer the question
In order to leave comments, you need to log in
C#, linking array of objects and ListView?
Greetings!
I didn't write anything for a long time, I fell out of fashionable and new trends in programming, but the need forced me :)
What is:
-Project in C# .net 4.5
-An array of class instances with a set of string/int/... variables
-ListView.
The array is updated with some periodicity, it is necessary that after updating the array, the listview elements also change, but only those that change in the array.
There is a standard approach "on the forehead" - the flag "was changed" on the array element, running through the array and changing the listview element associated with it.
But there is a feeling that this is not quite the right approach.
Actually the question is how to connect an array of some elements and a sheet?
ps - played a little with Java for Android - there is a great opportunity to use list adapter'a - if the data set attached to the sheet changes, the sheet changes. Is there something similar for C#?
Answer the question
In order to leave comments, you need to log in
Use ObservableCollection and data binding:<ListView ItemsSource="{Binding MyData}">
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question