11-24-2021, 09:56 AM
I am not an expert on MVVM so I can hardly give you good advice on that.
But because HeightMap.HeightData is a DepandencyProperty you can data bind to that property and also get notifications when the value of the property is changed (when you assign a new array to that property). But you cannot get a notification when the data inside the array is changed. Because the change of the data comes from the Model or ViewModel (and not from the HeightMap), you will need to somehow send that information from the part of the code that changes the data (this is also probably done because of some event or something). After the data in the array has changed, you will need to call HeightMap.UpdateContent method - for this you will need to have access to the HeightMap instance in the ViewModel.
But because HeightMap.HeightData is a DepandencyProperty you can data bind to that property and also get notifications when the value of the property is changed (when you assign a new array to that property). But you cannot get a notification when the data inside the array is changed. Because the change of the data comes from the Model or ViewModel (and not from the HeightMap), you will need to somehow send that information from the part of the code that changes the data (this is also probably done because of some event or something). After the data in the array has changed, you will need to call HeightMap.UpdateContent method - for this you will need to have access to the HeightMap instance in the ViewModel.
Andrej Benedik

