void OnSetAsInitialCanExecute(object sender, CanExecuteRoutedEventArgs e) { ModelItem stateMachineModelItem = StateContainerEditor.GetStateMachineModelItem(this.ModelItem); e.CanExecute = (!this.IsReadOnly && stateMachineModelItem != null && this.ModelItem != stateMachineModelItem.Properties[StateMachineDesigner.InitialStatePropertyName].Value && !this.IsFinalState() && !this.IsRootDesigner && StateContainerEditor.GetEmptyConnectionPoints(this).Count > 0); e.Handled = true; }