private void Expand_Click(object sender, RoutedEventArgs e)
		{
			var clickedButton = (ToggleButton)e.OriginalSource;
			var clickedNode = (TreeNode)clickedButton.DataContext;
			
			if (clickedButton.IsChecked == true && clickedNode.GetChildren != null) {
				Point popupPos = clickedButton.PointToScreen(ChildPopupOffset).TransformFromDevice(clickedButton);
				this.ChildTooltip = new DebuggerTooltipControl(clickedNode.GetChildren()) {
					// We can not use placement target otherwise we would get too deep logical tree
					Placement = PlacementMode.Absolute,
					HorizontalOffset = popupPos.X,
					VerticalOffset = popupPos.Y,
				};
				
				// The child is now tracking the focus
				this.StaysOpen = true;
				this.ChildTooltip.StaysOpen = false;
				
				this.ChildTooltip.Closed += delegate {
					// The null will have the effect of ignoring the next click
					clickedButton.IsChecked = clickedButton.IsMouseOver ? (bool?)null : false;
					// Either keep closing or make us the new leaf
					if (this.IsMouseOver) {
						this.StaysOpen = false;
					} else {
						this.IsOpen = false;
					}
				};
				this.ChildTooltip.IsOpen = true;
			}
		}
Beispiel #2
0
        public DebuggerPopup(DebuggerTooltipControl parentControl, Location logicalPosition, bool showPins = true)
        {
            this.innerControl = new DebuggerTooltipControl(parentControl, logicalPosition, showPins);
            this.innerControl.containingPopup = this;
            this.Child  = this.innerControl;
            this.IsLeaf = false;

            //this.KeyDown += new KeyEventHandler(DebuggerPopup_KeyDown);

            //this.contentControl.Focusable = true;
            //Keyboard.Focus(this.contentControl);
            //this.AllowsTransparency = true;
            //this.PopupAnimation = PopupAnimation.Slide;
        }
        private void Expand_Click(object sender, RoutedEventArgs e)
        {
            var clickedButton = (ToggleButton)e.OriginalSource;
            var clickedNode   = (TreeNode)clickedButton.DataContext;

            if (clickedButton.IsChecked == true && clickedNode.GetChildren != null)
            {
                Point popupPos = clickedButton.PointToScreen(ChildPopupOffset).TransformFromDevice(clickedButton);
                this.ChildTooltip = new DebuggerTooltipControl(clickedNode.GetChildren())
                {
                    // We can not use placement target otherwise we would get too deep logical tree
                    Placement        = PlacementMode.Absolute,
                    HorizontalOffset = popupPos.X,
                    VerticalOffset   = popupPos.Y,
                };

                // The child is now tracking the focus
                this.StaysOpen = true;
                this.ChildTooltip.StaysOpen = false;

                this.ChildTooltip.Closed += delegate {
                    // The null will have the effect of ignoring the next click
                    clickedButton.IsChecked = clickedButton.IsMouseOver ? (bool?)null : false;
                    // Either keep closing or make us the new leaf
                    if (this.IsMouseOver)
                    {
                        this.StaysOpen = false;
                    }
                    else
                    {
                        this.IsOpen = false;
                    }
                };
                this.ChildTooltip.IsOpen = true;
            }
        }
Beispiel #4
0
 public DebuggerTooltipControl(DebuggerTooltipControl parentControl, Location logicalPosition)
     : this(logicalPosition)
 {
     this.parentControl = parentControl;
 }
 public DebuggerTooltipControl(DebuggerTooltipControl parentControl, Location logicalPosition, bool showPins = true)
     : this(logicalPosition)
 {
     this.parentControl = parentControl;
     this.showPins      = showPins;
 }