<UserControl x:Class="BPASmartClient.MorkM.View.DebugView"
             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"
              Name="调试界面"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
                <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="400" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Grid Grid.Column="0">
            <!--<Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="40" />
            </Grid.RowDefinitions>-->

            <StackPanel Orientation="Vertical">
                <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
                    <ItemsControl ItemsSource="{Binding simOrderConfig}">
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <Grid Margin="0,10">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock
                                        HorizontalAlignment="Right"
                                        VerticalAlignment="Center"
                                        FontSize="14"
                                        Foreground="#00c2f4"
                                        Text="{Binding Text}" />

                                    <TextBox
                                        Grid.Column="1"
                                        Margin="10,0"
                                        Foreground="#9934F7f7"
                                        Background="Transparent"
                                        BorderBrush="#00c2f4"
                                        CaretBrush="Aqua"
                                        IsEnabled="{Binding IsEnable}"
                                        Text="{Binding Loc}" />

                                    <CheckBox
                                        Grid.Column="2"
                                        Height="20"
                                        VerticalAlignment="Center"
                                        Background="#FF2AB2E7"
                                        Content="启用随机数"
                                        FontSize="14"
                                        Foreground="#00c2f4"
                                        IsChecked="{Binding IsSelected}"
                                        />

                                    <Button
                                        Grid.Column="3"
                                        Margin="10,0,0,0"
                                        Command="{Binding DataContext.EditCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
                                        CommandParameter="{Binding Text}"
                                        Content="编辑"
                                        FontSize="14"
                                         />

                                    <Button
                                        Grid.Column="4"
                                        Margin="5,0,0,0"
                                        Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
                                        CommandParameter="{Binding Text}"
                                        Content="删除"
                                        FontSize="14"
                                         />
                                </Grid>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </ScrollViewer>

                <UniformGrid Grid.Row="1" Columns="2">
                    <Button
                         Margin="10,10,10,0"
                        Command="{Binding AddSimDataCommand}"
                        Content="新增模拟数据"
                       />
                    <Button
                         Margin="10,10,10,0"
                        Grid.Column="1"
                        Command="{Binding SimOrderCommand}"
                        Content="模拟订单" Cursor="Hand"
                        />
                </UniformGrid>
            </StackPanel>
        </Grid>

        <Grid Grid.Column="1" Margin="20,0,0,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="80" />
                <RowDefinition Height="80" />
                <RowDefinition Height="80" />
                <RowDefinition />
            </Grid.RowDefinitions>

            <StackPanel Orientation="Vertical" >

                <!--#region 控制按钮-->
                <Button
                     Margin="0,10,10,0"
                    Command="{Binding InitCommand}"
                    Width="200"
                    VerticalAlignment="Center"
                    HorizontalAlignment="Left"
                    Content="设备初始化" Cursor="Hand"
                    Grid.Row="0"
                    />
                <CheckBox
                 Margin="0,10,0,0"
                Grid.Row="1"
                Height="20"
                VerticalAlignment="Center"
                HorizontalAlignment="Left"
                Background="#FF2AB2E7"
                Content="启用本地模拟程序"
                FontSize="14"
                Foreground="#00c2f4"
                IsChecked="{Binding EnableLocalSimOrder}"
                 />
                <!--<Button
                     Margin="10,5,10,0"
                    Command="{Binding InitCommand}"
                    Content="停止"
                     />-->

                <!--<Button
                    x:Name="button_loop"
                     Margin="10,10,10,0"
                    Command="{Binding LoopSimOrderCommand}"
                    Content="{Binding LoopOrderButtonContent}"
                   />-->
                <!--#endregion-->

            </StackPanel>


        </Grid>

    </Grid>

</UserControl>
