How do I prevent ResourceLookups when unloading controls #5681
Replies: 1 comment 2 replies
-
Ok Im fairely certain now that this problem is worthy for an issue. The StyleChanged events happen, when unloading controls, if you have "global styles" defined in App.xaml. It feels like those invalidations should not directly update the style, but wait for the control to enter the visual / logical tree. Then they would evauluate the same style resulting in no change. |
Beta Was this translation helpful? Give feedback.
-
We have some kind of "browser like" appication that is based on a TabControl that dynamically creates and removes tabpages, based on userinput.
TabPages sometimes contain complex views.
When removing tabpages we basically "cache" the content in a dictionary to quickly restore it, if it is needed again.
All this works fine, except that removing the TabPages sometimes takes a few seconds.
When hitting pause in the debugger ill allways land somewhere around these
So when a Controls VisualParent changes to null, it still causes a lot of invalidations of styles and resources.
I figured that moving things into Themes/Generic.xaml does improve the issue, but not completely prevent it.
So my question is, can I tell WPF to "relax" and not invalidate things? Or is there something I am doing wrong in general?
Beta Was this translation helpful? Give feedback.
All reactions