title: WPF: Named Style can not be found in Resource
body: <p>Exactly the below code works in a TEST project. But in my productive project It does not find the Resource, why this?</p>
  
  <p>Wpf can not find this <code>Style="{StaticResource bla}"</code></p>
  
  <pre><code>&lt;TextBlock Height="23" HorizontalAlignment="Left" Margin="22,89,0,0"  Text="Keywords" VerticalAlignment="Top" /&gt;
          &lt;TextBox Style="{StaticResource bla}" Height="23" HorizontalAlignment="Left" Margin="22,109,0,0"  VerticalAlignment="Top" Width="244"&gt;
              &lt;Binding Path="Tags" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged"&gt;
                  &lt;Binding.ValidationRules&gt;
                      &lt;DataErrorValidationRule ValidatesOnTargetUpdated="False"  ValidationStep="UpdatedValue"  /&gt;
                  &lt;/Binding.ValidationRules&gt;
              &lt;/Binding&gt;
          &lt;/TextBox&gt;
  
  
  &lt;UserControl.Resources&gt;
  
           &lt;Style x:Name="bla" TargetType="TextBox"&gt;
              &lt;Setter Property="BorderBrush"  Value="DarkBlue"/&gt;
              &lt;Setter Property="BorderThickness" Value="1" /&gt;
              &lt;Setter Property="Margin" Value="0,1,0,1" /&gt;
              &lt;Setter Property="Validation.ErrorTemplate"&gt;
                  &lt;Setter.Value&gt;
                      &lt;ControlTemplate&gt;
                          &lt;StackPanel Orientation="Horizontal"&gt;                          
                              &lt;AdornedElementPlaceholder /&gt;
                              &lt;Grid Margin="2,0,0,0"&gt;
                                  &lt;Ellipse Width="20" Height="20" Fill="Red"/&gt;
                                  &lt;TextBlock Foreground="White" Text="X" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
                              &lt;/Grid&gt;
                          &lt;/StackPanel&gt;
                      &lt;/ControlTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
              &lt;Style.Triggers&gt;
                  &lt;Trigger Property="Validation.HasError" Value="True"&gt;
                      &lt;Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self},Path=(Validation.Errors)[0].ErrorContent}" /&gt;
                  &lt;/Trigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;       
  
      &lt;/UserControl.Resources&gt;
  </code></pre>