<UserControl x:Class="FLY.Thick.Base.UI.CustomSection.UcSectionError"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:FLY.Thick.Base.UI.CustomSection"
             xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
             mc:Ignorable="d" >
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Themes/Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>

        <Border Style="{StaticResource Styles.ParamSection.Border}">
            <TextBlock Text="报警提示" />
        </Border>
        <StackPanel Grid.Column="1">
            <GroupBox Style="{x:Null}" Margin="{StaticResource ControlMargin}">
                <GroupBox.Header>
                    <TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="音乐" VerticalAlignment="Bottom"/>
                </GroupBox.Header>
                <StackPanel>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <StackPanel Orientation="Horizontal">
                            <StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
                                <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="持续时间" />
                                <StackPanel Orientation="Horizontal">
                                    <TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding WarningDurationSec}" MaxWidth="120" HorizontalAlignment="Left"/>
                                    <TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="秒"/>
                                </StackPanel>
                            </StackPanel>
                            <Button Style="{StaticResource Styles.Button.Icon.Rectangle}" Command="{Binding PlayCmd}" >
                                <iconPacks:PackIconMaterial Kind="Play" />
                            </Button>
                        </StackPanel>
                        <Grid Grid.Column="1">
                            <StackPanel Grid.Column="1" Margin="{StaticResource ControlMargin}">
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="音乐文件路径" VerticalAlignment="Bottom"/>
                                    <Button Style="{StaticResource Styles.Button.Icon}" Command="{Binding OpenCmd}" >
                                        <iconPacks:PackIconMaterial Kind="FolderOpen" />
                                    </Button>
                                </StackPanel>
                                <Viewbox Height="36" HorizontalAlignment="Left" >
                                    <TextBlock Style="{StaticResource TextBlockStyle_FieldContent}" Text="{Binding WarningTipPath}" />
                                </Viewbox>

                            </StackPanel>
                        </Grid>
                    </Grid>



                </StackPanel>

            </GroupBox>
            <GroupBox Style="{x:Null}" Margin="{StaticResource ControlMargin}">
                <GroupBox.Header>
                    <TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="USB继电器" VerticalAlignment="Bottom"/>
                </GroupBox.Header>
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <StackPanel Margin="{StaticResource ControlMargin}">
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="使能" />
                            <ToggleButton Style="{StaticResource Styles.ToggleButton.YESNO}" HorizontalAlignment="Left" IsChecked="{Binding LCUS1_Enable}" />
                        </StackPanel>
                        <StackPanel Margin="{StaticResource ControlMargin}">
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="串口地址" />
                            <StackPanel Orientation="Horizontal">
                                <TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding LCUS1_PortName}" HorizontalAlignment="Left" Tag="Full"/>
                            </StackPanel>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">

                            <Button Style="{StaticResource Styles.Button.Icon.Rectangle}" Command="{Binding BellRingCmd}" >
                                <iconPacks:PackIconMaterial Kind="BellRing" />
                            </Button>

                            <Button Style="{StaticResource Styles.Button.Icon.Rectangle}" Command="{Binding BellOffCmd}" Background="{StaticResource Brushes.NoAct}">
                                <iconPacks:PackIconMaterial Kind="BellOff" />
                            </Button>
  
                        </StackPanel>
                    </StackPanel>
                    <TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" >
                        状态:<Run Text="{Binding LCUS1.ErrMsg,Mode=OneWay}"/>
                    </TextBlock>
                </StackPanel>

            </GroupBox>
            <GroupBox Style="{x:Null}" Margin="{StaticResource ControlMargin}">
                <GroupBox.Header>
                    <TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="大屏显示扫描报警" VerticalAlignment="Bottom"/>
                </GroupBox.Header>
                <StackPanel Orientation="Horizontal" x:Name="spErrCodes">
                    <StackPanel Margin="{StaticResource ControlMargin}">
                        <StackPanel Margin="{StaticResource ControlMargin}">
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="使能" />
                            <ToggleButton Style="{StaticResource Styles.ToggleButton.YESNO}" HorizontalAlignment="Left" IsChecked="{Binding EnableScanErrBigTip}" />
                        </StackPanel>
                    </StackPanel>
                </StackPanel>

            </GroupBox>
        </StackPanel>

    </Grid>
</UserControl>