コード例 #1
0
        private void MoveThumb_DragCompleted(object sender, DragCompletedEventArgs e)
        {
            this.guideItem.IsSelected = false;
            if (this.adorner != null)
            {
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);
                if (adornerLayer != null)
                {
                    adornerLayer.Remove(this.adorner);
                }
                this.adorner = null;
            }

            // redo/undo
            if (pageUndoManager == null)
            {
                return;
            }
            if (this.guideItem is HorizontalGuideLine)
            {
                HorizontalGuideLine        hGuide = this.guideItem as HorizontalGuideLine;
                GuidePropertyChangeCommand cmd    = new GuidePropertyChangeCommand(hGuide.Guide, "Y", oldPos, guideItem.Guide.Y);
                pageUndoManager.Push(cmd);
            }
            else
            {
                VerticalGuideLine          hGuide = this.guideItem as VerticalGuideLine;
                GuidePropertyChangeCommand cmd    = new GuidePropertyChangeCommand(hGuide.Guide, "X", oldPos, guideItem.Guide.X);
                pageUndoManager.Push(cmd);
            }
        }
コード例 #2
0
        private void LockExecute(object obj)
        {
            GuidePropertyChangeCommand cmd = new GuidePropertyChangeCommand(_guide, "IsLocked", IsLocked, !IsLocked);

            CurrentUndoManager.Push(cmd);

            IsLocked = !IsLocked;
        }