'WPF : Material Design conflicts with HandyContorl dataGrid style

 <Grid Grid.Row="1">

        <Grid.Resources>
            <ResourceDictionary Source="/HD.Core;component/Styles/handyDictionary.xaml" />
        </Grid.Resources>

        <DataGrid
            hc:DataGridAttach.CanUnselectAllWithBlankArea="True"
            AutoGenerateColumns="True"
            AutoGeneratingColumn="DataGrid_AutoGeneratingColumn"
            HeadersVisibility="All"
            IsReadOnly="True"
            ItemsSource="{Binding Print_Infos}"
            RowHeaderWidth="60">
            <behaviors:Interaction.Triggers>
                <behaviors:EventTrigger EventName="Loaded">
                    <behaviors:InvokeCommandAction Command="{Binding DataGridLoadCmd}" />
                </behaviors:EventTrigger>
            </behaviors:Interaction.Triggers>
            <DataGrid.ItemContainerStyle>
                <Style BasedOn="{StaticResource {x:Type DataGridRow}}" TargetType="DataGridRow">
                    <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                </Style>
            </DataGrid.ItemContainerStyle>
            <DataGrid.RowHeaderTemplate>
                <DataTemplate>
                    <CheckBox IsChecked="{Binding Item.IsSelected, RelativeSource={RelativeSource AncestorType=DataGridRow}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                </DataTemplate>
            </DataGrid.RowHeaderTemplate>
        </DataGrid>
    </Grid>

I introduced the resource style of HandyControl in Grid

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" />
    <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" />
</ResourceDictionary.MergedDictionaries>

Introduced global styles for Material Design in App.Xaml In the end I found that the effect was not satisfactory, enter image description here How can I prevent the styles of Material Design from inheriting the styles of my DataGrid? Thanks in advance!



Solution 1:[1]

I ended up using Bulent and rioV8 answers and create my own snippet

"for loop": {
    "prefix": "for_Loop",
    "body": [
        "for(var ${1:i} = ${2:0}; i < ${3:10}; i++) {",
        "\t$4",
        "}"
    ],
    "description": "for loop"
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Erez Calderon