Readding to viewport retriggers everything
Posted: 09 Feb 2024, 03:45
Hi! In my game I'm using a lot of the following pattern.
<b:Interaction.Triggers>
<b:PropertyChangedTrigger Binding="{Binding DataContext.MyGame.game_state, ElementName=Root}">
<b:GoToStateAction StateName="{Binding DataContext.MyGame.game_state, ElementName=Root}" />
</b:PropertyChangedTrigger>
</b:Interaction.Triggers>
When I'm switching levels, I'm forced to do an AddToViewport on the main widget. Everything is functional, the only problem is retriggering all of the animations that arrive at the current state because the above triggers are all triggered again. Is there's anything I can do to disable that behavior on re-adding to viewport?
<b:Interaction.Triggers>
<b:PropertyChangedTrigger Binding="{Binding DataContext.MyGame.game_state, ElementName=Root}">
<b:GoToStateAction StateName="{Binding DataContext.MyGame.game_state, ElementName=Root}" />
</b:PropertyChangedTrigger>
</b:Interaction.Triggers>
When I'm switching levels, I'm forced to do an AddToViewport on the main widget. Everything is functional, the only problem is retriggering all of the animations that arrive at the current state because the above triggers are all triggered again. Is there's anything I can do to disable that behavior on re-adding to viewport?