MaterialDesignInXamlToolkit
MaterialDesignInXamlToolkit copied to clipboard
MaterialDesignEmbeddedDialogHost and focus on open
When using DialogHost in a Style="{StaticResource MaterialDesignEmbeddedDialogHost}" configuration, then when opening, the focus for the first focusable control doesn't seem quite right.
It can be replicated using dialoghost Sample 2 "pass view".
If I use the embedded version, then nothing seems to have focus.
If I add FocusManager.FocusedElement="{Binding RelativeSource={RelativeSource Self}}" to the first button in embedded a dialoghost:
However I can't just hit enter on that button and there's no dashed lines in the button like this either:
Which seems related to it setting logical focus, but not physical focus: https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/focus-overview#logical-focus