WPF style basedon current?

You need to do it in this way only, there is no shortcut to do this, you have to set BasedOn attribute atleast.

Up vote 1 down vote favorite share g+ share fb share tw.

Is there a way to create a style that extends the current style, i.e. Not a specific style? I have a WPF application where I create styles to set some properties like borders or validation.

Now I want to try out some Themes to see which one works best for my application. Problem is that to do that I need to change the BasedOn property on all my Styles to the style in the Theme. I can do it via search/replace but it would be nice if it could be done dynamicly.

Wpf xaml styles link|improve this question asked Nov 20 '09 at 14:51adrianm3,488619 55% accept rate.

Did you try DynamicResource instead of StaticResource.

Error message: "Property 'BasedOn' does not support values of type 'DynamicResourceExtension'. " – adrianm Nov 20 '09 at 15:14.

If you store all your resources in seperate assemblies from your ui then you can use themes to dynamically change them at runtime. Themes in seperate assembly loading different themes at runtime.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions