dotnet/wpf · error

By default, ToolTip property does not support ToolTip…

Error message

By default, ToolTip property does not support ToolTip element with StaysOpen set to false.

What it means

WPF's PopupControlService (which manages ToolTip display) does not support a ToolTip whose Popup-style StaysOpen is set to false. When StaysOpen is false the popup takes mouse capture, which breaks the hit-testing the tooltip service relies on to route input to the correct window. The service detects this and throws NotSupportedException instead of showing a broken tooltip.

Solutions

  1. Remove StaysOpen=false from the ToolTip (leave it at the default true)
  2. If you need click-outside-to-close behavior, use a Popup directly instead of ToolTip
  3. Handle tooltip dismissal via the tooltip's Opened/Closed events or ToolTipService durations instead of StaysOpen

Example fix

// before
var tt = new ToolTip { Content = "Help", StaysOpen = false };
button.ToolTip = tt;
// after
var tt = new ToolTip { Content = "Help" };
button.ToolTip = tt;
Defensive patterns

Strategy: validation

Validate before calling

if (tooltip is ToolTip t && !t.StaysOpen) { t.StaysOpen = true; } // enforce before assigning to element.ToolTip

Type guard

static bool IsSupportedToolTip(ToolTip t) => t == null || t.StaysOpen;

Prevention

When it happens

Trigger: Setting ToolTip.StaysOpen=false on a ToolTip assigned via FrameworkElement.ToolTip or ToolTipService, then hovering the element so ShowToolTip promotes it to the current tooltip.

Common situations: Developers copying popup settings onto tooltips, or trying to force the tooltip to close on outside click by reusing Popup options that are valid for Popup but not for ToolTip.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of dotnet/wpf@81131a70a4 (2026-09-14). Data as JSON: /api/errors/0d8e648146b15e44. Report an issue: GitHub.

Appendix: source

Thrown at src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/PopupControlService.cs:460

                {
                    _currentToolTip = new ToolTip();
                    _currentToolTip.SetValue(ServiceOwnedProperty, BooleanBoxes.TrueBox);

                    // Bind the content of the tooltip to the ToolTip attached property
                    Binding binding = new Binding
                    {
                        Path = new PropertyPath(ToolTipService.ToolTipProperty),
                        Mode = BindingMode.OneWay,
                        Source = o
                    };
                    _currentToolTip.SetBinding(ToolTip.ContentProperty, binding);
                }

                if (!_currentToolTip.StaysOpen)
                {
                    // The popup takes capture in this case, which causes us to hit test to the wrong window.
                    // We do not support this scenario. Cleanup and then throw and exception.
                    throw new NotSupportedException(SR.ToolTipStaysOpenFalseNotAllowed);
                }

                _currentToolTip.SetValue(OwnerProperty, o);
                _currentToolTip.Closed += OnToolTipClosed;
                _currentToolTip.FromKeyboard = fromKeyboard;

                if (!_currentToolTip.IsOpen)
                {
                    // open the tooltip, and finish the initialization when its popup window is available.
                    _currentToolTip.Opened += OnToolTipOpened;
                    _currentToolTip.IsOpen = true;
                }
                else
                {
                    // If the tooltip is already open, initialize it now. This only happens when the
                    // app manages the tooltip directly.
                    SetSafeArea(_currentToolTip);
                }

View on GitHub (pinned to 81131a70a4)