I have defined a special style for buttons which is used for all buttons in the application. The background of the button is defined as a vertical LinearGradientBrush with two colors. If the button is pressed down the two colors are swapped via triggers.
Now I need some buttons that use different colors for the gradient, everything else being equal. How can I reuse the already defined style for that?
You could reference your brushes as
DynamicResourcein the baseStyleand add new brushses to your derivedStyleBase Style uses
DynamicResourcefor backgroundBrush and pressedBackgroundBrushBasedOn Style Defines new brushes but uses the same
Style