View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002116 | NoesisGUI | C# SDK | public | 2021-09-17 16:07 | 2021-09-20 23:47 |
| Reporter | ai_enabled | Assigned To | sfernandez | ||
| Priority | normal | Severity | major | ||
| Status | assigned | Resolution | open | ||
| Product Version | 3.1.1 | ||||
| Summary | 0002116: Storyboard from Template is shared between UserControl instances causing an issue with Completed event | ||||
| Description | Hi guys,
Then in its Loaded event handler we're subscribing to this event:
So far so good, except that storyboardOpen is the same instance for all GameWindow instances. So when Completed event is invoked for any animated GameWindow, all GameWindow instances are notified via their StoryboardOpenCompletedHandler about the storyboard completion.
There was no such bug in NoesisGUI v3.0. Regards! | ||||
| Platform | Any | ||||
|
I tried to replicate this in WPF and it turns out that Storyboards defined in a Template.Resources are frozen, so you cannot add a handler to the Completed event (we should fix this, as Noesis is not complaining). InvalidOperationException: Specified value of type 'System.Windows.Media.Animation.Storyboard' must have IsFrozen set to false to modify. It fails even if you try to use a StoryboardCompletedTrigger with that storyboard. To avoid this, and as you are manually starting and stopping the animation, you can create a Clone() from the Template Storyboard for each window to control it: this.storyboardOpen = ((Storyboard)this.Template.Resources["StoryboardOpen"]).Clone(); |
|
|
Hi Sergio, The InvalidOperationException certainly would be very useful! Once you finish with the other remaining issues I will pull the changes and test everything including this solution. Regards! |
|
|
Yes, the Clone of Storyboard works as expected in Noesis, I just verified it. |
|
|
Thank you! I can confirm that Clone is indeed implemented and works as expected. public new Storyboard Clone() => (Storyboard)base.Clone(); The current Clone method is implemented only in the base Freezable class so calling it will return an instance of Freezable class while in WPF a separate method is invoked returning a Storyboard. I guess you may need to do the same for other resource types as well to match WPF API. Regards! |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2021-09-17 16:07 | ai_enabled | New Issue | |
| 2021-09-17 16:08 | ai_enabled | Description Updated | |
| 2021-09-17 16:08 | ai_enabled | Description Updated | |
| 2021-09-20 12:04 | sfernandez | Assigned To | => sfernandez |
| 2021-09-20 12:04 | sfernandez | Status | new => feedback |
| 2021-09-20 12:04 | sfernandez | Note Added: 0007459 | |
| 2021-09-20 12:10 | ai_enabled | Note Added: 0007460 | |
| 2021-09-20 12:10 | ai_enabled | Status | feedback => assigned |
| 2021-09-20 16:27 | sfernandez | Status | assigned => feedback |
| 2021-09-20 16:27 | sfernandez | Note Added: 0007461 | |
| 2021-09-20 23:46 | ai_enabled | Note Added: 0007465 | |
| 2021-09-20 23:46 | ai_enabled | Status | feedback => assigned |
| 2021-09-20 23:47 | ai_enabled | Note Edited: 0007465 |