New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Safe detection of current theme #108
Comments
And would it be interesting to cache the result for ResourceDictionary instances that have a source? |
I could add code to prevent that exception there, but it would surface somewhere else pretty quickly i guess. But it would, at least, prevent people from blaming ControlzEx.
What do you mean with that? Did you observe any performance issues? |
Not really noticed performance issues, but seeing the same sources multiple times. And since it goes through all keys, it could be "slow"? |
Without caching: [Orchestra.Theming.ThemeManager] [1] [METHODTIMER] ThemeManager.ChangeTheme took '96' ms Let me fork and try with caching. |
Once a theme has been loaded, it makes no difference (since it can find the theme dictionary super fast). But at app startup, when no theme is loaded (at least in Orchestra, but I see callstacks from Fluent.Ribbon as well), it goes through all existing resource dictionaries (and it seems per library theme provider). I've written some caching (which does get hit, so that's a win, just not sure about the "trade-off"). I am happy to add error checking here as well. |
I am trying to move theme management in Orchestra to ControlzEx. However, when calling ChangeTheme, it is trying to detect the old theme. In this case, there is no old theme, but it still fails because of exceptions (failed to find resources).
Will figure out what's causing this. But even if this is a broken ResourceDictionary, shouldn't that be caught as exception and ignored?
The text was updated successfully, but these errors were encountered: