Howto: Applying a Style defined in generic.xaml to a UserControl? (WPF)?

It seems that Generic. Xaml is not the right place to store styles for non custom controls. Somewhere I found the hint to put the syle in App.

Xaml instead of generic. Xaml and this worked directly. So it seams Generic.

Xaml can only be used to store styles for customControls. Maybe someone can add a more educated reason for this behaviour?

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

I've created a style in generic. Xaml that I want to use in my project on several UserControls. In the same way I have defined a style for a custom control and this one works so it seems generic.

Xaml is loaded, this is the defined style: But now I want to use this style but I cannot get it to work. I've tryed adding it as a style parameter to a custom instance of UserControl in the following way: however this gives me a note that the resource ServiceStyle could not be found. When trying to run there is a runtime error on this.

Thanks in advance. Wpf xaml styles generic. Xaml link|improve this question edited Aug 12 '11 at 17:24Dave Clemmer1,77331030 asked May 5 '11 at 13:00Bas Goossen162.

Retagged, assuming you wanted 'WPF' and not 'WFP' – Steve Greatrex May 16 '11 at 12:29.

When Generic. Xaml use ComponentResourceKey.

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