<Styles xmlns="https://github.com/avaloniaui"
        x:Class="Semi.Avalonia.SemiPopupAnimations"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:converters="clr-namespace:Semi.Avalonia.Converters">
    <Style Selector="Popup LayoutTransformControl#PART_LayoutTransform">
        <Setter Property="RenderTransformOrigin" Value="{Binding $parent[Popup].Placement, Converter={x:Static converters:PlacementToRenderTransformOriginConverter.Instance}}" />
    </Style>

    <Style Selector="Popup[IsOpen=True] LayoutTransformControl#PART_LayoutTransform">
        <Style.Animations>
            <Animation Duration="0:0:0.1" FillMode="Forward" Easing="CubicEaseIn">
                <KeyFrame Cue="0.0">
                    <Setter Property="ScaleTransform.ScaleX" Value="0.98" />
                    <Setter Property="ScaleTransform.ScaleY" Value="0.98" />
                </KeyFrame>
                <KeyFrame Cue="1.0">
                    <Setter Property="ScaleTransform.ScaleX" Value="1.0" />
                    <Setter Property="ScaleTransform.ScaleY" Value="1.0" />
                </KeyFrame>
            </Animation>
        </Style.Animations>
    </Style>
    <Style Selector="Popup[IsOpen=False] LayoutTransformControl#PART_LayoutTransform">
        <Style.Animations>
            <Animation Duration="0:0:0.1" FillMode="Forward" Easing="CubicEaseOut">
                <KeyFrame Cue="0.0">
                    <Setter Property="ScaleTransform.ScaleX" Value="1.0" />
                    <Setter Property="ScaleTransform.ScaleY" Value="1.0" />
                </KeyFrame>
                <KeyFrame Cue="1.0">
                    <Setter Property="ScaleTransform.ScaleX" Value="0.98" />
                    <Setter Property="ScaleTransform.ScaleY" Value="0.98" />
                </KeyFrame>
            </Animation>
        </Style.Animations>
    </Style>
</Styles>