<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf"
                    xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml" />
    </ResourceDictionary.MergedDictionaries>
    
    <converters:CardClipConverter x:Key="CardClipConverter" />

    <ControlTemplate TargetType="{x:Type wpf:Card}" x:Key="CardTemplate">
        <Border Margin="{TemplateBinding Margin}"
                Effect="{StaticResource MaterialDesignShadowDepth2}"
                CornerRadius="{TemplateBinding UniformCornerRadius}" Background="Transparent">
            <Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" 
                    x:Name="PART_ClipBorder"
                    Clip="{TemplateBinding ContentClip}">                
                <ContentPresenter 
                    x:Name="ContentPresenter"                    
                    Content="{TemplateBinding ContentControl.Content}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}">                    
                </ContentPresenter>
            </Border>                        
        </Border>
    </ControlTemplate>
    <Style TargetType="{x:Type wpf:Card}">
        <Setter Property="TextOptions.TextFormattingMode" Value="Display" />        
        <Setter Property="Template" Value="{StaticResource CardTemplate}" />
        <Setter Property="Background" Value="{DynamicResource MaterialDesignPaper}" />
        <Setter Property="VerticalAlignment" Value="Top" />
    </Style>

</ResourceDictionary>