I'm using MVVM and within one of my VM's I have an IsEditable
property (well they all do from a base class) which is used by a series of buttons to determine whether their commands can fire.
This VM also has a sub VM for which I need to echo this IsEditable
property down to, currently I'm overriding my OnPropertyChanged
method to check if the property being refreshed is .Equals("IsEditable")
.
I've got a nagging which is telling me this isn't really good practice, if this IsEditable
is renamed in the future then this functionality will break silently. Is there a better way to do this, or to be able to use the property name with reflection, e.g.:
if (propertyRefreshName.Equals(IsEditable.Name))
{
// Echo down IsEditable change....
}