diff --git a/src/Avalonia.Controls/ToolTip.cs b/src/Avalonia.Controls/ToolTip.cs index 433098e3f5..7eeea5f0d4 100644 --- a/src/Avalonia.Controls/ToolTip.cs +++ b/src/Avalonia.Controls/ToolTip.cs @@ -81,6 +81,10 @@ namespace Avalonia.Controls public static readonly AttachedProperty ServiceEnabledProperty = AvaloniaProperty.RegisterAttached("ServiceEnabled", defaultValue: true, inherits: true); + /// + public static readonly AttachedProperty ShouldUseOverlayLayerProperty = + AvaloniaProperty.RegisterAttached("ShouldUseOverlayLayer"); + /// /// Stores the current instance in the control. /// @@ -301,6 +305,27 @@ namespace Avalonia.Controls public static void SetServiceEnabled(Control element, bool value) => element.SetValue(ServiceEnabledProperty, value); + /// + /// Gets whether the tooltip popup for is shown in the overlay layer. + /// + /// The control to get the property from. + /// + /// See for details. + /// + public static bool GetShouldUseOverlayLayer(Control element) => + element.GetValue(ShouldUseOverlayLayerProperty); + + /// + /// Sets whether the tooltip popup for is shown in the overlay layer. + /// + /// The control to set the property on. + /// Whether to show the tooltip popup in the overlay layer. + /// + /// See for details. + /// + public static void SetShouldUseOverlayLayer(Control element, bool value) => + element.SetValue(ShouldUseOverlayLayerProperty, value); + /// /// Adds a handler for the attached event. /// @@ -421,7 +446,8 @@ namespace Avalonia.Controls _popup.Bind(Popup.HorizontalOffsetProperty, control.GetBindingObservable(HorizontalOffsetProperty)), _popup.Bind(Popup.VerticalOffsetProperty, control.GetBindingObservable(VerticalOffsetProperty)), _popup.Bind(Popup.PlacementProperty, control.GetBindingObservable(PlacementProperty)), - _popup.Bind(Popup.CustomPopupPlacementCallbackProperty, control.GetBindingObservable(CustomPopupPlacementCallbackProperty)) + _popup.Bind(Popup.CustomPopupPlacementCallbackProperty, control.GetBindingObservable(CustomPopupPlacementCallbackProperty)), + _popup.Bind(Popup.ShouldUseOverlayLayerProperty, control.GetBindingObservable(ShouldUseOverlayLayerProperty)) }); _popup.PlacementTarget = control;