I want to avoid focus coming on wpf Grid
for that I have tried:
<Grid Focusable="False" />
but it is not working. I also tried with:
<Grid x:Name="Grid" Focusable="False" FocusVisualStyle="{x:Null}" />
but I again failed. How can I avoid focus coming on Grid
?
ContentControl
has a default Focusable="True"
, because Control
base class overrides the metadata of the Focusable property and sets its default to true - MSDN
.
Just set the value to false:
<ContentControl Focusable="False" />
To keep track of where it comes focus, Snoop
a wonderful program. In it, you can find the source of focus.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With