Example #1
0
        public static void NotifyScreenReaderAutomationIfKeyboardFocused(AutomationPeer automationPeer, UIElement uiElement)
        {
            if (uiElement.IsKeyboardFocused)
            {
                var str = uiElement.GetValue(AutomationProperties.NameProperty) as String;
#if DEBUG
                Console.WriteLine("AUTOMATION NAME ==> " + str);

                var str2 = AutomationProperties.GetName(uiElement);
                DebugFix.Assert(str2 == str);

                if (automationPeer != null)
                {
                    string str3 = automationPeer.GetName();
                    DebugFix.Assert(str3 == str);
                }
#endif //DEBUG
                TextBlockWithAutomationPeer.NotifyScreenReaderAutomation(automationPeer, str);
            }
        }