Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/xwt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBret Johnson <bret.johnson@microsoft.com>2018-07-09 08:41:27 +0300
committerBret Johnson <bret.johnson@microsoft.com>2018-07-09 08:46:50 +0300
commit973c6d3eb93dede6887b7b673b5dfac54d13283e (patch)
tree9874912c8ae7ea21d8363889e2bdee4181ec11b0
parent247a369189df640b35bea0860b4c1cd0eecff2df (diff)
[a11y][WPF] Updated spinner automation peer
Now the automation peer for the spinner control is returned both from the TextBox (when it has the focus) and the outer UserControl. In both cases the returned peer is for the outer control. With this, the Narrator seems to work well with the spinner.
-rw-r--r--Xwt.WPF/Xwt.WPFBackend/WindowsSpinButton.xaml.cs12
1 files changed, 9 insertions, 3 deletions
diff --git a/Xwt.WPF/Xwt.WPFBackend/WindowsSpinButton.xaml.cs b/Xwt.WPF/Xwt.WPFBackend/WindowsSpinButton.xaml.cs
index cb212fa4..5adf6bb5 100644
--- a/Xwt.WPF/Xwt.WPFBackend/WindowsSpinButton.xaml.cs
+++ b/Xwt.WPF/Xwt.WPFBackend/WindowsSpinButton.xaml.cs
@@ -459,6 +459,12 @@ namespace Xwt.WPFBackend
#endregion
#region Accessibility
+
+ protected override AutomationPeer OnCreateAutomationPeer ()
+ {
+ return new WindowsSpinButtonAutomationPeer (this);
+ }
+
class SpinButtonTextBox : TextBox
{
WindowsSpinButton spinButton;
@@ -470,7 +476,7 @@ namespace Xwt.WPFBackend
protected override AutomationPeer OnCreateAutomationPeer ()
{
- return new WindowsSpinButtonAutomationPeer (spinButton);
+ return UIElementAutomationPeer.FromElement (spinButton);
}
}
@@ -499,12 +505,12 @@ namespace Xwt.WPFBackend
protected override bool IsKeyboardFocusableCore ()
{
- return true;
+ return Button.IsEnabled;
}
protected override bool HasKeyboardFocusCore ()
{
- return Button.TextBox.IsFocused;
+ return Button.IsKeyboardFocusWithin;
}
protected override void SetFocusCore ()