MVVM UpdateContent from ViewModel

I'm currently evaluating a trial of Ab3d.PowerToys and Ab3d.DXEngine and trying to implement a heightmap in an MVVM application. Does Ab3d.PowerToys have any ability to notify the ViewModel that the data bound to HeightMap.HeightData has changed? Is there a recommended way to call HeightMap.UpdateContent from the ViewModel rather than the .xaml.cs?
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.
Andrej Benedik

Forum Jump:

Users browsing this thread:
1 Guest(s)