Type reference cannot find type named '{clr-namespace:xxx}ClassName on MergedDictionary
<p>I'm received the exception <code>Type reference cannot find type named '{clr-namespace:Dashboard.View}DashBoardColors</code> at runtime.</p>

<p>I have a static class with my colors:</p>

<pre><code>namespace Dashboard.View
{
    public static class DashBoardColors
    {
        public static readonly Color TargetColor = Color.FromRgb(200, 240, 255);
        public static readonly SolidColorBrush Red = new SolidColorBrush(Color.FromRgb(255, 0, 0));
        public static readonly SolidColorBrush Stale = new SolidColorBrush(Color.FromRgb(200, 200, 200));
        public static readonly SolidColorBrush Target = new SolidColorBrush(TargetColor);
        public static readonly SolidColorBrush Dragging = new SolidColorBrush(Color.FromRgb(200, 255, 200));
        public static readonly SolidColorBrush Good = Dragging;
    }
}
</code></pre>

<p>My resource dictionary:</p>

<pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:view="clr-namespace:Dashboard.View"&gt;

    &lt;Style x:Key="AnimatedSwitch" TargetType="{x:Type ToggleButton}"&gt;
        &lt;Setter Property="Foreground" Value="Silver" /&gt;
        &lt;Setter Property="Background" Value="Silver" /&gt;
        &lt;Setter Property="BorderBrush" Value="Silver" /&gt;
        &lt;Setter Property="Template"&gt;
            &lt;Setter.Value&gt;
                &lt;ControlTemplate TargetType="ToggleButton"&gt;
                    &lt;Viewbox Stretch="Uniform" Width="40"&gt;
                        &lt;Canvas Name="Layer_1" Width="20" Height="20"&gt;
                            &lt;Ellipse  Canvas.Left="0" Width="20" Height="20" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="0.5"/&gt;
                            &lt;Ellipse  Canvas.Left="15" Width="20" Height="20" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="0.5"/&gt;
                            &lt;Border Canvas.Left="10" Width="15" Height="20" Name="rect416927" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0.5,0,0.5"/&gt;
                            &lt;Ellipse x:Name="ellipse"  Canvas.Left="0" Width="20" Height="20" Fill="White" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="0.3"&gt;
                                &lt;Ellipse.RenderTransform&gt;
                                    &lt;TranslateTransform X="0" Y="0" /&gt;
                                &lt;/Ellipse.RenderTransform&gt;
                                &lt;Ellipse.BitmapEffect&gt;
                                    &lt;DropShadowBitmapEffect Softness="0.1" ShadowDepth="0.7" Direction="270" Color="#BBBBBB"/&gt;
                                &lt;/Ellipse.BitmapEffect&gt;
                            &lt;/Ellipse&gt;
                        &lt;/Canvas&gt;
                    &lt;/Viewbox&gt;
                    &lt;ControlTemplate.Triggers&gt;
                        &lt;Trigger Property="IsMouseOver" Value="True"&gt;
                            &lt;Trigger.EnterActions&gt;
                                &lt;BeginStoryboard&gt;
                                    &lt;Storyboard&gt;
                                        &lt;ColorAnimation Duration="0:0:0.15" 
                                                          Storyboard.TargetName="ellipse"  
                                                          Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" 
                                                          To="{x:Static view:DashBoardColors.TargetColor}" /&gt;
                                    &lt;/Storyboard&gt;
                                &lt;/BeginStoryboard&gt;
                            &lt;/Trigger.EnterActions&gt;
                            &lt;Trigger.ExitActions&gt;
                                &lt;BeginStoryboard&gt;
                                    &lt;Storyboard FillBehavior="Stop"&gt;
                                        &lt;ColorAnimation Duration="0:0:0.3" 
                                                            Storyboard.TargetName="ellipse"  
                                                          Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" 
                                                            To="White" /&gt;
                                    &lt;/Storyboard&gt;
                                &lt;/BeginStoryboard&gt;
                            &lt;/Trigger.ExitActions&gt;
                        &lt;/Trigger&gt;
                    &lt;/ControlTemplate.Triggers&gt;
                &lt;/ControlTemplate&gt;
            &lt;/Setter.Value&gt;
        &lt;/Setter&gt;
    &lt;/Style&gt;
&lt;/ResourceDictionary&gt;
</code></pre>

<p>And my usage within the usercontrol:</p>

<p>Included the namespace:</p>

<pre><code>xmlns:view="clr-namespace:Dashboard.View"
</code></pre>

<p>Merged the dictionary:</p>

<pre><code>&lt;UserControl.Resources&gt;
    &lt;ResourceDictionary x:Key="Styles"&gt;
        &lt;ResourceDictionary.MergedDictionaries&gt;
            &lt;ResourceDictionary Source="pack://application:,,,/Dashboard;component/View/Styles/AnimatedStyles.xaml"/&gt;
        &lt;/ResourceDictionary.MergedDictionaries&gt;
    &lt;/ResourceDictionary&gt;
&lt;/UserControl.Resources&gt;
</code></pre>

<p>Applied the style:</p>

<pre><code>&lt;ToggleButton  Style="{StaticResource AnimatedSwitch}" Height="20" x:Name="DateSelectToggle" /&gt;
</code></pre>

<p>The problem is in setting the following:</p>

<pre><code>To="{x:Static view:DashBoardColors.TargetColor}"
</code></pre>