<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Controls="clr-namespace:MahApps.Metro.Controls">

    <Style TargetType="{x:Type Controls:MetroContentControl}">
        <Setter Property="Focusable" Value="False" />
        <Setter Property="Foreground" Value="#FF000000" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Controls:MetroContentControl">
                    <Grid x:Name="root"
                          Opacity="0"
                          RenderTransformOrigin="0.5,0.5">
                        <Grid.RenderTransform>
                            <TranslateTransform />
                        </Grid.RenderTransform>
                        <AdornerDecorator>
                            <ContentPresenter Margin="{TemplateBinding Padding}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              Content="{TemplateBinding Content}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                              Cursor="{TemplateBinding Cursor}"
                                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </AdornerDecorator>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="LayoutStates">
                                <VisualState x:Name="AfterLoaded">
                                    <Storyboard x:Name="AfterLoadedStoryboard">
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                       Storyboard.TargetName="root"
                                                                       Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.400" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                       Storyboard.TargetName="root"
                                                                       Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="30" />
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.700" Value="0">
                                                <EasingDoubleKeyFrame.EasingFunction>
                                                    <CubicEase EasingMode="EaseOut" />
                                                </EasingDoubleKeyFrame.EasingFunction>
                                            </EasingDoubleKeyFrame>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="AfterLoadedReverse">
                                    <Storyboard x:Name="AfterLoadedReverseStoryboard">
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                       Storyboard.TargetName="root"
                                                                       Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.400" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                       Storyboard.TargetName="root"
                                                                       Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="-30" />
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.700" Value="0">
                                                <EasingDoubleKeyFrame.EasingFunction>
                                                    <CubicEase EasingMode="EaseOut" />
                                                </EasingDoubleKeyFrame.EasingFunction>
                                            </EasingDoubleKeyFrame>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="AfterUnLoaded">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                       Storyboard.TargetName="root"
                                                                       Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.100" Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                       Storyboard.TargetName="root"
                                                                       Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.100" Value="30" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="AfterUnLoadedReverse">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                       Storyboard.TargetName="root"
                                                                       Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.100" Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                       Storyboard.TargetName="root"
                                                                       Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.100" Value="-30" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="BeforeLoaded" />
                                <VisualState x:Name="BeforeUnloaded" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
    </Style>
</ResourceDictionary>