private void CanChangeStage() { if (canCut) { CutCommand.RaiseCanExecuteChanged(); } else if (canFlowering) { FloweringStageCommand.RaiseCanExecuteChanged(); } else if (canGrowth) { GrowthStageCommand.RaiseCanExecuteChanged(); } else if (canGermination) { GerminationStageCommand.RaiseCanExecuteChanged(); } else if (canSeed) { SeedStageCommand.RaiseCanExecuteChanged(); } else if (canStart) { StartCommand.RaiseCanExecuteChanged(); } }
internal void DeselectAllShapes() { foreach (IShape shape in Selected) { shape.IsSelected = false; } Selected.Clear(); DeleteSelectedShapesCommand.RaiseCanExecuteChanged(); CopyCommand.RaiseCanExecuteChanged(); CutCommand.RaiseCanExecuteChanged(); }
private void SelectedItems_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { if (SelectedItems.Count == 1) { SelectedItem = SelectedItems.First(); } else { SelectedItem = null; } CopyCommand.RaiseCanExecuteChanged(); CutCommand.RaiseCanExecuteChanged(); PasteCommand.RaiseCanExecuteChanged(); CreateGroupCommand.RaiseCanExecuteChanged(); MoveToGroupCommand.RaiseCanExecuteChanged(); CreateNodeCommand.RaiseCanExecuteChanged(); }
/// <summary> /// Raises commands can execute event. /// </summary> public virtual void UpdateCommandsCanExecute() { if (this.DeleteCommand != null) { DeleteCommand.RaiseCanExecuteChanged(); } if (this.CutCommand != null) { CutCommand.RaiseCanExecuteChanged(); } if (this.CopyCommand != null) { CopyCommand.RaiseCanExecuteChanged(); } if (this.PasteCommand != null) { PasteCommand.RaiseCanExecuteChanged(); } }
internal void SelectShape(IShape shape, bool clearSelection) { if (shape == null) { return; } if (clearSelection) { DeselectAllShapes(); Selected.Add(shape); shape.IsSelected = true; DeleteSelectedShapesCommand.RaiseCanExecuteChanged(); CopyCommand.RaiseCanExecuteChanged(); CutCommand.RaiseCanExecuteChanged(); } else { Selected.Add(shape); shape.IsSelected = true; DeleteSelectedShapesCommand.RaiseCanExecuteChanged(); CopyCommand.RaiseCanExecuteChanged(); CutCommand.RaiseCanExecuteChanged(); } }