title: Can't find resource dictionary WPF
body: <p>I have my ResourceDictionary.xaml file in my Project. It's binded in App.xaml. Everything works fine, until I add this Microsoft's Combobox template: <a href="http://msdn.microsoft.com/en-us/library/ms752094.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms752094.aspx</a></p>
  
  <p>It can't find my ResourceDictionary file and throws Exception:</p>
  
  <pre><code>Unable to find the specified file. at Microsoft.Windows.Design.Platform.ViewProducerBase.Microsoft.Expression.DesignModel.DocumentModel.IDocumentRootResolver.GetDocumentRoot(String path)
     at Microsoft.Expression.Platform.WPF.InstanceBuilders.ResourceDictionaryInstanceBuilder.ProvideResourceDictionary(IInstanceBuilderContext context, DocumentCompositeNode resourceDictionaryReferenceNode, IDocumentRoot&amp; relatedRoot)
  </code></pre>
  
  <p>Here is App.xaml</p>
  
  <p></p>
  
  <pre><code>&lt;Style TargetType="{x:Type TextBox}"&gt;
      &lt;Setter Property="Template"&gt;
           &lt;Setter.Value&gt;
               &lt;ControlTemplate TargetType="{x:Type TextBox}"&gt;
                  &lt;Border Background="{TemplateBinding Background}" x:Name="Bd" BorderBrush="Gray" BorderThickness="2" CornerRadius="2"&gt;
                      &lt;ScrollViewer x:Name="PART_ContentHost"/&gt;
                  &lt;/Border&gt;
                  &lt;ControlTemplate.Triggers&gt;
                      &lt;Trigger Property="IsEnabled" Value="False"&gt;
                          &lt;Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" TargetName="Bd"/&gt;
                          &lt;Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" /&gt;
                      &lt;/Trigger&gt;
                      &lt;Trigger Property="IsFocused" Value="true"&gt;
                          &lt;Setter Property="BorderBrush" Value="#FF1388B7" TargetName="Bd"/&gt;
                          &lt;Setter Property="BorderThickness" Value="2"/&gt;
                      &lt;/Trigger&gt;
                      &lt;Trigger Property="IsFocused" Value="false"&gt;
                          &lt;Setter Property="BorderBrush" Value="Gray" TargetName="Bd"/&gt;
                          &lt;Setter Property="BorderThickness" Value="2"/&gt;
                      &lt;/Trigger&gt;
                  &lt;/ControlTemplate.Triggers&gt;
              &lt;/ControlTemplate&gt;
           &lt;/Setter.Value&gt;
  
      &lt;/Setter&gt;
  
  &lt;/Style&gt;
  
  
  
  &lt;Style x:Key="ButtonFocusVisual"&gt;
      &lt;Setter Property="Control.Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate&gt;
                  &lt;Border&gt;
                      &lt;Rectangle Margin="2"
                   StrokeThickness="1"
                   Stroke="#60000000"
                   StrokeDashArray="1 2" /&gt;
                  &lt;/Border&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  
  &lt;!-- Button --&gt;
  &lt;Style TargetType="Button"&gt;
      &lt;Setter Property="SnapsToDevicePixels"
        Value="true" /&gt;
      &lt;Setter Property="OverridesDefaultStyle"
        Value="true" /&gt;
      &lt;Setter Property="FocusVisualStyle"
        Value="{StaticResource ButtonFocusVisual}" /&gt;
      &lt;Setter Property="MinHeight"
        Value="23" /&gt;
      &lt;Setter Property="MinWidth"
        Value="75" /&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="Button"&gt;
                  &lt;Border TextBlock.Foreground="{TemplateBinding Foreground}"
              x:Name="Border"
              CornerRadius="2"
              BorderThickness="1"&gt;
                      &lt;Border.BorderBrush&gt;
                          &lt;LinearGradientBrush StartPoint="0,0"
                               EndPoint="0,1"&gt;
                              &lt;LinearGradientBrush.GradientStops&gt;
                                  &lt;GradientStopCollection&gt;
                                      &lt;GradientStop Color="{DynamicResource BorderLightColor}"
                              Offset="0.0" /&gt;
                                      &lt;GradientStop Color="{DynamicResource BorderDarkColor}"
                              Offset="1.0" /&gt;
                                  &lt;/GradientStopCollection&gt;
                              &lt;/LinearGradientBrush.GradientStops&gt;
                          &lt;/LinearGradientBrush&gt;
  
                      &lt;/Border.BorderBrush&gt;
                      &lt;Border.Background&gt;
                          &lt;LinearGradientBrush EndPoint="0.5,1"
                               StartPoint="0.5,0"&gt;
                              &lt;GradientStop Color="{DynamicResource ControlLightColor}"
                          Offset="0" /&gt;
                              &lt;GradientStop Color="{DynamicResource ControlMediumColor}"
                          Offset="1" /&gt;
                          &lt;/LinearGradientBrush&gt;
                      &lt;/Border.Background&gt;
                      &lt;VisualStateManager.VisualStateGroups&gt;
                          &lt;VisualStateGroup x:Name="CommonStates"&gt;
                              &lt;VisualStateGroup.Transitions&gt;
                                  &lt;VisualTransition GeneratedDuration="0:0:0.5" /&gt;
                                  &lt;VisualTransition GeneratedDuration="0"
                                To="Pressed" /&gt;
                              &lt;/VisualStateGroup.Transitions&gt;
                              &lt;VisualState x:Name="Normal" /&gt;
                              &lt;VisualState x:Name="MouseOver"&gt;
                                  &lt;Storyboard&gt;
                                      &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).
                    (GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                              Storyboard.TargetName="Border"&gt;
                                          &lt;EasingColorKeyFrame KeyTime="0"
                                       Value="{StaticResource ControlMouseOverColor}" /&gt;
                                      &lt;/ColorAnimationUsingKeyFrames&gt;
                                  &lt;/Storyboard&gt;
                              &lt;/VisualState&gt;
                              &lt;VisualState x:Name="Pressed"&gt;
                                  &lt;Storyboard&gt;
                                      &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).
                    (GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                              Storyboard.TargetName="Border"&gt;
                                          &lt;EasingColorKeyFrame KeyTime="0"
                                       Value="{StaticResource ControlPressedColor}" /&gt;
                                      &lt;/ColorAnimationUsingKeyFrames&gt;
                                      &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderBrush).
                    (GradientBrush.GradientStops)[0].(GradientStop.Color)"
                                              Storyboard.TargetName="Border"&gt;
                                          &lt;EasingColorKeyFrame KeyTime="0"
                                       Value="{StaticResource PressedBorderDarkColor}" /&gt;
                                      &lt;/ColorAnimationUsingKeyFrames&gt;
                                      &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderBrush).
                    (GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                              Storyboard.TargetName="Border"&gt;
                                          &lt;EasingColorKeyFrame KeyTime="0"
                                       Value="{StaticResource PressedBorderLightColor}" /&gt;
                                      &lt;/ColorAnimationUsingKeyFrames&gt;
                                  &lt;/Storyboard&gt;
                              &lt;/VisualState&gt;
                              &lt;VisualState x:Name="Disabled"&gt;
                                  &lt;Storyboard&gt;
                                      &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).
                    (GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                              Storyboard.TargetName="Border"&gt;
                                          &lt;EasingColorKeyFrame KeyTime="0"
                                       Value="{StaticResource DisabledControlDarkColor}" /&gt;
                                      &lt;/ColorAnimationUsingKeyFrames&gt;
                                      &lt;ColorAnimationUsingKeyFrames
                    Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)"
                                              Storyboard.TargetName="Border"&gt;
                                          &lt;EasingColorKeyFrame KeyTime="0"
                                       Value="{StaticResource DisabledForegroundColor}" /&gt;
                                      &lt;/ColorAnimationUsingKeyFrames&gt;
                                      &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderBrush).
                    (GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                              Storyboard.TargetName="Border"&gt;
                                          &lt;EasingColorKeyFrame KeyTime="0"
                                       Value="{StaticResource DisabledBorderDarkColor}" /&gt;
                                      &lt;/ColorAnimationUsingKeyFrames&gt;
                                  &lt;/Storyboard&gt;
                              &lt;/VisualState&gt;
                          &lt;/VisualStateGroup&gt;
                      &lt;/VisualStateManager.VisualStateGroups&gt;
                      &lt;ContentPresenter Margin="2"
                          HorizontalAlignment="Center"
                          VerticalAlignment="Center"
                          RecognizesAccessKey="True" /&gt;
                  &lt;/Border&gt;
                  &lt;ControlTemplate.Triggers&gt;
                      &lt;Trigger Property="IsDefault"
                 Value="true"&gt;
  
                          &lt;Setter TargetName="Border"
                  Property="BorderBrush"&gt;
                              &lt;Setter.Value&gt;
                                  &lt;LinearGradientBrush StartPoint="0,0"
                                   EndPoint="0,1"&gt;
                                      &lt;GradientBrush.GradientStops&gt;
                                          &lt;GradientStopCollection&gt;
                                              &lt;GradientStop Color="{DynamicResource DefaultBorderBrushLightBrush}"
                                  Offset="0.0" /&gt;
                                              &lt;GradientStop Color="{DynamicResource DefaultBorderBrushDarkColor}"
                                  Offset="1.0" /&gt;
                                          &lt;/GradientStopCollection&gt;
                                      &lt;/GradientBrush.GradientStops&gt;
                                  &lt;/LinearGradientBrush&gt;
  
                              &lt;/Setter.Value&gt;
                          &lt;/Setter&gt;
                      &lt;/Trigger&gt;
                  &lt;/ControlTemplate.Triggers&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  
  &lt;Color x:Key="WindowColor"&gt;#FFE8EDF9&lt;/Color&gt;
  &lt;Color x:Key="ContentAreaColorLight"&gt;#FFC5CBF9&lt;/Color&gt;
  &lt;Color x:Key="ContentAreaColorDark"&gt;#FF7381F9&lt;/Color&gt;
  
  &lt;Color x:Key="DisabledControlLightColor"&gt;#FFE8EDF9&lt;/Color&gt;
  &lt;Color x:Key="DisabledControlDarkColor"&gt;#FFC5CBF9&lt;/Color&gt;
  &lt;Color x:Key="DisabledForegroundColor"&gt;#FF888888&lt;/Color&gt;
  
  &lt;Color x:Key="SelectedBackgroundColor"&gt;#FFC5CBF9&lt;/Color&gt;
  &lt;Color x:Key="SelectedUnfocusedColor"&gt;#FFDDDDDD&lt;/Color&gt;
  
  &lt;Color x:Key="ControlLightColor"&gt;White&lt;/Color&gt;
  &lt;Color x:Key="ControlMediumColor"&gt;#FF7381F9&lt;/Color&gt;
  &lt;Color x:Key="ControlDarkColor"&gt;#FF211AA9&lt;/Color&gt;
  
  &lt;Color x:Key="ControlMouseOverColor"&gt;#FF3843C4&lt;/Color&gt;
  &lt;Color x:Key="ControlPressedColor"&gt;#FF211AA9&lt;/Color&gt;
  
  
  &lt;Color x:Key="GlyphColor"&gt;#FF444444&lt;/Color&gt;
  &lt;Color x:Key="GlyphMouseOver"&gt;sc#1, 0.004391443, 0.002428215, 0.242281124&lt;/Color&gt;
  
  &lt;!--Border colors--&gt;
  &lt;Color x:Key="BorderLightColor"&gt;#FFCCCCCC&lt;/Color&gt;
  &lt;Color x:Key="BorderMediumColor"&gt;#FF888888&lt;/Color&gt;
  &lt;Color x:Key="BorderDarkColor"&gt;#FF444444&lt;/Color&gt;
  
  &lt;Color x:Key="PressedBorderLightColor"&gt;#FF888888&lt;/Color&gt;
  &lt;Color x:Key="PressedBorderDarkColor"&gt;#FF444444&lt;/Color&gt;
  
  &lt;Color x:Key="DisabledBorderLightColor"&gt;#FFAAAAAA&lt;/Color&gt;
  &lt;Color x:Key="DisabledBorderDarkColor"&gt;#FF888888&lt;/Color&gt;
  
  &lt;Color x:Key="DefaultBorderBrushDarkColor"&gt;Black&lt;/Color&gt;
  
  &lt;!--Control-specific resources.--&gt;
  &lt;Color x:Key="HeaderTopColor"&gt;#FFC5CBF9&lt;/Color&gt;
  &lt;Color x:Key="DatagridCurrentCellBorderColor"&gt;Black&lt;/Color&gt;
  &lt;Color x:Key="SliderTrackDarkColor"&gt;#FFC5CBF9&lt;/Color&gt;
  
  &lt;Color x:Key="NavButtonFrameColor"&gt;#FF3843C4&lt;/Color&gt;
  
  &lt;LinearGradientBrush x:Key="MenuPopupBrush"
                   EndPoint="0.5,1"
                   StartPoint="0.5,0"&gt;
      &lt;GradientStop Color="{DynamicResource ControlLightColor}"
              Offset="0" /&gt;
      &lt;GradientStop Color="{DynamicResource ControlMediumColor}"
              Offset="0.5" /&gt;
      &lt;GradientStop Color="{DynamicResource ControlLightColor}"
              Offset="1" /&gt;
  &lt;/LinearGradientBrush&gt;
  
  &lt;LinearGradientBrush x:Key="ProgressBarIndicatorAnimatedFill"
                   StartPoint="0,0"
                   EndPoint="1,0"&gt;
      &lt;LinearGradientBrush.GradientStops&gt;
          &lt;GradientStopCollection&gt;
              &lt;GradientStop Color="#000000FF"
                  Offset="0" /&gt;
              &lt;GradientStop Color="#600000FF"
                  Offset="0.4" /&gt;
              &lt;GradientStop Color="#600000FF"
                  Offset="0.6" /&gt;
              &lt;GradientStop Color="#000000FF"
                  Offset="1" /&gt;
          &lt;/GradientStopCollection&gt;
      &lt;/LinearGradientBrush.GradientStops&gt;
  &lt;/LinearGradientBrush&gt;
  </code></pre>
  
  <p></p>