/// <summary> /// The UpdatePropertyStates method updates the properties IsEnabled when the instance being edited implements IPropertyStateUpdater. /// </summary> /// <param name = "instance"> /// The instance. /// </param> private void UpdatePropertyStates(object instance) { var psi = instance as IPropertyStateUpdater; if (psi == null) { return; } var ps = new PropertyStateBag(); psi.UpdatePropertyStates(ps); foreach (var ep in ps.EnabledProperties) { var p = propertyMap[ep.Key]; if (p != null && p.IsEnabled != ep.Value) { p.IsEnabled = ep.Value; } } }