<Window x:Class="MultiLayout.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:MultiLayout" xmlns:b="http://schemas.microsoft.com/xaml/behaviors" 
        xmlns:flyctrl="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800" Loaded="MainWindow_Loaded">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Styles.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Converters.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <local:UcMultiGageVmUt x:Key="viewModel" GageTag="机尾" IsErrMsgVisable ="True"/>
        </ResourceDictionary>
    </Window.Resources>
    <Grid d:DataContext="{StaticResource viewModel}">
        <Frame Name="frame" NavigationUIVisibility="Hidden"/>
        <Button x:Name="btnErrMsg" Style="{StaticResource Styles.Button.Empty}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,50,0"
                Visibility="{Binding IsErrMsgVisable,Converter={StaticResource visbilityconv}}" Click="btnErrMsgClick" >
            <b:Interaction.Behaviors>
                <flyctrl:DrapMoveXBehavior Move="DrapMoveXBehavior_Move" />
            </b:Interaction.Behaviors>
            <Border Background="Red" CornerRadius="0, 0 10 10" Style="{StaticResource Styles.Shadow}">
                <StackPanel Orientation="Horizontal">
                    <Grid Width="15"/>
                    <Path Margin="5" Fill="White" Stretch="Uniform" Width="20" Height="20" SnapsToDevicePixels="True" Data="{StaticResource Geometry_alert-circle-outline}"  >
                        <Path.Style>
                            <Style TargetType="Path">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsErrMsgVisable}" Value="True">
                                        <DataTrigger.EnterActions>
                                            <BeginStoryboard>
                                                <Storyboard RepeatBehavior="Forever" >
                                                    <DoubleAnimation BeginTime="0:0:0" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="00:00:01" />
                                                    <DoubleAnimation BeginTime="0:0:1" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="00:00:01" />
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </DataTrigger.EnterActions>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Path.Style>
                    </Path>
                    <TextBlock Text="{Binding ErrMsg}" FontWeight="Bold" FontFamily="YouYuan" FontSize="20" 
                       Padding="10" TextAlignment="Left" MaxWidth="600"
                       Foreground="White" />
                    <Grid Width="10"/>
                </StackPanel>
            </Border>
        </Button>
    </Grid>
</Window>


