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();
     }
 }
Example #2
0
 internal void DeselectAllShapes()
 {
     foreach (IShape shape in Selected)
     {
         shape.IsSelected = false;
     }
     Selected.Clear();
     DeleteSelectedShapesCommand.RaiseCanExecuteChanged();
     CopyCommand.RaiseCanExecuteChanged();
     CutCommand.RaiseCanExecuteChanged();
 }
Example #3
0
        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();
        }
Example #4
0
 /// <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();
     }
 }
Example #5
0
 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();
     }
 }