Page 1 of 1

NotifyPropertyChanged() triggering actions 2x

Posted: 25 Sep 2020, 22:47
by samc
I'm using NotifyPropertyChanged in my code to notify Noesis when a property has changed. I also have a data trigger setup like this:
<ei:DataTrigger Binding="{Binding ActiveState}" Comparison="Equal" Value="2">
	<ei:PlaySoundAction Source="play_ui_generic_click_01.wav"/>
</ei:DataTrigger>
For some reason, the PlaySoundAction is called twice from the NotifyPropertyChanged() method; I'm not sure why. Can anyone explain this?
GUI.PlayAudio() at \NoesisGUI\Plugins\API\Core\NoesisGUI.cs:line 217
PlaySoundAction.Invoke() at \NoesisGUI\Plugins\API\Interactivity\PlaySoundAction.cs:line 53
TriggerAction.CallInvoke() at \NoesisGUI\Plugins\API\Interactivity\TriggerAction.cs:line 44
TriggerBase.InvokeActions() at \NoesisGUI\Plugins\API\Interactivity\TriggerBase.cs:line 82
DataTrigger.Evaluate() at \NoesisGUI\Plugins\API\Interactivity\DataTrigger.cs:line 88
DataTrigger.EvaluateBindingChange() at \NoesisGUI\Plugins\API\Interactivity\DataTrigger.cs:line 73
PropertyChangedTrigger.OnBindingChanged() at \NoesisGUI\Plugins\API\Interactivity\PropertyChangedTrigger.cs:line 38
PropertyMetadata.OnPropertyChanged() at \NoesisGUI\Plugins\API\Proxies\PropertyMetadataExtend.cs:line 129
[Native Transition]
Extend.NotifyPropertyChanged() at \NoesisGUI\Plugins\API\Core\Extend.cs:line 4494
NotifyPropertyChangedBase.NotifyPropertyChanged() at \Scripts\Runtime\Client\UI\Utilities\NotifyPropertyChangedBase.cs:line 76
The callback happens 2x from the "native transition" from what i can tell..

thanks,
sam

Re: NotifyPropertyChanged() triggering actions 2x

Posted: 28 Sep 2020, 10:17
by sfernandez
I created a small test trying to reproduce this but unfortunately it worked as expected.

I would need a bit more context to identify what could be happening.
Is that trigger part of some DataTemplate or Style?
Is it possible that it was defined in a style and then again locally in the element?