Skip to content
Prev Previous commit
Next Next commit
Update listener handling
  • Loading branch information
marcelwgn committed Oct 28, 2020
commit 5716df913b0707f660bfbef82cac6bd0387c2093
5 changes: 3 additions & 2 deletions Microsoft.Toolkit.Uwp.UI.Controls/RadialGauge/RadialGauge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,10 @@ protected override void OnValueChanged(double oldValue, double newValue)
{
OnValueChanged(this);
base.OnValueChanged(oldValue, newValue);
if (FrameworkElementAutomationPeer.CreatePeerForElement(this) is RadialGaugeAutomationPeer peer)
if (AutomationPeer.ListenerExists(AutomationEvents.LiveRegionChanged))
{
peer.RaiseValueChangedEvent(oldValue, newValue);
var peer = FrameworkElementAutomationPeer.FromElement(this) as RadialGaugeAutomationPeer;
peer?.RaiseValueChangedEvent(oldValue, newValue);
}
}

Expand Down