You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm displaying different SKXamlCanvas controls in separate WinUI TabView tabs. When I remove multiple tabs, the currently selected tab drops its rendered content. I found that this is really a WinUI issue, microsoft/microsoft-ui-xaml#9880, where multiple Unloaded events are triggered on the wrong FrameworkElement. In the SKXamlCanvas code I can see that the backgound is cleared on Unloaded events, so that's why my content disappears. I also found my way to #1118 where you seem to have fixed a somewhat related issue.
When debugging this, I noticed that when the SKXamlCanvas recieves incorrect Unloaded events it actually has IsLoaded == true. Maybe the current fix with the loadUnloadCounter could be replaced with a private isLoaded flag which can be set in OnLoaded, and then prevent multiple Loaded events to be processed? The flag should then only get reset in OnUnloaded if IsLoaded actually is false.
Description
I'm displaying different SKXamlCanvas controls in separate WinUI TabView tabs. When I remove multiple tabs, the currently selected tab drops its rendered content. I found that this is really a WinUI issue, microsoft/microsoft-ui-xaml#9880, where multiple Unloaded events are triggered on the wrong FrameworkElement. In the SKXamlCanvas code I can see that the backgound is cleared on Unloaded events, so that's why my content disappears. I also found my way to #1118 where you seem to have fixed a somewhat related issue.
It seems like WinUI has an erratic Load/Unload behavior in other circumstances as well, and that you maybe cannot rely on them coming in correct order.
microsoft/microsoft-ui-xaml#1900
microsoft/microsoft-ui-xaml#8342
When debugging this, I noticed that when the SKXamlCanvas recieves incorrect Unloaded events it actually has IsLoaded == true. Maybe the current fix with the loadUnloadCounter could be replaced with a private isLoaded flag which can be set in OnLoaded, and then prevent multiple Loaded events to be processed? The flag should then only get reset in OnUnloaded if IsLoaded actually is false.
Code
See microsoft/microsoft-ui-xaml#9880
Expected Behavior
No response
Actual Behavior
No response
Version of SkiaSharp
2.88.3 (Current)
Last Known Good Version of SkiaSharp
Other (Please indicate in the description)
IDE / Editor
Visual Studio (Windows)
Platform / Operating System
Windows
Platform / Operating System Version
No response
Devices
No response
Relevant Screenshots
No response
Relevant Log Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: