Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to enable ToolTipService.ShowOnDisabled=true for entire application

Tags:

c#

wpf

tooltip

Is there any way to enable ToolTipService.ShowOnDisabled = true for entire application or do I have to set it for every single control in my WPF application manually?

I do not think restyling every control is a good solution.

like image 406
Marek Avatar asked Mar 23 '13 14:03

Marek


1 Answers

You can override the property metadata for ToolTipService.ShowOnDisabled and set its default value to true (by default value is false) and it will apply to all the controls in your application.

Put this code in your App.xaml.cs

static App()
{
    ToolTipService.ShowOnDisabledProperty.OverrideMetadata(typeof(Control),
              new FrameworkPropertyMetadata(true)); 
}
like image 121
Rohit Vats Avatar answered Sep 28 '22 05:09

Rohit Vats