It should not be too much effort. All you have to do is subclass CustomMessageBox
, add dependency properties for the separate foreground colors, and then modify the default control template. (You will see that default template uses the same Foreground
property for the title, caption, message, and button.)
As an example, let's take the title color. First add a dependency property:
public class ExtendedCustomMessageBox : CustomMessageBox
{
public Brush TitleForeground
{
get { return (Brush)GetValue(TitleForegroundProperty); }
set { SetValue(TitleForegroundProperty, value); }
}
public static readonly DependencyProperty TitleForegroundProperty =
DependencyProperty.Register("TitleForeground", typeof(Brush), typeof(ExtendedCustomMessageBox), null);
public CustomMessage()
: base()
{
DefaultStyleKey = typeof(CustomMessageBox);
}
}
Now modify the appropriate part of the control template. Use a TemplateBinding
to reference the new property:
<TextBlock
x:Name="TitleTextBlock"
Text="{TemplateBinding Title}"
Foreground="{TemplateBinding TitleForeground}"
Visibility="Collapsed"
Margin="24,16,24,-6"
FontFamily="{StaticResource PhoneFontFamilySemiBold}"/>
(Note that you can find the full control template in the WP8 toolkit download, in the file Themes\Generic.xaml
. Just copy-paste into your project's resources, and modify.)