How to remove global FocusVisualStyle for all controls?

I met the same problem as Deactivating FocusVisualStyle globally .

But none of the answers can work.

So, I just want to set all the controls in my application FocusVisualStyle="{x:Null}" , any efficient way to achieve this?

I do not want to install each control separately.

+6
source share
1 answer

How to simply put this in your Application.Resources ?:

 <Style TargetType="{x:Type Control}"> <Setter Property="FocusVisualStyle" Value="{x:Null}" /> </Style> 

To also affect uncontrolled controls, try instead:

 <Style TargetType="{x:Type FrameworkElement}"> <Setter Property="FocusVisualStyle" Value="{x:Null}" /> </Style> 

Since Control is derived from FrameworkElement , they will all use this Style as well.

+7
source

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


All Articles