RaisePropertyChanged for Windows Phone
- by chief7
I'm starting to use the MVVMLight framework and have a question about binding to properties in the ViewModel. I found that I have to call the RaisePropertyChanged method in the setter for the property in order for the View to be updated. And I have to call RaisePropertyChanged from through the dispatcher otherwise I get a thread access error.
public string Lat { get { return _lat; } set
{
_lat = value;
Deployment.Current.Dispatcher.BeginInvoke(() => RaisePropertyChanged("Lat"));
} }
This works but its a lot of code to get auto binding properties. Is there a helper to handle this more cleanly?