I am creating a popup dialog using microsoft’s WPF.
The thing is that this popup must support two or more different styles, for instance, depending on how it is called the popup must have a red background and white text in the foreground, or it must have a white background and gray text in the foreground.
What I would like to do is create as many styles as necessary in my xaml file and just choose each of them depending on how the popup was created, therefore I would like to know if it is possible to create something like this (kind of a dynamically applied style) inside the .xaml file, or if it is better to just do this programatically in the code behind.
Also please note that I am using the Visual Studio 2010 with the .NET Framework 4.0.
Thanks,
Felipe
I would define an enumeration that names the styles, then either use DataTriggers to set the style on the control from a wrapping border.