title: How can I use Blend or VS Designer to Edit Default Style Template for WPF PropertyGrid
body: <p>I am using the <a href="https://archive.codeplex.com/?p=wpftoolkit" rel="nofollow noreferrer">Extended WPF Toolkit Community Edition v2.6</a> from NuGet in my project, but I don't know if there is something more I should be doing to allow me to theme or customize a control template.</p>
  
  <p>After asking Designer/Blend to create a Copy of the Existing default Template for the PropertyGrid control, the UI is broken.  The Template looks correct but no longer functions at Design-Time or Run-Time.</p>
  
  <p><a href="https://i.stack.imgur.com/GGf5R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GGf5R.png" alt="enter image description here"></a></p>
  
  <p>After choosing to copy the default template into a new a Style:</p>
  
  <p><a href="https://i.stack.imgur.com/mIC5G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mIC5G.png" alt="Image"></a>
  </p>
  
  <p>Is there an easy way to edit the built-in styles for this control?  I am really just trying to override the foreground/background colors of the Editors/Labels of the PropertyGrid.</p>
  
  <p>I've tried some manual poking in the XAML with limited success:</p>
  
  <pre><code>&lt;Style TargetType="{x:Type xctk:DropDownButton}"&gt;
    &lt;Setter Property="Background" Value="Black"/&gt;
    &lt;Setter Property="Foreground" Value="White"/&gt;
  &lt;/Style&gt;
  &lt;Style TargetType="{x:Type xctk:CustomPropertyItem}"&gt;
    &lt;Setter Property="Background" Value="Black"/&gt;
    &lt;Setter Property="Foreground" Value="White"/&gt;
  &lt;/Style&gt;
  &lt;Style TargetType="{x:Type xctk:PropertyGridEditorCollectionControl}"&gt;
    &lt;Setter Property="Background" Value="Black"/&gt;
    &lt;Setter Property="Foreground" Value="White"/&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>When trying to create a Property Container style, by copying the default, I get the "Copy Style failed." error from within the VS Designer or Blend.</p>
  
  <p><a href="https://i.stack.imgur.com/3vhTs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3vhTs.png" alt="enter image description here"></a></p>
  
  <p>Results in this:</p>
  
  <p><a href="https://i.stack.imgur.com/r0rII.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r0rII.png" alt="Error from Copy Style"></a></p>
  
  <p>I have tried manually including the generic.xaml from the Xceed Toolkit assembly but it hasn't fixed the problem.</p>
  
  <p>I tried two ways of referencing the resource:</p>
  
  <pre><code>&lt;ResourceDictionary Source="/Xceed.Wpf.Toolkit;component/themes/generic.xaml" /&gt;
  
  &lt;ResourceDictionary Source="pack://application:,,,/Xceed.Wpf.Toolkit;component/Themes/generic.xaml"&gt;
  </code></pre>
  
  <p>Here is the stack trace from the Designer when I try to set the PropertyContainerStyle:</p>
  
  <p><a href="https://i.stack.imgur.com/U3fng.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U3fng.png" alt="stack trace"></a></p>