Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -984,8 +984,10 @@ internal static void SetFlyoutLeftBarButton(UIViewController containerController
if (FlyoutPage != null && !string.IsNullOrEmpty(FlyoutPage.AutomationId))
SetAutomationId(containerController.NavigationItem.LeftBarButtonItem, $"btn_{FlyoutPage.AutomationId}");

#pragma warning disable CS0618 // Type or member is obsolete
containerController.NavigationItem.LeftBarButtonItem.SetAccessibilityHint(FlyoutPage);
containerController.NavigationItem.LeftBarButtonItem.SetAccessibilityLabel(FlyoutPage);
#pragma warning restore CS0618 // Type or member is obsolete
});

void OnItemTapped(object sender, EventArgs e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,10 @@ void UpdateLeftToolbarItems()

if (image != null)
{
#pragma warning disable CS0618 // Type or member is obsolete
NavigationItem.LeftBarButtonItem.SetAccessibilityHint(image);
NavigationItem.LeftBarButtonItem.SetAccessibilityLabel(image);
#pragma warning restore CS0618 // Type or member is obsolete
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ public static void SetAccessibilityProperties(this NativeView nativeViewElement,
return;

nativeViewElement.AccessibilityIdentifier = element?.AutomationId;
#pragma warning disable CS0618 // Type or member is obsolete
SetAccessibilityLabel(nativeViewElement, element);
SetAccessibilityHint(nativeViewElement, element);
#pragma warning restore CS0618 // Type or member is obsolete
SetIsAccessibilityElement(nativeViewElement, element);
SetAccessibilityElementsHidden(nativeViewElement, element);
}

// TODO OBSOLETE FOR NET10
[Obsolete("Use Microsoft.Maui.Platform.UpdateSemantics")]
public static string SetAccessibilityHint(this NativeView Control, Element Element, string _defaultAccessibilityHint = null)
{
if (Element == null || Control == null)
Expand All @@ -43,7 +45,7 @@ public static string SetAccessibilityHint(this NativeView Control, Element Eleme
return _defaultAccessibilityHint;
}

// TODO OBSOLETE FOR NET10
[Obsolete("Use Microsoft.Maui.Platform.UpdateSemantics")]
public static string SetAccessibilityLabel(this NativeView Control, Element Element, string _defaultAccessibilityLabel = null)
{
if (Element == null || Control == null)
Expand All @@ -66,7 +68,7 @@ public static string SetAccessibilityLabel(this NativeView Control, Element Elem
return _defaultAccessibilityLabel;
}

// TODO OBSOLETE FOR NET10
[Obsolete("Use Microsoft.Maui.Platform.UpdateSemantics")]
public static string SetAccessibilityHint(this UIBarItem Control, Element Element, string _defaultAccessibilityHint = null)
{
if (Element == null || Control == null)
Expand All @@ -90,7 +92,7 @@ public static string SetAccessibilityHint(this UIBarItem Control, Element Elemen

}

// TODO OBSOLETE FOR NET10
[Obsolete("Use Microsoft.Maui.Platform.UpdateSemantics")]
public static string SetAccessibilityLabel(this UIBarItem Control, Element Element, string _defaultAccessibilityLabel = null)
{
if (Element == null || Control == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ public PrimaryToolbarItem(ToolbarItem item, bool forceName)
if (item != null && !string.IsNullOrEmpty(item.AutomationId))
AccessibilityIdentifier = item.AutomationId;

#pragma warning disable CS0618 // Type or member is obsolete
this.SetAccessibilityHint(item);
this.SetAccessibilityLabel(item);
#pragma warning restore CS0618 // Type or member is obsolete
}

void OnClicked(object sender, EventArgs e)
Expand Down Expand Up @@ -154,8 +156,10 @@ public SecondaryToolbarItem(ToolbarItem item) : base(new SecondaryToolbarItemCon
if (item != null && !string.IsNullOrEmpty(item.AutomationId))
AccessibilityIdentifier = item.AutomationId;

#pragma warning disable CS0618 // Type or member is obsolete
this.SetAccessibilityHint(item);
this.SetAccessibilityLabel(item);
#pragma warning restore CS0618 // Type or member is obsolete
}

void OnClicked(object sender, EventArgs e)
Expand Down Expand Up @@ -188,8 +192,8 @@ void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
else if (e.PropertyName == AutomationProperties.HelpTextProperty.PropertyName)
this.SetAccessibilityHint(item);
else if (e.PropertyName == AutomationProperties.NameProperty.PropertyName)
#pragma warning restore CS0618 // Type or member is obsolete
this.SetAccessibilityLabel(item);
#pragma warning restore CS0618 // Type or member is obsolete
}

void UpdateIcon(ToolbarItem item)
Expand Down