diff options
author | Bret Johnson <bret.johnson@microsoft.com> | 2018-05-04 04:07:18 +0300 |
---|---|---|
committer | Bret Johnson <bret.johnson@microsoft.com> | 2018-05-04 04:07:18 +0300 |
commit | efe4329d49556edac60a322c0594b4de1dc74de9 (patch) | |
tree | ea8f88e2bceb8224e9e1bd3edac250d1f367721f /Xwt.WPF | |
parent | c1828a260433cfd63a692d68580b41281982adf6 (diff) |
Fix so dialog button group ItemsControls aren't Focusable
Previously, the WPF ItemControls for dialog button groups, used to
lay out the buttons, were Focusable. That's apparently the
default for ItemControls (for reasons I don't fully understand, as it's
not normally for other WPF container controls).
Anyway, this caused the problem that when tabbing thru the dialog
controls you can set the focus not just to the buttons
themselves but also to the ItemsControl that contains them.
So tab navigation in the dialogs was somewhat broken, with two extra
stops for the two groups. Setting Focusable to false fixes that.
This fixes:
https://devdiv.visualstudio.com/DevDiv/Xamarin%20Android%20Designer/_workitems/edit/601178
https://devdiv.visualstudio.com/DevDiv/Xamarin%20Android%20Designer/_workitems/edit/601174
https://devdiv.visualstudio.com/DevDiv/Xamarin%20Android%20Designer/_workitems/edit/601170
Diffstat (limited to 'Xwt.WPF')
-rw-r--r-- | Xwt.WPF/Xwt.WPFBackend/DialogBackend.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Xwt.WPF/Xwt.WPFBackend/DialogBackend.cs b/Xwt.WPF/Xwt.WPFBackend/DialogBackend.cs index 2d27c88e..f54c9605 100644 --- a/Xwt.WPF/Xwt.WPFBackend/DialogBackend.cs +++ b/Xwt.WPF/Xwt.WPFBackend/DialogBackend.cs @@ -1,4 +1,4 @@ -// +// // DialogBackend.cs // // Author: @@ -65,6 +65,10 @@ namespace Xwt.WPFBackend { cmd = new DelegatedCommand<WpfDialogButton> (OnButtonClicked); + // Surprisingly, the ItemsControls are focusable by default; disable that to fix tab navigation + this.leftButtonContainer.Focusable = false; + this.rightButtonContainer.Focusable = false; + this.leftButtonContainer.ItemsPanel = leftPanelTemplate; this.leftButtonContainer.ItemTemplateSelector = new DialogButtonTemplateSelector(ButtonStyle, cmd); this.leftButtonContainer.ItemsSource = this.leftButtons; |