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 (http://wpftoolkit.codeplex.com/wikipage?title=MessageBox&referringTitle=Home#style)

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.

 

    <Application.Resources>
        <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}"/>
        </Style>
    </Application.Resources>
Jun 2, 2011 at 6:09 PM

Found it in the "Instructions for using" here:  http://wpftoolkit.codeplex.com/releases/view/63863

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="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
             x:Class="MyClass.App">