MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit
MaterialDesignEmbeddedDialogHost and focus on open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 16.3k
- Forks
- 3.5k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 8
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with DialogHost Sample 2, “pass view,” using the MaterialDesignEmbeddedDialogHost style. Compare focus behavior when opening the embedded dialog, including keyboard activation and the visible focus indicator; done means the first focusable control receives physical focus and Enter activates it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100