Пример #1
0
 private void OnPreviewControlMouseLeave(object sender, MouseEventArgs e)
 {
     if (!PreviewControl.StaysOpen)
     {
         PreviewControl.TransitionToState(PreviewControl.State.Condensed);
     }
 }
Пример #2
0
 private void OnPreviewControlMouseEnter(object sender, MouseEventArgs e)
 {
     if (PreviewControl.IsCondensed)
     {
         PreviewControl.TransitionToState(PreviewControl.State.Expanded);
     }
 }
Пример #3
0
        private void TryShowPreviewBubbles()
        {
            nodeWasClicked = false;

            // Always set old ZIndex to the last value, even if mouse is not over the node.
            oldZIndex = NodeViewModel.StaticZIndex;

            // There is no need run further.
            if (IsPreviewDisabled())
            {
                return;
            }

            if (PreviewControl.IsInTransition) // In transition state, come back later.
            {
                return;
            }

            if (PreviewControl.IsHidden)
            {
                if (!previewControl.IsDataBound)
                {
                    PreviewControl.BindToDataSource();
                }

                PreviewControl.TransitionToState(PreviewControl.State.Condensed);
            }

            Dispatcher.DelayInvoke(previewDelay, BringToFront);
        }
Пример #4
0
        private void OnNodeViewMouseMove(object sender, MouseEventArgs e)
        {
            if (Mouse.Captured == null)
            {
                return;
            }

            bool isInside = IsMouseInsideNodeOrPreview(e.GetPosition(this));

            if (!isInside && PreviewControl != null && previewControl.IsCondensed)
            {
                PreviewControl.TransitionToState(PreviewControl.State.Hidden);
            }
        }
Пример #5
0
        /// <summary>
        /// Enables/disables preview control.
        /// </summary>
        internal void TogglePreviewControlAllowance()
        {
            previewEnabled = !previewEnabled;

            if (previewEnabled == false && !PreviewControl.StaysOpen)
            {
                if (PreviewControl.IsExpanded)
                {
                    PreviewControl.TransitionToState(PreviewControl.State.Condensed);
                    PreviewControl.TransitionToState(PreviewControl.State.Hidden);
                }
                else if (PreviewControl.IsCondensed)
                {
                    PreviewControl.TransitionToState(PreviewControl.State.Hidden);
                }
            }
        }
Пример #6
0
        private void OnNodeViewMouseLeave(object sender, MouseEventArgs e)
        {
            ViewModel.ZIndex = oldZIndex;

            // If mouse in over node/preview control or preview control is pined, we can not hide preview control.
            if (IsMouseOver || PreviewControl.IsMouseOver || PreviewControl.StaysOpen ||
                (Mouse.Captured is DragCanvas && IsMouseInsideNodeOrPreview(e.GetPosition(this))))
            {
                return;
            }

            // If it's expanded, then first condense it.
            if (PreviewControl.IsExpanded)
            {
                PreviewControl.TransitionToState(PreviewControl.State.Condensed);
            }
            // If it's condensed, then try to hide it.
            if (PreviewControl.IsCondensed && Mouse.Captured == null)
            {
                PreviewControl.TransitionToState(PreviewControl.State.Hidden);
            }
        }