private void RaiseLiveRegionChangedAutomationEvent(bool isDateDiffMode) { TextBlock resultTextBlock = isDateDiffMode ? DateDiffAllUnitsResultLabel : DateResultLabel; string automationName = AutomationProperties.GetName(resultTextBlock); TextBlockAutomationPeer.FromElement(resultTextBlock).RaiseAutomationEvent(AutomationEvents.LiveRegionChanged); }
private void TryReadAutomationProperties(StackPanel stackPanel) { var textblocks = stackPanel?.Children.OfType <TextBlock>(); if (textblocks != null) { AutomationPeer peer = null; foreach (TextBlock textBlock in textblocks) { peer = TextBlockAutomationPeer.FromElement(textBlock); peer?.RaiseAutomationEvent(AutomationEvents.MenuOpened); } } }