diff options
author | Bret Johnson <bret.johnson@microsoft.com> | 2022-04-14 09:36:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-14 09:36:45 +0300 |
commit | de074647b9f8f5a8dabfe16bd986cf0084c51c7b (patch) | |
tree | f0e0d9ca5c6bb746df3b603308b105a6293945f9 /Xamarin.PropertyEditing.Windows | |
parent | b0db811113957cc9dc70f883190ad3bd98918671 (diff) |
Set a11y name for editable combo TextEdit (#808)
Set the Automation.Name property for the TextEdit control in
an editable combo to be the same as that for the entire combo
box.
Fixes AB#1501925
Diffstat (limited to 'Xamarin.PropertyEditing.Windows')
-rwxr-xr-x[-rw-r--r--] | Xamarin.PropertyEditing.Windows/ComboBoxEx.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Xamarin.PropertyEditing.Windows/ComboBoxEx.cs b/Xamarin.PropertyEditing.Windows/ComboBoxEx.cs index a66d18c..6d9bd3f 100644..100755 --- a/Xamarin.PropertyEditing.Windows/ComboBoxEx.cs +++ b/Xamarin.PropertyEditing.Windows/ComboBoxEx.cs @@ -1,4 +1,5 @@ using System.Windows; +using System.Windows.Automation; using System.Windows.Automation.Peers; using System.Windows.Controls; using System.Windows.Input; @@ -27,6 +28,18 @@ namespace Xamarin.PropertyEditing.Windows return new ComboBoxExAutomationPeer (this); } + public override void OnApplyTemplate () + { + base.OnApplyTemplate (); + + var textBox = Template.FindName ("PART_EditableTextBox", this) as TextBox; + if (textBox != null) { + string accessibilityName = AutomationProperties.GetName (this); + + AutomationProperties.SetName (textBox, accessibilityName); + } + } + protected override void OnSelectionChanged (SelectionChangedEventArgs e) { base.OnSelectionChanged (e); |