title: WPF use Datagrid shared resources
body: <p>I have in all my datagrids some styles to be applied for some types but specifically inside the datagrid so it looks like this:</p>
  
  <pre><code>                        &lt;DataGrid.Resources&gt;
                              &lt;Style TargetType="{x:Type DataGridCell}"&gt;
                                  &lt;EventSetter Event="PreviewMouseLeftButtonDown" Handler="DataGridCell_PreviewMouseLeftButtonDown"&gt;&lt;/EventSetter&gt;
                                  &lt;Style.Triggers&gt;
                                      &lt;Trigger Property="IsFocused" Value="True"&gt;
                                          &lt;Setter Property="BorderBrush" Value="White"/&gt;
                                          &lt;Setter Property="BorderThickness" Value="2"/&gt;
                                      &lt;/Trigger&gt;
                                  &lt;/Style.Triggers&gt;
                              &lt;/Style&gt;
                              &lt;Style TargetType="{x:Type vmcc:LOVComboBox}"&gt;
                                  &lt;EventSetter Event="Loaded" Handler="UIElement_GotFocus"&gt;&lt;/EventSetter&gt;
                              &lt;/Style&gt;
                              &lt;Style TargetType="{x:Type TextBox}"&gt;
                                  &lt;EventSetter Event="Loaded" Handler="UIElement_GotFocus"&gt;&lt;/EventSetter&gt;
                              &lt;/Style&gt;
                          &lt;/DataGrid.Resources&gt;
  </code></pre>
  
  <p>How can I create in a single point in my app (for example in a style file) the xaml code to do the same thing applying it to all the datagrids? I've done styles for textbox's for example, but this applies to elements inside the datagrid ... </p>