private void StrategyEditStateChanged(object sender, Notification.StateChangedEventArgs e) { StrategyEditViewModel strategyEdit = sender as StrategyEditViewModel; _log.Debug(m => m("StrategyEdit ({0}) state changed for control {1}; was {2}, now is {3}", strategyEdit.InternalId, Id, e.OldState.ToString().ToLower(), e.NewState.ToString().ToLower())); // To save the property changed notifications being raised multiple times during an evaluation, // ignore this event if that is what we're doing. (The primary purpose of this event is to handle // the scenario where another control is changing value.) if (!_currentlyEvaluatingValidationState) { RefreshUiState(false); } else { _log.Debug("Ignoring StrategyEdit change notification as this control's value change is currently being processed"); } }
internal void UnbindStrategyEdit(StrategyEditViewModel strategyEditViewModel) { strategyEditViewModel.StateChanged -= new EventHandler <StateChangedEventArgs>(StrategyEditStateChanged); _validationState.Remove(strategyEditViewModel); }
internal void BindStrategyEdit(StrategyEditViewModel strategyEditViewModel) { strategyEditViewModel.StateChanged += new EventHandler <StateChangedEventArgs>(StrategyEditStateChanged); _validationState.Add(strategyEditViewModel); }