Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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));
        }