In my mvvm ViewModel I have such field
public int Delta { get; private set; }
However when I update it like that:
Delta = newValue;
UI is not refreshed.
I was thinking that databinding will do that for me. For example I can declare collection as ObservableCollection and then databinding will work.
However there are no ObservableInt, how to say View that it need to be refreshed then?
Probably I should raise some event “notify property changed” or something?
You have two choices:
INotifyPropertyChangedinterface on your class.The simplest option is #1. You can implement the INotifyPropertyChanged interface on your class quite easily:
You can read more about using and implementing dependency properties on MSDN.