protected override void Update(FrameworkElement view, SemanticEffectRouter effect) { var headingLevel = (AutomationHeadingLevel)((int)SemanticEffect.GetHeadingLevel(Element)); AutomationProperties.SetHeadingLevel(view, headingLevel); AutomationProperties.SetName(view, SemanticEffect.GetDescription(Element) ?? string.Empty); AutomationProperties.SetHelpText(view, SemanticEffect.GetHint(Element) ?? string.Empty); }
NavigationViewItemHeader CreateNavViewHeaderFromGroup(NavCategoryGroup group) { var header = new NavigationViewItemHeader(); header.DataContext = group; header.Content = group.Name; AutomationProperties.SetName(header, group.AutomationName); AutomationProperties.SetHeadingLevel(header, Windows.UI.Xaml.Automation.Peers.AutomationHeadingLevel.Level1); return(header); }
public static void UpdateSemantics(this FrameworkElement platformView, IView view) { var semantics = view.Semantics; if (semantics == null) { return; } AutomationProperties.SetName(platformView, semantics.Description); AutomationProperties.SetHelpText(platformView, semantics.Hint); AutomationProperties.SetHeadingLevel(platformView, (UI.Xaml.Automation.Peers.AutomationHeadingLevel)((int)semantics.HeadingLevel)); }