Focus management improvements to ContentDialog#1614
Focus management improvements to ContentDialog#1614Koichi-Kobayashi wants to merge 1 commit intolepoco:mainfrom
Conversation
- Add button names (PART_ContentDialogPrimaryButton, PART_ContentDialogSecondaryButton, PART_ContentDialogCloseButton) to XAML template - Add Focusable and IsTabStop properties to buttons in XAML template - Implement SetFocusToFirstAvailableButton method with checkIsFocused parameter - Set focus early in OnLoaded/OnApplyTemplate without validation - Validate focus state using Dispatcher.BeginInvoke in OnLoaded to respect developer logic - Skip focus setting if already on button or non-button control - Auto-focus primaryButton when focus is on ContentDialog or nowhere - Add helper methods IsButtonAvailableForFocus and TrySetFocusToButton - Add Gallery samples demonstrating focus management behavior: - Three Button ContentDialog (Default Focus: Secondary Button) - ContentDialog with Focusable Content (Default Focus: Primary Button) - ContentDialog with Icons (Default Focus: Secondary Button) - ContentDialog with Auto Focus (Default Focus: Primary Button)
|
Hello, @apachezy |
|
😅, I've reopened #1601. It's possible that it overlaps with this PR... |
|
@apachezy |
|
I'm withdrawing this as it was a duplicate. |
|
I apologize, the discussion I sent you previously was AI-translated and edited, and may be inaccurate or misleading. The focus priority logic I'm trying to convey is:
I only used translation software this time, and I hope my expression is accurate enough. |
Pull request type
What is the current behavior?
Issue Number: #1585
What is the new behavior?
Other information