<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Microsoft.Toolkit.Uwp.UI.Controls">

    <Style x:Key="VisualStudioCodeNotificationButtonStyle" TargetType="ButtonBase">
        <Setter Property="Background" Value="#0E639C" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="FontSize" Value="14" />
        <Setter Property="Padding" Value="10 0" />
        <Setter Property="Height" Value="35" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ButtonBase">
                    <Grid x:Name="RootGrid" 
                          Padding="{TemplateBinding Padding}" 
                          Margin="{TemplateBinding Margin}" 
                          Background="{TemplateBinding Background}">
                        <ContentPresenter Content="{TemplateBinding Content}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="#1177BB" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="#1177BB" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="VSCodeNotificationStyle" TargetType="local:InAppNotification">
        <Setter Property="Background" Value="#333333" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="ShowDismissButton" Value="False" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="FontSize" Value="14" />
        <Setter Property="MinHeight" Value="35" />
        <Setter Property="RenderTransformOrigin" Value="0.5,0" />
        <Setter Property="Margin" Value="20 0" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="VerticalOffset" Value="-100" />
        <Setter Property="Template" Value="{StaticResource VSCodeNotificationTemplate}" />
    </Style>

    <ControlTemplate x:Key="VSCodeNotificationTemplate" TargetType="local:InAppNotification">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="State">
                    <VisualState x:Name="Collapsed">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" 
                                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)">
                                <EasingDoubleKeyFrame KeyTime="0" Value="0" />
                                <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0" />
                            </DoubleAnimationUsingKeyFrames>

                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" 
                                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)">
                                <EasingDoubleKeyFrame KeyTime="0" Value="0" />
                                <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="-100" />
                            </DoubleAnimationUsingKeyFrames>

                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid"
                                                           Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                                <DiscreteObjectKeyFrame KeyTime="0:0:0.1">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>

                    <VisualState x:Name="Visible">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" 
                                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)">
                                <EasingDoubleKeyFrame KeyTime="0" Value="0" />
                                <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0" />
                            </DoubleAnimationUsingKeyFrames>

                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" 
                                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)">
                                <EasingDoubleKeyFrame KeyTime="0" Value="-100" />
                                <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>

            <Grid x:Name="RootGrid"
                  RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}"
                  Margin="{TemplateBinding Margin}"
                  Padding="{TemplateBinding Padding}"
                  MaxWidth="{TemplateBinding MaxWidth}"
                  Visibility="{TemplateBinding Visibility}"
                  Background="{TemplateBinding Background}" 
                  BorderBrush="{TemplateBinding BorderBrush}" 
                  BorderThickness="{TemplateBinding BorderThickness}">
                <Grid.RenderTransform>
                    <CompositeTransform />
                </Grid.RenderTransform>
                
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <Grid Margin="10 5" Height="20" Background="#007ACC">
                    <TextBlock Text="info"
                               Padding="5 0"
                               FontWeight="Bold"
                               VerticalAlignment="Center"
                               Foreground="White" />
                </Grid>

                <ContentPresenter Grid.Column="1" 
                                  HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                                  HorizontalContentAlignment="Stretch"
                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                  VerticalContentAlignment="Center"
                                  TextWrapping="NoWrap" />
            </Grid>
        </Grid>
    </ControlTemplate>

</ResourceDictionary>

