TextBlock inlines unloaded event
Posted: 01 Dec 2023, 14:11
Hello, we have some code where we rely on the Unloaded event to be executed for the UI element that the user is currently hovering over as we have some custom logic for keeping track of what is being hovered over. However, we have run into an issue where the Unloaded event is not always fired, and I have tracked down that it is specifically Inline elements within TextBlocks that don't have the Unloaded event fire when the parent containing them is removed. This currently results in a crash if an in-game-window is closed while the user is hovering over an Inline element within the window.
There are some things we can do to work around this, such as using the TextBlock containing the inlines instead of to the inlines themselves for keeping track of mouse hover. But I was wondering if this could be a bug in Noesis, or if it is intended that inlines don't have the Unloaded event trigger?
I could add as well that we are not using the default TextBlock, but rather our own ParsedTextBlock class, but that one simply inherits from TextBlock and populates the Inline collection that already exists in it, so that really shouldn't cause this. I have also only noticed this being an issue recently, after we updated from Noesis 3.1.4 to 3.2.2, but I have not confirmed whether the Noesis version is the cause of it.
There are some things we can do to work around this, such as using the TextBlock containing the inlines instead of to the inlines themselves for keeping track of mouse hover. But I was wondering if this could be a bug in Noesis, or if it is intended that inlines don't have the Unloaded event trigger?
I could add as well that we are not using the default TextBlock, but rather our own ParsedTextBlock class, but that one simply inherits from TextBlock and populates the Inline collection that already exists in it, so that really shouldn't cause this. I have also only noticed this being an issue recently, after we updated from Noesis 3.1.4 to 3.2.2, but I have not confirmed whether the Noesis version is the cause of it.