<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
                    xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
                    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
                    xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
                    xmlns:dxi="http://schemas.devexpress.com/winfx/2008/xaml/core/internal"
                    xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys">

    <Style x:Key="borderStyle" TargetType="Border">
        <Setter Property="Background" Value="{dxi:ThemeResource {dxgt:GridRowThemeKey ResourceKey=BorderNoneBrush}}"/>
        <Style.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsMouseOver" Value="True" />
                    <Condition Property="dxg:TableView.IsFocusedRow" Value="False" />
                </MultiTrigger.Conditions>
                <Setter Property="Background" Value="{dxi:ThemeResource {dxgt:GridRowThemeKey ResourceKey=BorderSelectedBrush}}"/>
            </MultiTrigger>
            <Trigger Property="dxg:TableView.IsFocusedRow" Value="True">
                <Setter Property="Background" Value="{dxi:ThemeResource {dxgt:GridRowThemeKey ResourceKey=BorderFocusedBrush}}"/>
            </Trigger>
            <DataTrigger Binding="{Binding IsSelected}" Value="True">
                <Setter Property="Background" Value="{dxi:ThemeResource {dxgt:GridRowThemeKey ResourceKey=BorderFocusedBrush}}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <ControlTemplate x:Key="{dxgt:GridCardThemeKey ResourceKey=ContainerTemplate}" TargetType="{x:Type ContentControl}">
        <Grid Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ClipToBounds="False">
            <Border x:Name="borderCard" Width="Auto" Height="Auto" Style="{StaticResource borderStyle}">
                <ContentPresenter />
            </Border>
        </Grid>
    </ControlTemplate>

    <Style TargetType="{x:Type dxg:GridCard}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <ContentControl x:Name="card" Template="{DynamicResource {dxgt:GridCardThemeKey ResourceKey=ContainerTemplate}}"
                                    Style="{Binding Path=(dxg:GridControl.ActiveView).CardStyle, RelativeSource={RelativeSource TemplatedParent}}" >
                        <ContentControl Template="{DynamicResource {dxgt:GridCardThemeKey ResourceKey=DataContentTemplate}}" ClipToBounds="False">
                            <dxg:GridCardContentPresenter x:Name="presenter" Style="{DynamicResource {dxgt:GridCardThemeKey ResourceKey=ContentPresenterStyle}}" ClipToBounds="False" />
                        </ContentControl>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>