Пример #1
0
        private static void CanRedo(object target, CanExecuteRoutedEventArgs args)
        {
            CanvasView cv = target as CanvasView;

            if (cv == null)
            {
                return;
            }

            cv.CommandRedo_CanExecute(target, args);
        }
Пример #2
0
        private static void OnDelete(object target, ExecutedRoutedEventArgs args)
        {
            CanvasView cv = target as CanvasView;

            if (cv == null)
            {
                return;
            }

            cv.CommandDelete_Executed(target, args);
            args.Handled = true;
        }
Пример #3
0
        public static CanvasView GetCanvasView(DependencyObject obj)
        {
            while (obj != null)
            {
                CanvasView cv = obj as CanvasView;
                if (cv != null)
                {
                    return(cv);
                }
                obj = VisualTreeHelper.GetParent(obj);
            }

            return(null);
        }