summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla45067.cs4
-rw-r--r--Xamarin.Forms.Controls/ControlGalleryPages/AutomationPropertiesGallery.cs (renamed from Xamarin.Forms.Controls/ControlGalleryPages/AccessibilityGallery.cs)86
-rw-r--r--Xamarin.Forms.Controls/CoreGallery.cs6
-rw-r--r--Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj2
-rw-r--r--Xamarin.Forms.Core/AutomationProperties.cs (renamed from Xamarin.Forms.Core/Accessibility.cs)12
-rw-r--r--Xamarin.Forms.Core/Xamarin.Forms.Core.csproj2
-rw-r--r--Xamarin.Forms.Platform.Android/FastRenderers/AutomationPropertiesProvider.cs (renamed from Xamarin.Forms.Platform.Android/FastRenderers/AccessibilityProvider.cs)24
-rw-r--r--Xamarin.Forms.Platform.Android/FastRenderers/ButtonRenderer.cs6
-rw-r--r--Xamarin.Forms.Platform.Android/FastRenderers/VisualElementRenderer.cs6
-rw-r--r--Xamarin.Forms.Platform.Android/ViewRenderer.cs10
-rw-r--r--Xamarin.Forms.Platform.Android/VisualElementRenderer.cs12
-rw-r--r--Xamarin.Forms.Platform.Android/Xamarin.Forms.Platform.Android.csproj2
-rw-r--r--Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.WinRT.Phone/TabbedPageRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.WinRT/CarouselPageRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.WinRT/ViewRenderer.cs34
-rw-r--r--Xamarin.Forms.Platform.WinRT/VisualElementRenderer.cs40
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/ButtonRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.iOS/ViewRenderer.cs6
-rw-r--r--Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs12
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Accessibility.xaml16
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/AutomationProperties.xaml16
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/AutomationProperties.xaml.cs (renamed from Xamarin.Forms.Xaml.UnitTests/Accessibility.xaml.cs)30
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj6
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/AutomationProperties.xml (renamed from docs/Xamarin.Forms.Core/Xamarin.Forms/Accessibility.xml)28
-rw-r--r--docs/Xamarin.Forms.Core/index.xml2
29 files changed, 188 insertions, 188 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla45067.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla45067.cs
index c4292fb4..b0a7dd2f 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla45067.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla45067.cs
@@ -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 };
diff --git a/Xamarin.Forms.Controls/ControlGalleryPages/AccessibilityGallery.cs b/Xamarin.Forms.Controls/ControlGalleryPages/AutomationPropertiesGallery.cs
index f5f0b39c..d4c85d8c 100644
--- a/Xamarin.Forms.Controls/ControlGalleryPages/AccessibilityGallery.cs
+++ b/Xamarin.Forms.Controls/ControlGalleryPages/AutomationPropertiesGallery.cs
@@ -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);
}
}
}
diff --git a/Xamarin.Forms.Controls/CoreGallery.cs b/Xamarin.Forms.Controls/CoreGallery.cs
index 924d4129..26e9a590 100644
--- a/Xamarin.Forms.Controls/CoreGallery.cs
+++ b/Xamarin.Forms.Controls/CoreGallery.cs
@@ -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;
diff --git a/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj b/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj
index 717f31e0..58997640 100644
--- a/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj
+++ b/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj
@@ -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>
diff --git a/Xamarin.Forms.Core/Accessibility.cs b/Xamarin.Forms.Core/AutomationProperties.cs
index 074d5c59..701ae93c 100644
--- a/Xamarin.Forms.Core/Accessibility.cs
+++ b/Xamarin.Forms.Core/AutomationProperties.cs
@@ -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)
diff --git a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
index 385ab4c7..f18b0184 100644
--- a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
+++ b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
@@ -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" />
diff --git a/Xamarin.Forms.Platform.Android/FastRenderers/AccessibilityProvider.cs b/Xamarin.Forms.Platform.Android/FastRenderers/AutomationPropertiesProvider.cs
index 29327dcd..6d34c6b5 100644
--- a/Xamarin.Forms.Platform.Android/FastRenderers/AccessibilityProvider.cs
+++ b/Xamarin.Forms.Platform.Android/FastRenderers/AutomationPropertiesProvider.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();
}
diff --git a/Xamarin.Forms.Platform.Android/FastRenderers/ButtonRenderer.cs b/Xamarin.Forms.Platform.Android/FastRenderers/ButtonRenderer.cs
index 05e0471b..9632f2bb 100644
--- a/Xamarin.Forms.Platform.Android/FastRenderers/ButtonRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/FastRenderers/ButtonRenderer.cs
@@ -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)
diff --git a/Xamarin.Forms.Platform.Android/FastRenderers/VisualElementRenderer.cs b/Xamarin.Forms.Platform.Android/FastRenderers/VisualElementRenderer.cs
index 34ea7e34..0112481d 100644
--- a/Xamarin.Forms.Platform.Android/FastRenderers/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/FastRenderers/VisualElementRenderer.cs
@@ -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)
{
diff --git a/Xamarin.Forms.Platform.Android/ViewRenderer.cs b/Xamarin.Forms.Platform.Android/ViewRenderer.cs
index 842fc5c2..1cf77594 100644
--- a/Xamarin.Forms.Platform.Android/ViewRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/ViewRenderer.cs
@@ -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)
{
diff --git a/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs b/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs
index fc0d0436..747956c3 100644
--- a/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs
@@ -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;
diff --git a/Xamarin.Forms.Platform.Android/Xamarin.Forms.Platform.Android.csproj b/Xamarin.Forms.Platform.Android/Xamarin.Forms.Platform.Android.csproj
index 5100b873..5d43f6c1 100644
--- a/Xamarin.Forms.Platform.Android/Xamarin.Forms.Platform.Android.csproj
+++ b/Xamarin.Forms.Platform.Android/Xamarin.Forms.Platform.Android.csproj
@@ -104,7 +104,7 @@
<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" />
diff --git a/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs b/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs
index 39435ae4..5d358c8d 100644
--- a/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs
+++ b/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs
@@ -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();
diff --git a/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs b/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs
index cc6f172e..fb43ee25 100644
--- a/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs
+++ b/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs
@@ -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));
diff --git a/Xamarin.Forms.Platform.WinRT.Phone/TabbedPageRenderer.cs b/Xamarin.Forms.Platform.WinRT.Phone/TabbedPageRenderer.cs
index aa260d50..3e121a03 100644
--- a/Xamarin.Forms.Platform.WinRT.Phone/TabbedPageRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT.Phone/TabbedPageRenderer.cs
@@ -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));
diff --git a/Xamarin.Forms.Platform.WinRT/CarouselPageRenderer.cs b/Xamarin.Forms.Platform.WinRT/CarouselPageRenderer.cs
index 8f732d2f..a3c5639f 100644
--- a/Xamarin.Forms.Platform.WinRT/CarouselPageRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/CarouselPageRenderer.cs
@@ -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)
diff --git a/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs
index 7745f9dc..7e4ceddb 100644
--- a/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs
@@ -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();
}
diff --git a/Xamarin.Forms.Platform.WinRT/ViewRenderer.cs b/Xamarin.Forms.Platform.WinRT/ViewRenderer.cs
index 0017531f..936e45c5 100644
--- a/Xamarin.Forms.Platform.WinRT/ViewRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/ViewRenderer.cs
@@ -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
diff --git a/Xamarin.Forms.Platform.WinRT/VisualElementRenderer.cs b/Xamarin.Forms.Platform.WinRT/VisualElementRenderer.cs
index 778f464e..82266883 100644
--- a/Xamarin.Forms.Platform.WinRT/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/VisualElementRenderer.cs
@@ -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)
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/ButtonRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/ButtonRenderer.cs
index dd25e635..ed9291bc 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/ButtonRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/ButtonRenderer.cs
@@ -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;
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs
index 82ceda81..5eef6915 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs
@@ -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;
diff --git a/Xamarin.Forms.Platform.iOS/ViewRenderer.cs b/Xamarin.Forms.Platform.iOS/ViewRenderer.cs
index a785fb0f..13b11e6d 100644
--- a/Xamarin.Forms.Platform.iOS/ViewRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/ViewRenderer.cs
@@ -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)
diff --git a/Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs b/Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs
index d63385d3..ee16328b 100644
--- a/Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs
@@ -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
index 6c4b32b6..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Accessibility.xaml
+++ /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
index 00000000..6e035f0a
--- /dev/null
+++ b/Xamarin.Forms.Xaml.UnitTests/AutomationProperties.xaml
@@ -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
diff --git a/Xamarin.Forms.Xaml.UnitTests/Accessibility.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/AutomationProperties.xaml.cs
index 2bcaab3b..2f71b519 100644
--- a/Xamarin.Forms.Xaml.UnitTests/Accessibility.xaml.cs
+++ b/Xamarin.Forms.Xaml.UnitTests/AutomationProperties.xaml.cs
@@ -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));
}
}
}
diff --git a/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj b/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj
index 2fc6b083..ffad2db3 100644
--- a/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj
+++ b/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj
@@ -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">
@@ -918,7 +918,7 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
- <EmbeddedResource Include="Accessibility.xaml">
+ <EmbeddedResource Include="AutomationProperties.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/Accessibility.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/AutomationProperties.xml
index ee401995..d71a230a 100644
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/Accessibility.xml
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/AutomationProperties.xml
@@ -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>
@@ -23,13 +23,13 @@
</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>
@@ -107,9 +107,9 @@
<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>
@@ -167,9 +167,9 @@
<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>
diff --git a/docs/Xamarin.Forms.Core/index.xml b/docs/Xamarin.Forms.Core/index.xml
index 4531ee11..591d24a9 100644
--- a/docs/Xamarin.Forms.Core/index.xml
+++ b/docs/Xamarin.Forms.Core/index.xml
@@ -135,13 +135,13 @@
<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" />