예제 #1
0
        private void OnLostFocus(object sender, RoutedEventArgs args)
        {
            MyParent.PreviewMouseLeftButtonDown -= OnPreviewParentMouseDown;
            PreviewKeyDown          -= OnPreviewKeyDown;
            adorner.ResizeStarted   -= OnResizeStarted;
            adorner.ResizeCompleted -= OnResizeCompleted;

            var adornerLayer = AdornerLayer.GetAdornerLayer(MyContent);

            adornerLayer.Remove(adorner);
            adorner = null;
        }
예제 #2
0
        private void OnGotFocus(object sender, RoutedEventArgs args)
        {
            MyParent.PreviewMouseLeftButtonDown += OnPreviewParentMouseDown;
            PreviewKeyDown          += OnPreviewKeyDown;
            adorner                  = new ResizingAdorner(MyContent);
            adorner.ResizeStarted   += OnResizeStarted;
            adorner.ResizeCompleted += OnResizeCompleted;

            var adornerLayer = AdornerLayer.GetAdornerLayer(MyContent);

            adornerLayer.Add(adorner);
        }