I have the following property in my view model and the view is binding to this property.
All works fine except for a special case where the ActiveCategory (within the _catManager) can change from other events (outside of this view).
I don’t want to expose the entire Category Manager in the view model so I’m only exposing what properties I need. What is the best way to do this so that the view gets notified of all changes, even those changes not triggered within this view model?
public ICategory SelectedCategory
{
get
{
return _catManager.ActiveCategory;
}
set
{
_catManager.ActiveCategory = value;
OnPropertyChanged("SelectedCategory");
}
}
Have your viewmodel hook into the _catManager’s INotifyPropertyChanged event and have it relay the property change events through the viewmodel. When you see “ActiveCategory” come through, that means you need to raise an INPC for “SelectedCategory”.