Loading different icon packs at runtime without restarting UI?
Hi everyone,
I'm building a UI where users can switch between multiple icon packs (default, outlined, and high-contrast) from the settings menu while the application is already running.
My current approach is to keep each icon pack in a separate ResourceDictionary with identical resource keys, then replace the merged dictionary at runtime. The icons update in some views, but a few controls continue showing the old resources until the view is recreated.
Is there a recommended way in NoesisGUI to swap an entire icon set during runtime so that all existing controls refresh automatically? Would using DynamicResource everywhere be the correct solution, or is there a better pattern for large icon libraries?
I'd appreciate any examples or best practices from projects that support runtime theme or icon switching.
I'm building a UI where users can switch between multiple icon packs (default, outlined, and high-contrast) from the settings menu while the application is already running.
My current approach is to keep each icon pack in a separate ResourceDictionary with identical resource keys, then replace the merged dictionary at runtime. The icons update in some views, but a few controls continue showing the old resources until the view is recreated.
Is there a recommended way in NoesisGUI to swap an entire icon set during runtime so that all existing controls refresh automatically? Would using DynamicResource everywhere be the correct solution, or is there a better pattern for large icon libraries?
I'd appreciate any examples or best practices from projects that support runtime theme or icon switching.
Learning NoesisGUI one project at a time. Smash Karts Game
Re: Loading different icon packs at runtime without restarting UI?
Your approach seems sound. If you have multiple dictionaries and are binding to them using DynamicResource, then hot-swapping the dictionaries should update the icons.
Could you please paste a minimal reproducible example here that demonstrates the issue you're seeing?
Could you please paste a minimal reproducible example here that demonstrates the issue you're seeing?
Who is online
Users browsing this forum: No registered users and 14 guests