MainWindow.xaml 3.53 KB
Newer Older
1
<Window x:Class="MultiLayout.MainWindow"
2 3 4 5
        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"
6 7
        xmlns:local="clr-namespace:MultiLayout" xmlns:b="http://schemas.microsoft.com/xaml/behaviors" 
        xmlns:flyctrl="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
8
        mc:Ignorable="d"
9 10 11 12
        Title="MainWindow" Height="450" Width="800" Loaded="MainWindow_Loaded">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
13 14
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Styles.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Converters.xaml"/>
15 16 17 18 19 20
            </ResourceDictionary.MergedDictionaries>
            <local:UcMultiGageVmUt x:Key="viewModel" GageTag="机尾" IsErrMsgVisable ="True"/>
        </ResourceDictionary>
    </Window.Resources>
    <Grid d:DataContext="{StaticResource viewModel}">
        <Frame Name="frame" NavigationUIVisibility="Hidden"/>
21 22 23 24 25
        <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>
潘栩锋's avatar
潘栩锋 committed
26
            <Border Background="Red" CornerRadius="0, 0 10 10" Style="{StaticResource Styles.Shadow}">
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
                <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>
56 57