private void OnIsPinnedChanged() { if (IsPinned) { #if TRACE_DETAILS Debug.WriteLine("ToolTip just got pinned"); #endif if (_adornerDragDrop is null && _adorner != null) { _adornerDragDrop = ControlAdornerDragDrop.Attach(_adorner, _dragGrip); } StopTimer(); } else { #if TRACE_DETAILS Debug.WriteLine("ToolTip just got unpinned"); #endif if (_adornerDragDrop != null) { ControlAdornerDragDrop.Detach(_adornerDragDrop); _adornerDragDrop = null; } Hide(); } IsPinnedChanged?.Invoke(this, EventArgs.Empty); }
private void CreateAdorner() { if (_adorner != null || (Application.Current.MainWindow is null && _userDefinedAdorner is null)) { return; } var adornedElement = GetAdornerElement(); if (adornedElement is null) { return; } var layer = AdornerLayer.GetAdornerLayer(adornedElement); if (layer is null) { return; } _isPositionCalculated = false; var ad = new ControlAdorner(adornedElement) { Child = this, Focusable = false }; KeyboardNavigation.SetTabNavigation(ad, KeyboardNavigationMode.None); layer.Add(ad); BringFluentRibbonBackstageToFront(layer, adornedElement); _adorner = ad; _adornerLayer = layer; if (IsPinned && _adornerDragDrop is null) { _adornerDragDrop = ControlAdornerDragDrop.Attach(_adorner, _dragGrip); } RegisterBeingInFront(); }
public void BringToFront() { if (IsInFront()) { return; } if (!IsPinned || _adorner is null) { return; } if (_adornerDragDrop != null) { ControlAdornerDragDrop.Detach(_adornerDragDrop); _adornerDragDrop = null; } _adornerLayer.Remove(_adorner); var adornedElement = GetAdornerElement(); if (adornedElement is null) { return; } _adornerLayer = AdornerLayer.GetAdornerLayer(adornedElement); if (_adornerLayer is null) { return; } _adornerLayer.Add(_adorner); BringFluentRibbonBackstageToFront(_adornerLayer, adornedElement); if (IsPinned && _adornerDragDrop is null) { _adornerDragDrop = ControlAdornerDragDrop.Attach(_adorner, _dragGrip); } RegisterBeingInFront(); }
private void OnIsPinnedChanged() { if (IsPinned) { if (_adornerDragDrop == null && _adorner != null) { _adornerDragDrop = ControlAdornerDragDrop.Attach(_adorner, _dragGrip); } StopTimer(); } else { if (_adornerDragDrop != null) { ControlAdornerDragDrop.Detach(_adornerDragDrop); _adornerDragDrop = null; } Hide(); } IsPinnedChanged.SafeInvoke(this); }