Wpf tooltips -set duration for application

I can set properties for one control tooltip, like duration. But I need to set a longer duration for ALL tooltips throughout the application - all windows, all user controls, etc. Is there any clean way to achieve it? Thanks.

+4
source share
1 answer

You can override metadata for ToolTipService.ShowDurationProperty as follows:

 public partial class App : System.Windows.Application { static App() { ToolTipService.ShowDurationProperty.OverrideMetadata(typeof(UIElement), new FrameworkPropertyMetadata(1000)); } } 

The above version of ToolTip will last 1 second for all UIElements.

+7
source

Source: https://habr.com/ru/post/1380580/


All Articles