I am new to the MVVM pattern and thus new to MVVMCross. But I can't seem to figure out how to notify the ViewModel of changes to the model's properties. Perhaps I am understanding the pattern wrong and using the wrong architecture ?
Here is my Model class:
public class WallModel: MvxNotifyPropertyChanged
{
private double _oc;
public double oc
{
get { return _oc; }
set
{
_oc = value;
RaisePropertyChanged(() => oc);
}
}
}
In my ViewModel I have the following property of the WallModel class:
private WallModel _wallModel = new WallModel();
public WallModel wallModel
{
get { return _wallModel; }
set
{
SetProperty(ref _wallModel, value);
}
}
I can retrieve data from the model just fine so the problem is not with the binding.
What is currently happening is that the set
of the oc property in the model is firing but the ViewModels set
is not being fired.
What I was hoping to happen is that the RaisePropertyChanged(() => oc);
would cause the ViewModles set
to fire but it does not.
What does RaisePropertyChanged(() => oc);
do then ?
Am I misinterpreting the MVVM model and should I change my architecture?**
How can I get the desired behavior?
I have tried implementing INotifyPropertyChanged
manually but this to does not wprk