<UserControl x:Class="VIZ.Package.Module.ClockEditPanel"
             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:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="650">
    <Grid VerticalAlignment="Top">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="500"/>
            <ColumnDefinition Width="150"/>


        </Grid.ColumnDefinitions>

        <StackPanel Height="300"  >
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="150"/>
                    <RowDefinition Height="80"/>
                </Grid.RowDefinitions>
                
                <StackPanel Grid.Row="0">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="50" />
                            <RowDefinition Height="50"/>
                        </Grid.RowDefinitions>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="100"/>
                            <ColumnDefinition Width="150"/>
                            <ColumnDefinition Width="100"/>
                            <ColumnDefinition Width="100"/>
                        </Grid.ColumnDefinitions>


                        <dxe:DateEdit x:Name="TimePickerUP" Mask="T" MaskUseAsDisplayFormat="True" Grid.Row="0" Grid.Column="1" Height="30" ShowEditorButtons="False"  Text="{Binding UpTime,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
                            <dxe:DateEdit.StyleSettings>
                                <dxe:DateEditTimePickerStyleSettings/>
                            </dxe:DateEdit.StyleSettings>
                        </dxe:DateEdit>

                        <TextBlock Text="HH:MM:SS" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"  FontSize="13"/>

                        <RadioButton Grid.Row="0" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"  Content="正计时" IsChecked="{Binding RadioUP}" Width="60" FontSize="13" />
                        
                        <CheckBox  Grid.Column="0" Grid.Row="1" Content="停止于" Height="40" IsChecked="{Binding StopIsCheck}" FontSize="13" HorizontalAlignment="Center" VerticalAlignment="Center"/>

                        <dxe:DateEdit x:Name="TimePickerDown" Mask="T" MaskUseAsDisplayFormat="True" Grid.Row="1" Grid.Column="1" Height="30" 
                                      ShowEditorButtons="False" Text="{Binding DownTime,Mode=TwoWay}" Visibility="{Binding IsStopVisibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
                            <dxe:DateEdit.StyleSettings>
                                <dxe:DateEditTimePickerStyleSettings/>
                            </dxe:DateEdit.StyleSettings>
                        </dxe:DateEdit>

                        <TextBlock Text="HH:MM:SS" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"  FontSize="13"  Visibility="{Binding IsStopVisibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>

                        <RadioButton Grid.Row="1" Grid.Column="4" HorizontalAlignment="Center" VerticalAlignment="Center"  Content="倒计时" Width="60" IsChecked="{Binding RadioDown}" FontSize="13" />



                    </Grid>
                </StackPanel>

                <GroupBox Grid.Row="1" Header="Live Control" Height="80" HorizontalAlignment="Center" FontSize="13">

                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="80"/>
                            <ColumnDefinition Width="80"/>
                            <ColumnDefinition Width="80"/>
                            <ColumnDefinition Width="80"/>
                            <ColumnDefinition Width="90"/>
                        </Grid.ColumnDefinitions>

                        <Button Content="START" Height="40" Width="75" Grid.Column="0"  Command="{Binding StartCommand}"/>
                        <Button Content="STOP" Height="40" Width="75"  Grid.Column="1" Command="{Binding StopCommand}"/>
                        <Button Content="CONT" Height="40" Width="75" Grid.Column="2" Command="{Binding ContCommand}"/>
                        <Button Content="FREEZE" Height="40" Width="70"  Grid.Column="3" Command="{Binding FreezeCommand}" Visibility="Hidden"/>
                        <Button Content="UNFREEZE" Height="40"  Grid.Column="4" Command="{Binding UnFreezeCommand}" Visibility="Hidden"/>
                    </Grid>
                    
                </GroupBox>
            </Grid>
        </StackPanel>

        <GroupBox Header="Action" Grid.Column="1" FontSize="13">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>

                <RadioButton Content="无" Grid.Row="0"  IsChecked="{Binding RadioNone}" />
                <RadioButton Content="设置及开始" Grid.Row="1" IsChecked="{Binding RadioSetStart}"/>
                <RadioButton Content="设置及停止" Grid.Row="2" IsChecked="{Binding RadioSetStop}"/>
                <RadioButton Content="停止" Grid.Row="3" IsChecked="{Binding RadioStop}"/>
                <RadioButton Content="继续" Grid.Row="4" IsChecked="{Binding RadioContinue}"/>
                <RadioButton Content="冻结" Grid.Row="5" IsChecked="{Binding RadioFreeze}"/>
                <RadioButton Content="解冻" Grid.Row="6" IsChecked="{Binding RadioUnFreeze}" />

            </Grid>
            
      
        </GroupBox>
    </Grid>
</UserControl>
