title: WPF Control style is not applied at design time
body: <p>In my project I'm using <a href="http://wpftoolkit.codeplex.com/" rel="nofollow">Extended WPF Toolkit</a>. I had to override the default style for <a href="http://wpftoolkit.codeplex.com/wikipage?title=WatermarkTextBox&amp;referringTitle=Home" rel="nofollow">WatermarkTextBox</a>. On first sight it was ok - application launches and style is being applied, but when I look at designer - all controls except WatermarkTextBox have applied designs and WatermarkTextBox has not.]</p>
  
  <p>My resource dictionary file:</p>
  
  <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
                  xmlns:wpf="clr-namespace:System.Windows;assembly=PresentationFramework" 
                  xmlns:system="clr-namespace:System;assembly=mscorlib"
                  xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"&gt;
  </code></pre>
  
  <p>And style (all static resources are defined in the same file at beginning):</p>
  
  <pre><code>&lt;Style x:Key="{x:Type xctk:WatermarkTextBox}" TargetType="{x:Type xctk:WatermarkTextBox}"&gt;
      &lt;Setter Property="SnapsToDevicePixels" Value="True" /&gt;
      &lt;Setter Property="OverridesDefaultStyle" Value="True" /&gt;
      &lt;Setter Property="KeyboardNavigation.TabNavigation" Value="None" /&gt;
      &lt;Setter Property="FocusVisualStyle" Value="{x:Null}" /&gt;
      &lt;Setter Property="MinWidth" Value="50" /&gt;
      &lt;Setter Property="MinHeight" Value="34" /&gt;
      &lt;Setter Property="Height" Value="34" /&gt;
      &lt;Setter Property="AllowDrop" Value="True" /&gt;
      &lt;Setter Property="Foreground" Value="{StaticResource DarkGrayBrush}" /&gt;
      &lt;Setter Property="BorderBrush" Value="{StaticResource GrayBrush}" /&gt;
      &lt;Setter Property="BorderThickness" Value="1" /&gt;
      &lt;Setter Property="Background" Value="{StaticResource WhiteBrush}" /&gt;
      &lt;Setter Property="Padding" Value="4,3,4,3" /&gt;
      &lt;Setter Property="FontFamily" Value="{StaticResource OpenSans}" /&gt;
      &lt;Setter Property="FontSize" Value="13" /&gt;
      &lt;Setter Property="FontWeight" Value="Regular" /&gt;
      &lt;Setter Property="VerticalContentAlignment" Value="Center" /&gt;
      &lt;Setter Property="HorizontalContentAlignment" Value="Left" /&gt;
      &lt;Setter Property="MaxLines" Value="1" /&gt;
      &lt;Setter Property="TextAlignment" Value="Left" /&gt;
      &lt;Setter Property="WatermarkTemplate"&gt;
          &lt;Setter.Value&gt;
              &lt;DataTemplate&gt;
                  &lt;ContentControl Content="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" 
                                  Foreground="{StaticResource GrayBrush}" 
                                  Focusable="False" /&gt;
              &lt;/DataTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type xctk:WatermarkTextBox}"&gt;
                  &lt;Border Name="Border"
                          CornerRadius="2"
                          BorderThickness="{TemplateBinding BorderThickness}"
                          BorderBrush="{TemplateBinding BorderBrush}"
                          Background="{TemplateBinding Background}" &gt;
  
                      &lt;Grid Margin="{TemplateBinding Padding}"&gt;
                          &lt;ScrollViewer x:Name="PART_ContentHost"
                                        Panel.ZIndex="10" 
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Stretch" 
                                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /&gt;
  
                          &lt;ContentPresenter x:Name="PART_WatermarkHost"
                                            Content="{TemplateBinding Watermark}"
                                            ContentTemplate="{TemplateBinding WatermarkTemplate}"
                                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                            IsHitTestVisible="False"
                                            Margin="6,0,0,0"
                                            Visibility="Collapsed" /&gt;
                      &lt;/Grid&gt;
  
                      &lt;wpf:VisualStateManager.VisualStateGroups&gt;
                          &lt;wpf:VisualStateGroup x:Name="CommonStates"&gt;
                              &lt;wpf:VisualStateGroup.Transitions&gt;
                                  &lt;wpf:VisualTransition GeneratedDuration="0" /&gt;
                              &lt;/wpf:VisualStateGroup.Transitions&gt;
                              &lt;wpf:VisualState x:Name="Normal" /&gt;
                              &lt;wpf:VisualState x:Name="MouseOver"&gt;
                                  &lt;Storyboard&gt;
                                      &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"&gt;
                                          &lt;EasingColorKeyFrame KeyTime="0" Value="{StaticResource DarkBlueColor}" /&gt;
                                      &lt;/ColorAnimationUsingKeyFrames&gt;
                                  &lt;/Storyboard&gt;
                              &lt;/wpf:VisualState&gt;
                              &lt;wpf:VisualState x:Name="Disabled"&gt;
                                  &lt;Storyboard&gt;
                                      &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"&gt;
                                          &lt;EasingColorKeyFrame KeyTime="0" Value="{StaticResource LightGrayColor}" /&gt;
                                      &lt;/ColorAnimationUsingKeyFrames&gt;
                                  &lt;/Storyboard&gt;
                              &lt;/wpf:VisualState&gt;
                              &lt;wpf:VisualState x:Name="ReadOnly" /&gt;
                          &lt;/wpf:VisualStateGroup&gt;
                      &lt;/wpf:VisualStateManager.VisualStateGroups&gt;
                  &lt;/Border&gt;
  
                  &lt;ControlTemplate.Triggers&gt;
                      &lt;Trigger Property="Text" Value="{x:Null}"&gt;
                          &lt;Setter TargetName="PART_WatermarkHost" Property="Visibility" Value="Visible" /&gt;
                      &lt;/Trigger&gt;
                      &lt;Trigger Property="Text" Value="{x:Static system:String.Empty}"&gt;
                          &lt;Setter TargetName="PART_WatermarkHost" Property="Visibility" Value="Visible" /&gt;
                      &lt;/Trigger&gt;
                  &lt;/ControlTemplate.Triggers&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>I have defined my styles in Styles.xaml file. and I'm referencing it in each UserControl file. For example:</p>
  
  <pre><code>&lt;UserControl.Resources&gt;
      &lt;ResourceDictionary&gt;
          &lt;ResourceDictionary.MergedDictionaries&gt;
              &lt;ResourceDictionary Source="Styles.xaml" /&gt;
          &lt;/ResourceDictionary.MergedDictionaries&gt;
      &lt;/ResourceDictionary&gt;
  &lt;/UserControl.Resources&gt;
  </code></pre>
  
  <p>And I want to apply this style for WatermarkTextBox:</p>
  
  <pre><code>    &lt;xctk:WatermarkTextBox Margin="0,0,0,20" Text="{Binding MyField, Mode=TwoWay}"&gt;
          &lt;xctk:WatermarkTextBox.Watermark&gt;
              &lt;TextBlock Text="Watermark text"
                         Style="{x:Null}" /&gt;
          &lt;/xctk:WatermarkTextBox.Watermark&gt;
      &lt;/xctk:WatermarkTextBox&gt;
  </code></pre>
  
  <p>So, as I mentioned - I see the style is applied at runtime, but in VS2013 designer it uses default style for control. I want to see the right style at design time. Is it possible?</p>
  
  <p>Are the any restrictions for resource file size of anything such? My file contains ~2000lines of XAML code and there are defined about 40 styles.</p>