I have in all my datagrids some styles to be applied for some types but specifically inside the datagrid so it looks like this:
<DataGrid.Resources>
<Style TargetType="{x:Type DataGridCell}">
<EventSetter Event="PreviewMouseLeftButtonDown" Handler="DataGridCell_PreviewMouseLeftButtonDown"></EventSetter>
<Style.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter Property="BorderBrush" Value="White"/>
<Setter Property="BorderThickness" Value="2"/>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type vmcc:LOVComboBox}">
<EventSetter Event="Loaded" Handler="UIElement_GotFocus"></EventSetter>
</Style>
<Style TargetType="{x:Type TextBox}">
<EventSetter Event="Loaded" Handler="UIElement_GotFocus"></EventSetter>
</Style>
</DataGrid.Resources>
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 ...