This project has moved. For the latest updates, please go here.

MessageBox - Changing Style - Better or more detail please.

Jun 2, 2011 at 5:41 PM
Edited Jun 2, 2011 at 5:42 PM

I did review the Style Guide (

But I can't get it to work.  I am fairly new to WPF and I am sure I am just not understanding something that was assumed.  The code behind using the MessageBox in the MainWindow.xaml.cs works just fine.  But when I add the style code to the app.xaml I get errors.  Do I need to reference the ToolKit in the app.xaml some how?

To change the style of the MessageBox, you put style tags in the app.xaml file.  

When I do so I get the following error.

Error: Type 'toolkit:MessageBox' was not found.

Below is my code.


        <Style TargetType="{x:Type toolkit:MessageBox}">
            <Setter Property="Background" Value="Aquamarine" />
            <Setter Property="BorderBrush" Value="Red" />
            <Setter Property="CaptionForeground" Value="Orange" />
            <Setter Property="WindowBorderBrush" Value="Blue" />
            <Setter Property="WindowBackground" Value="Green" />
            <Setter Property="WindowOpacity" Value="0.3" />
            <Setter Property="Foreground" Value="Purple"/>
            <Setter Property="CloseButtonStyle" Value="{StaticResource MyCloseButtonStyle}"/>
Jun 2, 2011 at 6:09 PM

Found it in the "Instructions for using" here:

Aug 22, 2013 at 12:04 AM
Edited Aug 22, 2013 at 12:04 AM
Just to be clear for anyone else coming across this the reference to the namespace was needed.

Eg the xmlns:toolkit line below:
<Application xmlns:x=""