StoryboradCompletedTrigger woes
Posted: 27 Sep 2022, 02:56
I'm trying to implement a "ping" icon for my map (ie, something that does a little pulse to draw your attention).
I have a data template for my PingIcon. I made some visual states: "Pinged" and "Hidden". I made a storyboard that does the ping animation that is triggered from the "Pinged" stated.
The problem that I was running into is that if I am in the "Pinged" state, and then hit my data trigger, it doesn't re-play the "ping" animation storyboard in my "Pinged" state. I'm assuming there is some sort of optimization that prevents you transition back to the same state? It would make sense. But maybe there is a way to do this? open to ideas here.
So, I decided to add a new state: "Visible" which didn't have any storyboard; it was just when the ping icon is visible.. I added a StoryboardCompletedTrigger for the storyboard that is triggered for the "ping" state. My idea was that I would add a "GoToStateAction" here and transition to the "Visible" state so that the next time the "ping" data trigger happened, it would be transition back to the "Pinged" state and the animation would play again.
Unfortunately, as far as I can tell, the StoryboardCompletedTrigger isn't working on the data template. While debugging, I switched the GoToStateAction with just a ChangePropertyAction that should have changed the visibility of the control -- but even that didn't do anything, so I'm skeptical that the trigger is every happening. I also set breakpoints in the StoryboardCompletedTrigger class, and I don't see that "OnStoryboardChanged" is being called when my storyboard finishes.
I was going to attempt to debug this more, but I'm not sure what the best steps would be.. Any suggestions? Is there a better way to do this entirely?
thanks,
sam
I have a data template for my PingIcon. I made some visual states: "Pinged" and "Hidden". I made a storyboard that does the ping animation that is triggered from the "Pinged" stated.
The problem that I was running into is that if I am in the "Pinged" state, and then hit my data trigger, it doesn't re-play the "ping" animation storyboard in my "Pinged" state. I'm assuming there is some sort of optimization that prevents you transition back to the same state? It would make sense. But maybe there is a way to do this? open to ideas here.
So, I decided to add a new state: "Visible" which didn't have any storyboard; it was just when the ping icon is visible.. I added a StoryboardCompletedTrigger for the storyboard that is triggered for the "ping" state. My idea was that I would add a "GoToStateAction" here and transition to the "Visible" state so that the next time the "ping" data trigger happened, it would be transition back to the "Pinged" state and the animation would play again.
Unfortunately, as far as I can tell, the StoryboardCompletedTrigger isn't working on the data template. While debugging, I switched the GoToStateAction with just a ChangePropertyAction that should have changed the visibility of the control -- but even that didn't do anything, so I'm skeptical that the trigger is every happening. I also set breakpoints in the StoryboardCompletedTrigger class, and I don't see that "OnStoryboardChanged" is being called when my storyboard finishes.
I was going to attempt to debug this more, but I'm not sure what the best steps would be.. Any suggestions? Is there a better way to do this entirely?
thanks,
sam