Answer the question
In order to leave comments, you need to log in
External Style in WPF
Good afternoon!
Tell me how best to approach the following task in WPF.
There is an application. The application has buttons, the buttons have their own style (Style). I want to make it possible to replace this style in two ways:
- put the Styles.xaml file next to the program
- when the program starts, it loads a custom dll, which may also contain the desired style.
I want a solution where you need to write a minimum of code. It is clear that you can load the style and manually replace it with the desired one for all buttons.
I would like something like this - there is a common dictionary of application resources (filled by default), then after launch we load a dll from which we override some of these styles, and then a file. It seemed to me that MergeDictionaries and DynamicResource should help me, but for some reason it doesn’t work - the default styles are always used.
Thank you.
PS Advise good materials on styles in WPF.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question