[All] Rename Accessibility -> AutomationProperties (#912)
authorSamantha Houts <samhouts@users.noreply.github.com>
Wed, 10 May 2017 17:20:57 +0000 (10:20 -0700)
committerRui Marinho <me@ruimarinho.net>
Wed, 10 May 2017 17:23:00 +0000 (18:23 +0100)
* [All] Renamed Accessibility -> AutomationProperties

* Update docs

* Restore doc summaries

* Revert unintended csproj changes

29 files changed:
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla45067.cs
Xamarin.Forms.Controls/ControlGalleryPages/AutomationPropertiesGallery.cs [moved from Xamarin.Forms.Controls/ControlGalleryPages/AccessibilityGallery.cs with 55% similarity]
Xamarin.Forms.Controls/CoreGallery.cs
Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj
Xamarin.Forms.Core/AutomationProperties.cs [moved from Xamarin.Forms.Core/Accessibility.cs with 76% similarity]
Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
Xamarin.Forms.Platform.Android/FastRenderers/AutomationPropertiesProvider.cs [moved from Xamarin.Forms.Platform.Android/FastRenderers/AccessibilityProvider.cs with 78% similarity]
Xamarin.Forms.Platform.Android/FastRenderers/ButtonRenderer.cs
Xamarin.Forms.Platform.Android/FastRenderers/VisualElementRenderer.cs
Xamarin.Forms.Platform.Android/ViewRenderer.cs
Xamarin.Forms.Platform.Android/VisualElementRenderer.cs
Xamarin.Forms.Platform.Android/Xamarin.Forms.Platform.Android.csproj
Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs
Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs
Xamarin.Forms.Platform.WinRT.Phone/TabbedPageRenderer.cs
Xamarin.Forms.Platform.WinRT/CarouselPageRenderer.cs
Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs
Xamarin.Forms.Platform.WinRT/ViewRenderer.cs
Xamarin.Forms.Platform.WinRT/VisualElementRenderer.cs
Xamarin.Forms.Platform.iOS/Renderers/ButtonRenderer.cs
Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs
Xamarin.Forms.Platform.iOS/ViewRenderer.cs
Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs
Xamarin.Forms.Xaml.UnitTests/Accessibility.xaml [deleted file]
Xamarin.Forms.Xaml.UnitTests/AutomationProperties.xaml [new file with mode: 0644]
Xamarin.Forms.Xaml.UnitTests/AutomationProperties.xaml.cs [moved from Xamarin.Forms.Xaml.UnitTests/Accessibility.xaml.cs with 55% similarity]
Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj
docs/Xamarin.Forms.Core/Xamarin.Forms/AutomationProperties.xml [moved from docs/Xamarin.Forms.Core/Xamarin.Forms/Accessibility.xml with 91% similarity]
docs/Xamarin.Forms.Core/index.xml

index c4292fb..b0a7dd2 100644 (file)
@@ -37,7 +37,7 @@ namespace Xamarin.Forms.Controls.Issues
                                        Placeholder = "Username"
                                };
 
-                               username.SetValue(Accessibility.LabeledByProperty, instructions1);
+                               username.SetValue(AutomationProperties.LabeledByProperty, instructions1);
 
                                var password = new Entry
                                {
@@ -45,7 +45,7 @@ namespace Xamarin.Forms.Controls.Issues
                                        IsPassword = true
                                };
 
-                               password.SetValue(Accessibility.LabeledByProperty, instructions2);
+                               password.SetValue(AutomationProperties.LabeledByProperty, instructions2);
 
                                var button = new Button { Text = "Submit", IsEnabled = false };
 
@@ -1,19 +1,19 @@
 
 namespace Xamarin.Forms.Controls
 {
-       public class AccessibilityGallery : ContentPage
+       public class AutomationPropertiesGallery : ContentPage
        {
-               public AccessibilityGallery()
+               public AutomationPropertiesGallery()
                {
                        // https://developer.xamarin.com/guides/android/advanced_topics/accessibility/
                        // https://developer.xamarin.com/guides/ios/advanced_topics/accessibility/
                        // https://msdn.microsoft.com/en-us/windows/uwp/accessibility/basic-accessibility-information
 
                        const string EntryPlaceholder = "Your name.";
-                       const string EntryHint = "Type your name.";
+                       const string EntryHelpText = "Type your name.";
                        const string ImageName = "Roof";
-                       const string ImageHint = "Tap to show an alert.";
-                       const string BoxHint = "Shows a purple box.";
+                       const string ImageHelpText = "Tap to show an alert.";
+                       const string BoxHelpText = "Shows a purple box.";
                        const string BoxName = "Box";
 
                        string screenReader = "";
@@ -30,16 +30,16 @@ namespace Xamarin.Forms.Controls
                                        scrollFingers = "three fingers";
                                        explore = "Use two fingers to swipe up or down the screen to read all of the elements on this page.";
                                        labeledByInstructions = $"The following Entry should read aloud \"{EntryPlaceholder}.\", plus native instructions on how to use an Entry element. This text comes from the placeholder.";
-                                       imageInstructions = $"The following Image should read aloud \"{ImageName}. {ImageHint}\". You should be able to tap the image and hear an alert box.";
-                                       boxInstructions = $"The following Box should read aloud \"{BoxName}. {BoxHint}\". You should be able to tap the box and hear an alert box.";
+                                       imageInstructions = $"The following Image should read aloud \"{ImageName}. {ImageHelpText}\". You should be able to tap the image and hear an alert box.";
+                                       boxInstructions = $"The following Box should read aloud \"{BoxName}. {BoxHelpText}\". You should be able to tap the box and hear an alert box.";
                                        break;
                                case Device.Android:
                                        screenReader = "TalkBack";
                                        scrollFingers = "two fingers";
                                        explore = "Drag one finger across the screen to read each element on the page.";
-                                       labeledByInstructions = $"The following Entry should read aloud \"EditBox {EntryPlaceholder} for {EntryHint}.\", plus native instructions on how to use an Entry element. This text comes from the Entry placeholder and text of the Label.";
-                                       imageInstructions = $"The following Image should read aloud \"{ImageName}. {ImageHint}\". You should be able to tap the image and hear an alert box.";
-                                       boxInstructions = $"The following Box should read aloud \"{BoxName}. {BoxHint}\". You should be able to tap the box and hear an alert box.";
+                                       labeledByInstructions = $"The following Entry should read aloud \"EditBox {EntryPlaceholder} for {EntryHelpText}.\", plus native instructions on how to use an Entry element. This text comes from the Entry placeholder and text of the Label.";
+                                       imageInstructions = $"The following Image should read aloud \"{ImageName}. {ImageHelpText}\". You should be able to tap the image and hear an alert box.";
+                                       boxInstructions = $"The following Box should read aloud \"{BoxName}. {BoxHelpText}\". You should be able to tap the box and hear an alert box.";
                                        break;
                                case Device.WinRT:
                                case Device.UWP:
@@ -47,21 +47,21 @@ namespace Xamarin.Forms.Controls
                                        screenReader = "Narrator";
                                        scrollFingers = "two fingers";
                                        explore = "Use three fingers to swipe up the screen to read all of the elements on this page.";
-                                       labeledByInstructions = $"The following Entry should read aloud \"{EntryHint}\", plus native instructions on how to use an Entry element. This text comes from the text of the label.";
-                                       imageInstructions = $"The following Image should read aloud \"{ImageName}. {ImageHint}\". Windows does not currently support TapGestures while the Narrator is active.";
-                                       boxInstructions = $"The following Box should read aloud \"{BoxName}. {BoxHint}\". Windows does not currently support TapGestures while the Narrator is active.";
+                                       labeledByInstructions = $"The following Entry should read aloud \"{EntryHelpText}\", plus native instructions on how to use an Entry element. This text comes from the text of the label.";
+                                       imageInstructions = $"The following Image should read aloud \"{ImageName}. {ImageHelpText}\". Windows does not currently support TapGestures while the Narrator is active.";
+                                       boxInstructions = $"The following Box should read aloud \"{BoxName}. {BoxHelpText}\". Windows does not currently support TapGestures while the Narrator is active.";
                                        break;
                                default:
                                        screenReader = "the native screen reader";
                                        break;
                        }
 
-                       var instructions = new Label { Text = $"Please enable {screenReader}. {explore} Use {scrollFingers} to scroll the view. Tap an element once to hear the name and description and native instructions. Double tap anywhere on the screen to activate the selected element. Swipe left or right with one finger to switch to the previous or next element." };
+                       var instructions = new Label { Text = $"Please enable {screenReader}. {explore} Use {scrollFingers} to scroll the view. Tap an element once to hear the name and HelpText and native instructions. Double tap anywhere on the screen to activate the selected element. Swipe left or right with one finger to switch to the previous or next element." };
 
                        var instructions2 = new Label { Text = labeledByInstructions };
-                       var entryLabel = new Label { Text = EntryHint, VerticalOptions = LayoutOptions.Center };
+                       var entryLabel = new Label { Text = EntryHelpText, VerticalOptions = LayoutOptions.Center };
                        var entry = new Entry { Placeholder = EntryPlaceholder };
-                       entry.SetAccessibilityLabeledBy(entryLabel);
+                       entry.SetAutomationPropertiesLabeledBy(entryLabel);
 
                        var entryGroup = new Grid();
                        entryGroup.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Auto) });
@@ -72,18 +72,18 @@ namespace Xamarin.Forms.Controls
 
 
                        var activityIndicator = new ActivityIndicator();
-                       activityIndicator.SetAccessibilityName("Progress indicator");
+                       activityIndicator.SetAutomationPropertiesName("Progress indicator");
 
 
                        const string ButtonText = "Update progress";
-                       const string ButtonHint = "Tap to start/stop the activity indicator.";
+                       const string ButtonHelpText = "Tap to start/stop the activity indicator.";
                        var instructions3 = new Label { Text = $"The following Button should read aloud \"{ButtonText}.\", plus native instructions on how to use a button." };
                        var button = new Button { Text = ButtonText };
-                       button.SetAccessibilityHint(ButtonHint);
+                       button.SetAutomationPropertiesHelpText(ButtonHelpText);
                        button.Clicked += (sender, e) =>
                        {
                                activityIndicator.IsRunning = !activityIndicator.IsRunning;
-                               activityIndicator.SetAccessibilityHint(activityIndicator.IsRunning ? "Running." : "Not running");
+                               activityIndicator.SetAutomationPropertiesHelpText(activityIndicator.IsRunning ? "Running." : "Not running");
                        };
 
 
@@ -91,22 +91,22 @@ namespace Xamarin.Forms.Controls
                        var image = new Image { Source = "photo.jpg" };
                        // The tap gesture will NOT work on Win
                        image.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => DisplayAlert("Success", "You tapped the image", "OK")) });
-                       image.SetAccessibilityName(ImageName);
-                       image.SetAccessibilityHint(ImageHint);
+                       image.SetAutomationPropertiesName(ImageName);
+                       image.SetAutomationPropertiesHelpText(ImageHelpText);
                        // Images are ignored by default on iOS (at least, Forms Images are); 
                        // make accessible in order to enable the gesture and narration
-                       image.SetIsInAccessibleTree(true);
+                       image.SetAutomationPropertiesIsInAccessibleTree(true);
 
 
                        var instructions6 = new Label { Text = boxInstructions };
                        var boxView = new BoxView { Color = Color.Purple };
                        // The tap gesture will NOT work on Win
                        boxView.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => DisplayAlert("Success", "You tapped the box", "OK")) });
-                       boxView.SetAccessibilityName(BoxName);
-                       boxView.SetAccessibilityHint(BoxHint);
+                       boxView.SetAutomationPropertiesName(BoxName);
+                       boxView.SetAutomationPropertiesHelpText(BoxHelpText);
                        // BoxViews are ignored by default on iOS and Win; 
                        // make accessible in order to enable the gesture and narration
-                       boxView.SetIsInAccessibleTree(true);
+                       boxView.SetAutomationPropertiesIsInAccessibleTree(true);
 
 
                        var stack = new StackLayout
@@ -130,46 +130,46 @@ namespace Xamarin.Forms.Controls
                }
        }
 
-       public static class AccessibilityExtensions
+       public static class AutomationPropertiesExtensions
        {
-               public static void SetAccessibilityName(this VisualElement element, string name)
+               public static void SetAutomationPropertiesName(this VisualElement element, string name)
                {
-                       element.SetValue(Accessibility.NameProperty, name);
+                       element.SetValue(AutomationProperties.NameProperty, name);
                }
 
-               public static string GetAccessibilityName(this VisualElement element)
+               public static string GetAutomationPropertiesName(this VisualElement element)
                {
-                       return (string)element.GetValue(Accessibility.NameProperty);
+                       return (string)element.GetValue(AutomationProperties.NameProperty);
                }
 
-               public static void SetAccessibilityHint(this VisualElement element, string hint)
+               public static void SetAutomationPropertiesHelpText(this VisualElement element, string HelpText)
                {
-                       element.SetValue(Accessibility.HintProperty, hint);
+                       element.SetValue(AutomationProperties.HelpTextProperty, HelpText);
                }
 
-               public static string GetAccessibilityHint(this VisualElement element)
+               public static string GetAutomationPropertiesHelpText(this VisualElement element)
                {
-                       return (string)element.GetValue(Accessibility.HintProperty);
+                       return (string)element.GetValue(AutomationProperties.HelpTextProperty);
                }
 
-               public static void SetIsInAccessibleTree(this VisualElement element, bool value)
+               public static void SetAutomationPropertiesIsInAccessibleTree(this VisualElement element, bool value)
                {
-                       element.SetValue(Accessibility.IsInAccessibleTreeProperty, value);
+                       element.SetValue(AutomationProperties.IsInAccessibleTreeProperty, value);
                }
 
-               public static bool GetIsInAccessibleTree(this VisualElement element)
+               public static bool GetAutomationPropertiesIsInAccessibleTree(this VisualElement element)
                {
-                       return (bool)element.GetValue(Accessibility.IsInAccessibleTreeProperty);
+                       return (bool)element.GetValue(AutomationProperties.IsInAccessibleTreeProperty);
                }
 
-               public static void SetAccessibilityLabeledBy(this VisualElement element, Element value)
+               public static void SetAutomationPropertiesLabeledBy(this VisualElement element, Element value)
                {
-                       element.SetValue(Accessibility.LabeledByProperty, value);
+                       element.SetValue(AutomationProperties.LabeledByProperty, value);
                }
 
-               public static Element GetAccessibilityLabeledBy(this VisualElement element)
+               public static Element GetAutomationPropertiesLabeledBy(this VisualElement element)
                {
-                       return (Element)element.GetValue(Accessibility.LabeledByProperty);
+                       return (Element)element.GetValue(AutomationProperties.LabeledByProperty);
                }
        }
 }
index 924d412..26e9a59 100644 (file)
@@ -212,7 +212,7 @@ namespace Xamarin.Forms.Controls
                                }               
                        };
 #endif
-                       SetValue(Accessibility.NameProperty, "SwapRoot");
+                       SetValue(AutomationProperties.NameProperty, "SwapRoot");
                }
        }
 
@@ -245,7 +245,7 @@ namespace Xamarin.Forms.Controls
                }
 
                List<GalleryPageFactory> _pages = new List<GalleryPageFactory> {
-                               new GalleryPageFactory(() => new AccessibilityGallery(), "Accessibility"),
+                               new GalleryPageFactory(() => new AutomationPropertiesGallery(), "Accessibility"),
                                new GalleryPageFactory(() => new PlatformSpecificsGallery(), "Platform Specifics"),
                                new GalleryPageFactory(() => new NativeBindingGalleryPage(), "Native Binding Controls Gallery"),
                                new GalleryPageFactory(() => new XamlNativeViews(), "Xaml Native Views Gallery"),
@@ -377,7 +377,7 @@ namespace Xamarin.Forms.Controls
                                SelectedItem = null;
                        };
 
-                       SetValue(Accessibility.NameProperty, "Core Pages");
+                       SetValue(AutomationProperties.NameProperty, "Core Pages");
                }
 
                NavigationBehavior navigationBehavior;
index 717f31e..5899764 100644 (file)
@@ -85,7 +85,7 @@
     <Compile Include="App.cs" />
     <Compile Include="AppLifeCycle.cs" />
     <Compile Include="Bugzilla44596SplashPage.cs" />
-    <Compile Include="ControlGalleryPages\AccessibilityGallery.cs" />
+    <Compile Include="ControlGalleryPages\AutomationPropertiesGallery.cs" />
     <Compile Include="ControlGalleryPages\CellForceUpdateSizeGalleryPage.cs" />
     <Compile Include="ControlGalleryPages\LayoutAddPerformance.xaml.cs">
       <DependentUpon>LayoutAddPerformance.xaml</DependentUpon>
similarity index 76%
rename from Xamarin.Forms.Core/Accessibility.cs
rename to Xamarin.Forms.Core/AutomationProperties.cs
index 074d5c5..701ae93 100644 (file)
@@ -1,9 +1,9 @@
 
 namespace Xamarin.Forms
 {
-       public class Accessibility
+       public class AutomationProperties
        {
-               public static readonly BindableProperty HintProperty = BindableProperty.Create("Hint", typeof(string), typeof(Element), default(string));
+               public static readonly BindableProperty HelpTextProperty = BindableProperty.Create("HelpText", typeof(string), typeof(Element), default(string));
 
                public static readonly BindableProperty IsInAccessibleTreeProperty = BindableProperty.Create("IsInAccessibleTree", typeof(bool?), typeof(Element), null);
 
@@ -11,9 +11,9 @@ namespace Xamarin.Forms
 
                public static readonly BindableProperty NameProperty = BindableProperty.Create("Name", typeof(string), typeof(Element), default(string));
 
-               public static string GetHint(BindableObject bindable)
+               public static string GetHelpText(BindableObject bindable)
                {
-                       return (string)bindable.GetValue(HintProperty);
+                       return (string)bindable.GetValue(HelpTextProperty);
                }
 
                public static bool? GetIsInAccessibleTree(BindableObject bindable)
@@ -31,9 +31,9 @@ namespace Xamarin.Forms
                        return (string)bindable.GetValue(NameProperty);
                }
 
-               public static void SetHint(BindableObject bindable, string value)
+               public static void SetHelpText(BindableObject bindable, string value)
                {
-                       bindable.SetValue(HintProperty, value);
+                       bindable.SetValue(HelpTextProperty, value);
                }
 
                public static void SetIsInAccessibleTree(BindableObject bindable, bool? value)
index 385ab4c..f18b018 100644 (file)
@@ -50,7 +50,7 @@
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="AbsoluteLayoutFlags.cs" />
-    <Compile Include="Accessibility.cs" />
+    <Compile Include="AutomationProperties.cs" />
     <Compile Include="ActionSheetArguments.cs" />
     <Compile Include="AlertArguments.cs" />
     <Compile Include="AnimatableKey.cs" />
@@ -4,7 +4,7 @@ using Android.Widget;
 
 namespace Xamarin.Forms.Platform.Android.FastRenderers
 {
-       internal class AccessibilityProvider : IDisposable 
+       internal class AutomationPropertiesProvider : IDisposable 
        {
                const string GetFromElement = "GetValueFromElement";
                string _defaultContentDescription;
@@ -14,7 +14,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
 
                IVisualElementRenderer _renderer;
 
-               public AccessibilityProvider(IVisualElementRenderer renderer)
+               public AutomationPropertiesProvider(IVisualElementRenderer renderer)
                {
                        _renderer = renderer;
                        _renderer.ElementPropertyChanged += OnElementPropertyChanged;
@@ -88,8 +88,8 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
                        string value = contentDescription;
                        if (value == GetFromElement)
                        {
-                               value = string.Join(" ", (string)Element.GetValue(Accessibility.NameProperty),
-                                       (string)Element.GetValue(Accessibility.HintProperty));
+                               value = string.Join(" ", (string)Element.GetValue(AutomationProperties.NameProperty),
+                                       (string)Element.GetValue(AutomationProperties.HelpTextProperty));
                        }
 
                        if (!string.IsNullOrWhiteSpace(value))
@@ -115,7 +115,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
                        }
 
                        Control.Focusable =
-                               (bool)(value ?? (bool?)Element.GetValue(Accessibility.IsInAccessibleTreeProperty) ?? _defaultFocusable);
+                               (bool)(value ?? (bool?)Element.GetValue(AutomationProperties.IsInAccessibleTreeProperty) ?? _defaultFocusable);
                }
 
                bool SetHint(string hint = GetFromElement)
@@ -145,8 +145,8 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
                        string value = hint;
                        if (value == GetFromElement)
                        {
-                               value = string.Join(". ", (string)Element.GetValue(Accessibility.NameProperty),
-                                       (string)Element.GetValue(Accessibility.HintProperty));
+                               value = string.Join(". ", (string)Element.GetValue(AutomationProperties.NameProperty),
+                                       (string)Element.GetValue(AutomationProperties.HelpTextProperty));
                        }
 
                        textView.Hint = !string.IsNullOrWhiteSpace(value) ? value : _defaultHint;
@@ -159,7 +159,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
                        if (Element == null || Control == null)
                                return;
 
-                       var elemValue = (VisualElement)Element.GetValue(Accessibility.LabeledByProperty);
+                       var elemValue = (VisualElement)Element.GetValue(AutomationProperties.LabeledByProperty);
 
                        if (elemValue != null)
                        {
@@ -193,19 +193,19 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
 
                void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
                {
-                       if (e.PropertyName == Accessibility.HintProperty.PropertyName)
+                       if (e.PropertyName == AutomationProperties.HelpTextProperty.PropertyName)
                        {
                                SetContentDescription();
                        }
-                       else if (e.PropertyName == Accessibility.NameProperty.PropertyName)
+                       else if (e.PropertyName == AutomationProperties.NameProperty.PropertyName)
                        {
                                SetContentDescription();
                        }
-                       else if (e.PropertyName == Accessibility.IsInAccessibleTreeProperty.PropertyName)
+                       else if (e.PropertyName == AutomationProperties.IsInAccessibleTreeProperty.PropertyName)
                        {
                                SetFocusable();
                        }
-                       else if (e.PropertyName == Accessibility.LabeledByProperty.PropertyName)
+                       else if (e.PropertyName == AutomationProperties.LabeledByProperty.PropertyName)
                        {
                                SetLabeledBy();
                        }
index 05e0471..9632f2b 100644 (file)
@@ -27,7 +27,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
                bool _isDisposed;
            bool _inputTransparent;
            readonly Lazy<TextColorSwitcher> _textColorSwitcher;
-        readonly AccessibilityProvider _accessibilityProvider;
+        readonly AutomationPropertiesProvider _automationPropertiesProvider;
                readonly EffectControlProvider _effectControlProvider;
                VisualElementTracker _tracker;
 
@@ -36,7 +36,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
 
                public ButtonRenderer() : base(Forms.Context)
                {
-            _accessibilityProvider = new AccessibilityProvider(this);
+            _automationPropertiesProvider = new AutomationPropertiesProvider(this);
                        _effectControlProvider = new EffectControlProvider(this);
             _textColorSwitcher = new Lazy<TextColorSwitcher>(() => new TextColorSwitcher(TextColors));
 
@@ -179,7 +179,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
                                SetOnTouchListener(null);
                                RemoveOnAttachStateChangeListener(this);
 
-                               _accessibilityProvider?.Dispose();
+                               _automationPropertiesProvider?.Dispose();
                                _tracker?.Dispose();
 
                                if (Element != null)
index 34ea7e3..0112481 100644 (file)
@@ -13,7 +13,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
                
                IVisualElementRenderer _renderer;
                readonly GestureManager _gestureManager;
-               readonly AccessibilityProvider _accessibilityProvider;
+               readonly AutomationPropertiesProvider _automatiomPropertiesProvider;
                readonly EffectControlProvider _effectControlProvider;
 
                public VisualElementRenderer(IVisualElementRenderer renderer)
@@ -22,7 +22,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
                        _renderer.ElementPropertyChanged += OnElementPropertyChanged;
                        _renderer.ElementChanged += OnElementChanged;
                        _gestureManager = new GestureManager(_renderer);
-                       _accessibilityProvider = new AccessibilityProvider(_renderer);
+                       _automatiomPropertiesProvider = new AutomationPropertiesProvider(_renderer);
                        _effectControlProvider = new EffectControlProvider(_renderer?.View);
                }
 
@@ -64,7 +64,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
                        if (disposing)
                        {
                                _gestureManager?.Dispose();
-                               _accessibilityProvider?.Dispose();
+                               _automatiomPropertiesProvider?.Dispose();
 
                                if (_renderer != null)
                                {
index 842fc5c..1cf7759 100644 (file)
@@ -127,7 +127,7 @@ namespace Xamarin.Forms.Platform.Android
 
                        if (e.PropertyName == VisualElement.IsEnabledProperty.PropertyName)
                                UpdateIsEnabled();
-                       else if (e.PropertyName == Accessibility.LabeledByProperty.PropertyName)
+                       else if (e.PropertyName == AutomationProperties.LabeledByProperty.PropertyName)
                                SetLabeledBy();
                }
 
@@ -177,7 +177,7 @@ namespace Xamarin.Forms.Platform.Android
                        if (_defaultContentDescription == null)
                                _defaultContentDescription = Control.ContentDescription;
 
-                       var elemValue = string.Join(" ", (string)Element.GetValue(Accessibility.NameProperty), (string)Element.GetValue(Accessibility.HintProperty));
+                       var elemValue = string.Join(" ", (string)Element.GetValue(AutomationProperties.NameProperty), (string)Element.GetValue(AutomationProperties.HelpTextProperty));
 
                        if (!string.IsNullOrWhiteSpace(elemValue))
                                Control.ContentDescription = elemValue;
@@ -199,7 +199,7 @@ namespace Xamarin.Forms.Platform.Android
                        if (!_defaultFocusable.HasValue)
                                _defaultFocusable = Control.Focusable;
 
-                       Control.Focusable = (bool)((bool?)Element.GetValue(Accessibility.IsInAccessibleTreeProperty) ?? _defaultFocusable);
+                       Control.Focusable = (bool)((bool?)Element.GetValue(AutomationProperties.IsInAccessibleTreeProperty) ?? _defaultFocusable);
                }
 
                protected override bool SetHint()
@@ -223,7 +223,7 @@ namespace Xamarin.Forms.Platform.Android
                        if (_defaultHint == null)
                                _defaultHint = textView.Hint;
 
-                       var elemValue = string.Join((String.IsNullOrWhiteSpace((string)(Element.GetValue(Accessibility.NameProperty))) || String.IsNullOrWhiteSpace((string)(Element.GetValue(Accessibility.HintProperty)))) ? "" : ". ", (string)Element.GetValue(Accessibility.NameProperty), (string)Element.GetValue(Accessibility.HintProperty));
+                       var elemValue = string.Join((String.IsNullOrWhiteSpace((string)(Element.GetValue(AutomationProperties.NameProperty))) || String.IsNullOrWhiteSpace((string)(Element.GetValue(AutomationProperties.HelpTextProperty)))) ? "" : ". ", (string)Element.GetValue(AutomationProperties.NameProperty), (string)Element.GetValue(AutomationProperties.HelpTextProperty));
 
                        if (!string.IsNullOrWhiteSpace(elemValue))
                                textView.Hint = elemValue;
@@ -305,7 +305,7 @@ namespace Xamarin.Forms.Platform.Android
                        if (Element == null || Control == null)
                                return;
 
-                       var elemValue = (VisualElement)Element.GetValue(Accessibility.LabeledByProperty);
+                       var elemValue = (VisualElement)Element.GetValue(AutomationProperties.LabeledByProperty);
 
                        if (elemValue != null)
                        {
index fc0d043..747956c 100644 (file)
@@ -316,11 +316,11 @@ namespace Xamarin.Forms.Platform.Android
                {
                        if (e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName)
                                UpdateBackgroundColor();
-                       else if (e.PropertyName == Accessibility.HintProperty.PropertyName)
+                       else if (e.PropertyName == AutomationProperties.HelpTextProperty.PropertyName)
                                SetContentDescription();
-                       else if (e.PropertyName == Accessibility.NameProperty.PropertyName)
+                       else if (e.PropertyName == AutomationProperties.NameProperty.PropertyName)
                                SetContentDescription();
-                       else if (e.PropertyName == Accessibility.IsInAccessibleTreeProperty.PropertyName)
+                       else if (e.PropertyName == AutomationProperties.IsInAccessibleTreeProperty.PropertyName)
                                SetFocusable();
                        else if (e.PropertyName == VisualElement.InputTransparentProperty.PropertyName)
                                UpdateInputTransparent();
@@ -366,7 +366,7 @@ namespace Xamarin.Forms.Platform.Android
                        if (_defaultContentDescription == null)
                                _defaultContentDescription = ContentDescription;
 
-                       var elemValue = string.Join(" ", (string)Element.GetValue(Accessibility.NameProperty), (string)Element.GetValue(Accessibility.HintProperty));
+                       var elemValue = string.Join(" ", (string)Element.GetValue(AutomationProperties.NameProperty), (string)Element.GetValue(AutomationProperties.HelpTextProperty));
 
                        if (!string.IsNullOrWhiteSpace(elemValue))
                                ContentDescription = elemValue;
@@ -382,7 +382,7 @@ namespace Xamarin.Forms.Platform.Android
                        if (!_defaultFocusable.HasValue)
                                _defaultFocusable = Focusable;
 
-                       Focusable = (bool)((bool?)Element.GetValue(Accessibility.IsInAccessibleTreeProperty) ?? _defaultFocusable);
+                       Focusable = (bool)((bool?)Element.GetValue(AutomationProperties.IsInAccessibleTreeProperty) ?? _defaultFocusable);
                }
 
                protected virtual bool SetHint()
@@ -401,7 +401,7 @@ namespace Xamarin.Forms.Platform.Android
                        if (_defaultHint == null)
                                _defaultHint = textView.Hint;
 
-                       var elemValue = string.Join((String.IsNullOrWhiteSpace((string)(Element.GetValue(Accessibility.NameProperty))) || String.IsNullOrWhiteSpace((string)(Element.GetValue(Accessibility.HintProperty)))) ? "" : ". ", (string)Element.GetValue(Accessibility.NameProperty), (string)Element.GetValue(Accessibility.HintProperty));
+                       var elemValue = string.Join((String.IsNullOrWhiteSpace((string)(Element.GetValue(AutomationProperties.NameProperty))) || String.IsNullOrWhiteSpace((string)(Element.GetValue(AutomationProperties.HelpTextProperty)))) ? "" : ". ", (string)Element.GetValue(AutomationProperties.NameProperty), (string)Element.GetValue(AutomationProperties.HelpTextProperty));
 
                        if (!string.IsNullOrWhiteSpace(elemValue))
                                textView.Hint = elemValue;
index 5100b87..5d43f6c 100644 (file)
     <Compile Include="AndroidTitleBarVisibility.cs" />
     <Compile Include="AppCompat\FrameRenderer.cs" />
     <Compile Include="Extensions\JavaObjectExtensions.cs" />
-    <Compile Include="FastRenderers\AccessibilityProvider.cs" />
+    <Compile Include="FastRenderers\AutomationPropertiesProvider.cs" />
     <Compile Include="FastRenderers\ButtonRenderer.cs" />
     <Compile Include="AppCompat\FormsViewPager.cs" />
     <Compile Include="AppCompat\FragmentContainer.cs" />
index 39435ae..5d358c8 100644 (file)
@@ -148,7 +148,7 @@ namespace Xamarin.Forms.Platform.UWP
                                UpdateIsPresented();
 
                                if (!string.IsNullOrEmpty(e.NewElement.AutomationId))
-                                       Control.SetValue(AutomationProperties.AutomationIdProperty, e.NewElement.AutomationId);
+                                       Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.AutomationIdProperty, e.NewElement.AutomationId);
 
                                ((ITitleProvider)this).BarBackgroundBrush = (Brush)Windows.UI.Xaml.Application.Current.Resources["SystemControlBackgroundChromeMediumLowBrush"];
                                UpdateToolbarPlacement();
index cc6f172..fb43ee2 100644 (file)
@@ -172,7 +172,7 @@ namespace Xamarin.Forms.Platform.UWP
                 element.PropertyChanged += OnElementPropertyChanged;
 
                 if (!string.IsNullOrEmpty(element.AutomationId))
-                    Control.SetValue(AutomationProperties.AutomationIdProperty, element.AutomationId);
+                                       Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.AutomationIdProperty, element.AutomationId);
             }
 
             OnElementChanged(new VisualElementChangedEventArgs(oldElement, element));
index aa260d5..3e121a0 100644 (file)
@@ -109,7 +109,7 @@ namespace Xamarin.Forms.Platform.WinRT
                                element.PropertyChanged += OnElementPropertyChanged;
 
                                if (!string.IsNullOrEmpty(element.AutomationId))
-                                       Control.SetValue(AutomationProperties.AutomationIdProperty, element.AutomationId);
+                                       Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.AutomationIdProperty, element.AutomationId);
                        }
 
                        OnElementChanged(new VisualElementChangedEventArgs(oldElement, element));
index 8f732d2..a3c5639 100644 (file)
@@ -117,7 +117,7 @@ namespace Xamarin.Forms.Platform.WinRT
                        OnElementChanged(new ElementChangedEventArgs<CarouselPage>(oldPage, newPage));
 
                        if (!string.IsNullOrEmpty(Element?.AutomationId))
-                               SetValue(AutomationProperties.AutomationIdProperty, Element.AutomationId);
+                               SetValue(Windows.UI.Xaml.Automation.AutomationProperties.AutomationIdProperty, Element.AutomationId);
                }
 
                protected virtual void Dispose(bool disposing)
index 7745f9d..7e4cedd 100644 (file)
@@ -194,7 +194,7 @@ namespace Xamarin.Forms.Platform.WinRT
                                Element.InternalChildren.CollectionChanged += OnChildrenChanged;
 
                                if (!string.IsNullOrEmpty(Element.AutomationId))
-                                       _container.SetValue(AutomationProperties.AutomationIdProperty, Element.AutomationId);
+                                       _container.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.AutomationIdProperty, Element.AutomationId);
 
                                PushExistingNavigationStack();
                        }
index 0017531..936e45c 100644 (file)
@@ -35,8 +35,8 @@ namespace Xamarin.Forms.Platform.WinRT
                        }
                        else
                        {
-                               SetValue(AutomationProperties.AutomationIdProperty, $"{id}_Container");
-                               Control.SetValue(AutomationProperties.AutomationIdProperty, id);
+                               SetValue(Windows.UI.Xaml.Automation.AutomationProperties.AutomationIdProperty, $"{id}_Container");
+                               Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.AutomationIdProperty, id);
                        }
                }
                protected override void SetAutomationPropertiesName()
@@ -51,14 +51,14 @@ namespace Xamarin.Forms.Platform.WinRT
                                return;
 
                        if (_defaultAutomationPropertiesName == null)
-                               _defaultAutomationPropertiesName = (string)Control.GetValue(AutomationProperties.NameProperty);
+                               _defaultAutomationPropertiesName = (string)Control.GetValue(Windows.UI.Xaml.Automation.AutomationProperties.NameProperty);
 
-                       var elemValue = (string)Element.GetValue(Accessibility.NameProperty);
+                       var elemValue = (string)Element.GetValue(AutomationProperties.NameProperty);
 
                        if (!string.IsNullOrWhiteSpace(elemValue))
-                               Control.SetValue(AutomationProperties.NameProperty, elemValue);
+                               Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.NameProperty, elemValue);
                        else
-                               Control.SetValue(AutomationProperties.NameProperty, _defaultAutomationPropertiesName);
+                               Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.NameProperty, _defaultAutomationPropertiesName);
                }
 
                protected override void SetAutomationPropertiesAccessibilityView()
@@ -73,17 +73,17 @@ namespace Xamarin.Forms.Platform.WinRT
                                return;
 
                        if (!_defaultAutomationPropertiesAccessibilityView.HasValue)
-                               _defaultAutomationPropertiesAccessibilityView = (AccessibilityView)Control.GetValue(AutomationProperties.AccessibilityViewProperty);
+                               _defaultAutomationPropertiesAccessibilityView = (AccessibilityView)Control.GetValue(Windows.UI.Xaml.Automation.AutomationProperties.AccessibilityViewProperty);
 
                        var newValue = _defaultAutomationPropertiesAccessibilityView;
-                       var elemValue = (bool?)Element.GetValue(Accessibility.IsInAccessibleTreeProperty);
+                       var elemValue = (bool?)Element.GetValue(AutomationProperties.IsInAccessibleTreeProperty);
 
                        if (elemValue == true)
                                newValue = AccessibilityView.Content;
                        else if (elemValue == false)
                                newValue = AccessibilityView.Raw;
 
-                       Control.SetValue(AutomationProperties.AccessibilityViewProperty, newValue);
+                       Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.AccessibilityViewProperty, newValue);
                }
 
                protected override void SetAutomationPropertiesHelpText()
@@ -98,14 +98,14 @@ namespace Xamarin.Forms.Platform.WinRT
                                return;
 
                        if (_defaultAutomationPropertiesHelpText == null)
-                               _defaultAutomationPropertiesHelpText = (string)Control.GetValue(AutomationProperties.HelpTextProperty);
+                               _defaultAutomationPropertiesHelpText = (string)Control.GetValue(Windows.UI.Xaml.Automation.AutomationProperties.HelpTextProperty);
 
-                       var elemValue = (string)Element.GetValue(Accessibility.HintProperty);
+                       var elemValue = (string)Element.GetValue(AutomationProperties.HelpTextProperty);
 
                        if (!string.IsNullOrWhiteSpace(elemValue))
-                               Control.SetValue(AutomationProperties.HelpTextProperty, elemValue);
+                               Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.HelpTextProperty, elemValue);
                        else
-                               Control.SetValue(AutomationProperties.HelpTextProperty, _defaultAutomationPropertiesHelpText);
+                               Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.HelpTextProperty, _defaultAutomationPropertiesHelpText);
                }
 
                protected override void SetAutomationPropertiesLabeledBy()
@@ -120,16 +120,16 @@ namespace Xamarin.Forms.Platform.WinRT
                                return;
 
                        if (_defaultAutomationPropertiesLabeledBy == null)
-                               _defaultAutomationPropertiesLabeledBy = (UIElement)Control.GetValue(AutomationProperties.LabeledByProperty);
+                               _defaultAutomationPropertiesLabeledBy = (UIElement)Control.GetValue(Windows.UI.Xaml.Automation.AutomationProperties.LabeledByProperty);
 
-                       var elemValue = (VisualElement)Element.GetValue(Accessibility.LabeledByProperty);
+                       var elemValue = (VisualElement)Element.GetValue(AutomationProperties.LabeledByProperty);
                        var renderer = elemValue?.GetOrCreateRenderer();
                        var nativeElement = renderer?.GetNativeElement();
 
                        if (nativeElement != null)
-                               Control.SetValue(AutomationProperties.LabeledByProperty, nativeElement);
+                               Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.LabeledByProperty, nativeElement);
                        else
-                               Control.SetValue(AutomationProperties.LabeledByProperty, _defaultAutomationPropertiesLabeledBy);
+                               Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.LabeledByProperty, _defaultAutomationPropertiesLabeledBy);
                }
        }
 }
\ No newline at end of file
index 778f464..8226688 100644 (file)
@@ -301,13 +301,13 @@ namespace Xamarin.Forms.Platform.WinRT
                                UpdateEnabled();
                        else if (e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName)
                                UpdateBackgroundColor();
-                       else if (e.PropertyName == Accessibility.HintProperty.PropertyName)
+                       else if (e.PropertyName == AutomationProperties.HelpTextProperty.PropertyName)
                                SetAutomationPropertiesHelpText();
-                       else if (e.PropertyName == Accessibility.NameProperty.PropertyName)
+                       else if (e.PropertyName == AutomationProperties.NameProperty.PropertyName)
                                SetAutomationPropertiesName();
-                       else if (e.PropertyName == Accessibility.IsInAccessibleTreeProperty.PropertyName)
+                       else if (e.PropertyName == AutomationProperties.IsInAccessibleTreeProperty.PropertyName)
                                SetAutomationPropertiesAccessibilityView();
-                       else if (e.PropertyName == Accessibility.LabeledByProperty.PropertyName)
+                       else if (e.PropertyName == AutomationProperties.LabeledByProperty.PropertyName)
                                SetAutomationPropertiesLabeledBy();
                }
 
@@ -319,7 +319,7 @@ namespace Xamarin.Forms.Platform.WinRT
 
                protected virtual void SetAutomationId(string id)
                {
-                       SetValue(AutomationProperties.AutomationIdProperty, id);
+                       SetValue(Windows.UI.Xaml.Automation.AutomationProperties.AutomationIdProperty, id);
                }
 
                protected virtual void SetAutomationPropertiesName()
@@ -328,14 +328,14 @@ namespace Xamarin.Forms.Platform.WinRT
                                return;
 
                        if (_defaultAutomationPropertiesName == null)
-                               _defaultAutomationPropertiesName = (string)Control.GetValue(AutomationProperties.NameProperty);
+                               _defaultAutomationPropertiesName = (string)Control.GetValue(Windows.UI.Xaml.Automation.AutomationProperties.NameProperty);
 
-                       var elemValue = (string)Element.GetValue(Accessibility.NameProperty);
+                       var elemValue = (string)Element.GetValue(AutomationProperties.NameProperty);
 
                        if (!string.IsNullOrWhiteSpace(elemValue))
-                               Control.SetValue(AutomationProperties.NameProperty, elemValue);
+                               Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.NameProperty, elemValue);
                        else
-                               Control.SetValue(AutomationProperties.NameProperty, _defaultAutomationPropertiesName);
+                               Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.NameProperty, _defaultAutomationPropertiesName);
                }
 
                protected virtual void SetAutomationPropertiesAccessibilityView()
@@ -344,17 +344,17 @@ namespace Xamarin.Forms.Platform.WinRT
                                return;
 
                        if (!_defaultAutomationPropertiesAccessibilityView.HasValue)
-                               _defaultAutomationPropertiesAccessibilityView = (AccessibilityView)Control.GetValue(AutomationProperties.AccessibilityViewProperty);
+                               _defaultAutomationPropertiesAccessibilityView = (AccessibilityView)Control.GetValue(Windows.UI.Xaml.Automation.AutomationProperties.AccessibilityViewProperty);
 
                        var newValue = _defaultAutomationPropertiesAccessibilityView;
-                       var elemValue = (bool?)Element.GetValue(Accessibility.IsInAccessibleTreeProperty);
+                       var elemValue = (bool?)Element.GetValue(AutomationProperties.IsInAccessibleTreeProperty);
 
                        if (elemValue == true)
                                newValue = AccessibilityView.Content;
                        else if (elemValue == false)
                                newValue = AccessibilityView.Raw;
 
-                       Control.SetValue(AutomationProperties.AccessibilityViewProperty, newValue);
+                       Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.AccessibilityViewProperty, newValue);
                }
 
                protected virtual void SetAutomationPropertiesHelpText()
@@ -363,14 +363,14 @@ namespace Xamarin.Forms.Platform.WinRT
                                return;
 
                        if (_defaultAutomationPropertiesHelpText == null)
-                               _defaultAutomationPropertiesHelpText = (string)Control.GetValue(AutomationProperties.HelpTextProperty);
+                               _defaultAutomationPropertiesHelpText = (string)Control.GetValue(Windows.UI.Xaml.Automation.AutomationProperties.HelpTextProperty);
 
-                       var elemValue = (string)Element.GetValue(Accessibility.HintProperty);
+                       var elemValue = (string)Element.GetValue(AutomationProperties.HelpTextProperty);
 
                        if (!string.IsNullOrWhiteSpace(elemValue))
-                               Control.SetValue(AutomationProperties.HelpTextProperty, elemValue);
+                               Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.HelpTextProperty, elemValue);
                        else
-                               Control.SetValue(AutomationProperties.HelpTextProperty, _defaultAutomationPropertiesHelpText);
+                               Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.HelpTextProperty, _defaultAutomationPropertiesHelpText);
                }
 
                protected virtual void SetAutomationPropertiesLabeledBy()
@@ -379,16 +379,16 @@ namespace Xamarin.Forms.Platform.WinRT
                                return;
 
                        if (_defaultAutomationPropertiesLabeledBy == null)
-                               _defaultAutomationPropertiesLabeledBy = (UIElement)Control.GetValue(AutomationProperties.LabeledByProperty);
+                               _defaultAutomationPropertiesLabeledBy = (UIElement)Control.GetValue(Windows.UI.Xaml.Automation.AutomationProperties.LabeledByProperty);
 
-                       var elemValue = (VisualElement)Element.GetValue(Accessibility.LabeledByProperty);
+                       var elemValue = (VisualElement)Element.GetValue(AutomationProperties.LabeledByProperty);
                        var renderer = elemValue?.GetOrCreateRenderer();
                        var nativeElement = renderer?.GetNativeElement();
 
                        if (nativeElement != null)
-                               Control.SetValue(AutomationProperties.LabeledByProperty, nativeElement);
+                               Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.LabeledByProperty, nativeElement);
                        else
-                               Control.SetValue(AutomationProperties.LabeledByProperty, _defaultAutomationPropertiesLabeledBy);
+                               Control.SetValue(Windows.UI.Xaml.Automation.AutomationProperties.LabeledByProperty, _defaultAutomationPropertiesLabeledBy);
                }
 
                protected void SetNativeControl(TNativeElement control)
index dd25e63..ed9291b 100644 (file)
@@ -102,7 +102,7 @@ namespace Xamarin.Forms.Platform.iOS
                        // will prevent us from inadvertently breaking UI Tests that are using Query.Marked to get the dynamic Title 
                        // of the Button.
 
-                       var elemValue = (string)Element?.GetValue(Accessibility.NameProperty);
+                       var elemValue = (string)Element?.GetValue(AutomationProperties.NameProperty);
                        if (string.IsNullOrWhiteSpace(elemValue) && Control?.AccessibilityLabel == Control?.Title(UIControlState.Normal))
                                return;
 
index 82ceda8..5eef691 100644 (file)
@@ -146,7 +146,7 @@ namespace Xamarin.Forms.Platform.MacOS
                        // will prevent us from inadvertently breaking UI Tests that are using Query.Marked to get the dynamic Text 
                        // of the Label.
 
-                       var elemValue = (string)Element?.GetValue(Accessibility.NameProperty);
+                       var elemValue = (string)Element?.GetValue(AutomationProperties.NameProperty);
                        if (string.IsNullOrWhiteSpace(elemValue) && Control?.AccessibilityLabel == Control?.Text)
                                return;
 
index a785fb0..13b11e6 100644 (file)
@@ -131,7 +131,7 @@ namespace Xamarin.Forms.Platform.MacOS
                        if (_defaultAccessibilityHint == null)
                                _defaultAccessibilityHint = Control.AccessibilityHint;
 
-                       Control.AccessibilityHint = (string)Element.GetValue(Accessibility.HintProperty) ?? _defaultAccessibilityHint;
+                       Control.AccessibilityHint = (string)Element.GetValue(AutomationProperties.HelpTextProperty) ?? _defaultAccessibilityHint;
 
                }
 
@@ -149,7 +149,7 @@ namespace Xamarin.Forms.Platform.MacOS
                        if (_defaultAccessibilityLabel == null)
                                _defaultAccessibilityLabel = Control.AccessibilityLabel;
 
-                       Control.AccessibilityLabel = (string)Element.GetValue(Accessibility.NameProperty) ?? _defaultAccessibilityLabel;
+                       Control.AccessibilityLabel = (string)Element.GetValue(AutomationProperties.NameProperty) ?? _defaultAccessibilityLabel;
                }
 
                protected override void SetIsAccessibilityElement()
@@ -166,7 +166,7 @@ namespace Xamarin.Forms.Platform.MacOS
                        if (!_defaultIsAccessibilityElement.HasValue)
                                _defaultIsAccessibilityElement = Control.IsAccessibilityElement;
 
-                       Control.IsAccessibilityElement = (bool)((bool?)Element.GetValue(Accessibility.IsInAccessibleTreeProperty) ?? _defaultIsAccessibilityElement);
+                       Control.IsAccessibilityElement = (bool)((bool?)Element.GetValue(AutomationProperties.IsInAccessibleTreeProperty) ?? _defaultIsAccessibilityElement);
                }
 #endif
                protected override void SetAutomationId(string id)
index d63385d..ee16328 100644 (file)
@@ -284,11 +284,11 @@ namespace Xamarin.Forms.Platform.MacOS
 #if __MOBILE__
                        else if (e.PropertyName == PlatformConfiguration.iOSSpecific.VisualElement.BlurEffectProperty.PropertyName)
                                SetBlur((BlurEffectStyle)Element.GetValue(PlatformConfiguration.iOSSpecific.VisualElement.BlurEffectProperty));
-                       else if (e.PropertyName == Accessibility.HintProperty.PropertyName)
+                       else if (e.PropertyName == AutomationProperties.HelpTextProperty.PropertyName)
                                SetAccessibilityHint();
-                       else if (e.PropertyName == Accessibility.NameProperty.PropertyName)
+                       else if (e.PropertyName == AutomationProperties.NameProperty.PropertyName)
                                SetAccessibilityLabel();
-                       else if (e.PropertyName == Accessibility.IsInAccessibleTreeProperty.PropertyName)
+                       else if (e.PropertyName == AutomationProperties.IsInAccessibleTreeProperty.PropertyName)
                                SetIsAccessibilityElement();
 #endif
                }
@@ -307,7 +307,7 @@ namespace Xamarin.Forms.Platform.MacOS
                        if (_defaultAccessibilityHint == null)
                                _defaultAccessibilityHint = AccessibilityHint;
 
-                       AccessibilityHint = (string)Element.GetValue(Accessibility.HintProperty) ?? _defaultAccessibilityHint;
+                       AccessibilityHint = (string)Element.GetValue(AutomationProperties.HelpTextProperty) ?? _defaultAccessibilityHint;
                }
 
                protected virtual void SetAccessibilityLabel()
@@ -318,7 +318,7 @@ namespace Xamarin.Forms.Platform.MacOS
                        if (_defaultAccessibilityLabel == null)
                                _defaultAccessibilityLabel = AccessibilityLabel;
 
-                       AccessibilityLabel = (string)Element.GetValue(Accessibility.NameProperty) ?? _defaultAccessibilityLabel;
+                       AccessibilityLabel = (string)Element.GetValue(AutomationProperties.NameProperty) ?? _defaultAccessibilityLabel;
                }
 
                protected virtual void SetIsAccessibilityElement()
@@ -329,7 +329,7 @@ namespace Xamarin.Forms.Platform.MacOS
                        if (!_defaultIsAccessibilityElement.HasValue)
                                _defaultIsAccessibilityElement = IsAccessibilityElement;
 
-                       IsAccessibilityElement = (bool)((bool?)Element.GetValue(Accessibility.IsInAccessibleTreeProperty) ?? _defaultIsAccessibilityElement);
+                       IsAccessibilityElement = (bool)((bool?)Element.GetValue(AutomationProperties.IsInAccessibleTreeProperty) ?? _defaultIsAccessibilityElement);
                }
 #endif
                protected virtual void SetAutomationId(string id)
diff --git a/Xamarin.Forms.Xaml.UnitTests/Accessibility.xaml b/Xamarin.Forms.Xaml.UnitTests/Accessibility.xaml
deleted file mode 100644 (file)
index 6c4b32b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
-             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
-             x:Class="Xamarin.Forms.Xaml.UnitTests.Accessibility">
-
-       <StackLayout>
-               <Label x:Name="label" Text="Your Name" />
-               <Entry x:Name="entry"
-                       Accessibility.Name="Name"
-                       Accessibility.Hint="Sets your name"
-                       Accessibility.IsInAccessibleTree="true"
-                       Accessibility.LabeledBy="{x:Reference label}"
-                />
-       </StackLayout>
-
-</ContentPage>
\ No newline at end of file
diff --git a/Xamarin.Forms.Xaml.UnitTests/AutomationProperties.xaml b/Xamarin.Forms.Xaml.UnitTests/AutomationProperties.xaml
new file mode 100644 (file)
index 0000000..6e035f0
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
+             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+             x:Class="Xamarin.Forms.Xaml.UnitTests.AutomationProperties">
+
+       <StackLayout>
+               <Label x:Name="label" Text="Your Name" />
+               <Entry x:Name="entry"
+                       AutomationProperties.Name="Name"
+                       AutomationProperties.HelpText="Sets your name"
+                       AutomationProperties.IsInAccessibleTree="true"
+                       AutomationProperties.LabeledBy="{x:Reference label}"
+                />
+       </StackLayout>
+
+</ContentPage>
\ No newline at end of file
@@ -4,14 +4,14 @@ using Xamarin.Forms.Core.UnitTests;
 
 namespace Xamarin.Forms.Xaml.UnitTests
 {
-       public partial class Accessibility : ContentPage
+       public partial class AutomationProperties : ContentPage
        {
-               public Accessibility()
+               public AutomationProperties()
                {
                        InitializeComponent();
                }
 
-               public Accessibility(bool useCompiledXaml)
+               public AutomationProperties(bool useCompiledXaml)
                {
                        //this stub will be replaced at compile time
                }
@@ -35,40 +35,40 @@ namespace Xamarin.Forms.Xaml.UnitTests
 
                        [TestCase(false)]
                        [TestCase(true)]
-                       public void AccessibilityName(bool useCompiledXaml)
+                       public void AutomationPropertiesName(bool useCompiledXaml)
                        {
-                               var layout = new Accessibility(useCompiledXaml);
+                               var layout = new AutomationProperties(useCompiledXaml);
 
-                               Assert.AreEqual("Name", (string)layout.entry.GetValue(Xamarin.Forms.Accessibility.NameProperty));
+                               Assert.AreEqual("Name", (string)layout.entry.GetValue(Xamarin.Forms.AutomationProperties.NameProperty));
                        }
 
                        [TestCase(false)]
                        [TestCase(true)]
-                       public void AccessibilityHint(bool useCompiledXaml)
+                       public void AutomationPropertiesHelpText(bool useCompiledXaml)
                        {
-                               var layout = new Accessibility(useCompiledXaml);
+                               var layout = new AutomationProperties(useCompiledXaml);
 
-                               Assert.AreEqual("Sets your name", (string)layout.entry.GetValue(Xamarin.Forms.Accessibility.HintProperty));
+                               Assert.AreEqual("Sets your name", (string)layout.entry.GetValue(Xamarin.Forms.AutomationProperties.HelpTextProperty));
                        }
 
                        [TestCase(false)]
                        [TestCase(true)]
-                       public void AccessibilityIsInAccessibleTree(bool useCompiledXaml)
+                       public void AutomationPropertiesIsInAccessibleTree(bool useCompiledXaml)
                        {
-                               var layout = new Accessibility(useCompiledXaml);
+                               var layout = new AutomationProperties(useCompiledXaml);
                                Application.Current.MainPage = layout;
 
-                               Assert.AreEqual(true, (bool)layout.entry.GetValue(Xamarin.Forms.Accessibility.IsInAccessibleTreeProperty));
+                               Assert.AreEqual(true, (bool)layout.entry.GetValue(Xamarin.Forms.AutomationProperties.IsInAccessibleTreeProperty));
                        }
 
                        [TestCase(false)]
                        [TestCase(true)]
-                       public void AccessibilityLabeledBy(bool useCompiledXaml)
+                       public void AutomationPropertiesLabeledBy(bool useCompiledXaml)
                        {
-                               var layout = new Accessibility(useCompiledXaml);
+                               var layout = new AutomationProperties(useCompiledXaml);
                                Application.Current.MainPage = layout;
 
-                               Assert.AreEqual(layout.label, (Element)layout.entry.GetValue(Xamarin.Forms.Accessibility.LabeledByProperty));
+                               Assert.AreEqual(layout.label, (Element)layout.entry.GetValue(Xamarin.Forms.AutomationProperties.LabeledByProperty));
                        }
                }
        }
index 2fc6b08..ffad2db 100644 (file)
@@ -76,8 +76,8 @@
     <Compile Include="..\Xamarin.Forms.Core.UnitTests\MockPlatformServices.cs">
       <Link>MockPlatformServices.cs</Link>
     </Compile>
-    <Compile Include="Accessibility.xaml.cs">
-      <DependentUpon>Accessibility.xaml</DependentUpon>
+    <Compile Include="AutomationProperties.xaml.cs">
+      <DependentUpon>AutomationProperties.xaml</DependentUpon>
     </Compile>
     <Compile Include="FontConverterTests.cs" />
     <Compile Include="Issues\Bz43450.xaml.cs">
     </EmbeddedResource>
   </ItemGroup>
   <ItemGroup>
-    <EmbeddedResource Include="Accessibility.xaml">
+    <EmbeddedResource Include="AutomationProperties.xaml">
       <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
     </EmbeddedResource>
   </ItemGroup>
@@ -1,6 +1,6 @@
-<Type Name="Accessibility" FullName="Xamarin.Forms.Accessibility">
-  <TypeSignature Language="C#" Value="public class Accessibility" />
-  <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Accessibility extends System.Object" />
+<Type Name="AutomationProperties" FullName="Xamarin.Forms.AutomationProperties">
+  <TypeSignature Language="C#" Value="public class AutomationProperties" />
+  <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit AutomationProperties extends System.Object" />
   <AssemblyInfo>
     <AssemblyName>Xamarin.Forms.Core</AssemblyName>
     <AssemblyVersion>2.0.0.0</AssemblyVersion>
@@ -15,7 +15,7 @@
   </Docs>
   <Members>
     <Member MemberName=".ctor">
-      <MemberSignature Language="C#" Value="public Accessibility ();" />
+      <MemberSignature Language="C#" Value="public AutomationProperties ();" />
       <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
       <MemberType>Constructor</MemberType>
       <AssemblyInfo>
       </AssemblyInfo>
       <Parameters />
       <Docs>
-        <summary>Creates a new <see cref="T:Xamarin.Forms.Accessibility" /> object with default values.</summary>
+        <summary>Creates a new <see cref="T:Xamarin.Forms.AutomationProperties" /> object with default values.</summary>
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName="GetHint">
-      <MemberSignature Language="C#" Value="public static string GetHint (Xamarin.Forms.BindableObject bindable);" />
-      <MemberSignature Language="ILAsm" Value=".method public static hidebysig string GetHint(class Xamarin.Forms.BindableObject bindable) cil managed" />
+    <Member MemberName="GetHelpText">
+      <MemberSignature Language="C#" Value="public static string GetHelpText (Xamarin.Forms.BindableObject bindable);" />
+      <MemberSignature Language="ILAsm" Value=".method public static hidebysig string GetHelpText(class Xamarin.Forms.BindableObject bindable) cil managed" />
       <MemberType>Method</MemberType>
       <AssemblyInfo>
         <AssemblyVersion>2.0.0.0</AssemblyVersion>
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName="HintProperty">
-      <MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty HintProperty;" />
-      <MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty HintProperty" />
+    <Member MemberName="HelpTextProperty">
+      <MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty HelpTextProperty;" />
+      <MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty HelpTextProperty" />
       <MemberType>Field</MemberType>
       <AssemblyInfo>
         <AssemblyVersion>2.0.0.0</AssemblyVersion>
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName="SetHint">
-      <MemberSignature Language="C#" Value="public static void SetHint (Xamarin.Forms.BindableObject bindable, string value);" />
-      <MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetHint(class Xamarin.Forms.BindableObject bindable, string value) cil managed" />
+    <Member MemberName="SetHelpText">
+      <MemberSignature Language="C#" Value="public static void SetHelpText (Xamarin.Forms.BindableObject bindable, string value);" />
+      <MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetHelpText(class Xamarin.Forms.BindableObject bindable, string value) cil managed" />
       <MemberType>Method</MemberType>
       <AssemblyInfo>
         <AssemblyVersion>2.0.0.0</AssemblyVersion>
index 4531ee1..591d24a 100644 (file)
       <Type Name="AbsoluteLayout" Kind="Class" />
       <Type Name="AbsoluteLayout+IAbsoluteList`1" DisplayName="AbsoluteLayout+IAbsoluteList&lt;T&gt;" Kind="Interface" />
       <Type Name="AbsoluteLayoutFlags" Kind="Enumeration" />
-      <Type Name="Accessibility" Kind="Class" />
       <Type Name="ActivityIndicator" Kind="Class" />
       <Type Name="Animation" Kind="Class" />
       <Type Name="AnimationExtensions" Kind="Class" />
       <Type Name="Application" Kind="Class" />
       <Type Name="AppLinkEntry" Kind="Class" />
       <Type Name="Aspect" Kind="Enumeration" />
+      <Type Name="AutomationProperties" Kind="Class" />
       <Type Name="BackButtonPressedEventArgs" Kind="Class" />
       <Type Name="BaseMenuItem" Kind="Class" />
       <Type Name="Behavior" Kind="Class" />