Ejemplo n.º 1
0
        void OnCopyCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            Selection    selection    = this.Context.Items.GetValue <Selection>();
            DesignerView designerView = this.Context.Services.GetService <DesignerView>();

            if (null != selection &&
                selection.SelectedObjects.Contains(this.ModelItem))
            {
                // Copy is intentionally disabled, when the root (TransitionDesigner)
                // is selected, because we don't support transition copy on the FreeFormPanel.
                e.CanExecute = false;
            }
            else
            {
                e.CanExecute = !this.IsReadOnly && CutCopyPasteHelper.CanCopy(this.Context);
            }

            e.ContinueRouting = false;
            e.Handled         = true;
        }