<UserControl x:Class="BOB.Views.Dialogs.IOBoardView"
             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:BOB.Views.Dialogs"
             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             mc:Ignorable="d"
             xmlns:prism="http://prismlibrary.com/"
             Background="White"
             prism:ViewModelLocator.AutoWireViewModel="True"
             Height="850"
             Width="900">
    <prism:Dialog.WindowStyle>
        <Style BasedOn="{StaticResource DialogUserManageStyle}"
               TargetType="Window" />
    </prism:Dialog.WindowStyle>
    <GroupBox Header="IO板卡手动设置"
              Padding="0,0,0,0"
              MouseLeftButtonDown="MouseLeftButtonDown">
        <Grid >
            <TreeView Margin="10">
                <TreeViewItem Header="连接状态设置">
                    <StackPanel Orientation="Horizontal">
                        <Button Content="连接"
                                Margin="5"
                                Command="{Binding ConnectCommand}" />
                        <Button Content="断开"
                                Margin="5"
                                Command="{Binding DisconnectCommand}" />
                    </StackPanel>
                </TreeViewItem>
                <TreeViewItem Header="输出">
                    <TreeViewItem Header="单通道设置">
                        <StackPanel Orientation="Horizontal">
                            <Button Content="开"
                                    Margin="5"
                                    Command="{Binding PowerOnCommand}" />
                            <Button Content="关"
                                    Margin="5"
                                    Command="{Binding PowerOffCommand}" />
                            <Label Content="输出地址"
                                   Margin="5"
                                   VerticalContentAlignment="Center" />
                            <ComboBox SelectedItem="{Binding SelectedAddress, Mode=TwoWay}"
                                      ItemsSource="{Binding AddressList}"
                                      materialDesign:HintAssist.Hint=""
                                      MinWidth="100"
                                      Margin="5"
                                      VerticalContentAlignment="Center" />
                        </StackPanel>
                    </TreeViewItem>
                    <TreeViewItem Header="全通道设置">
                        <StackPanel>
                            <Label Content="偏移"
                                   Margin="5"
                                   VerticalContentAlignment="Center" />
                            <TextBox Text="{Binding Offset}"
                                     MinWidth="100"
                                     Margin="5"
                                     materialDesign:HintAssist.Hint=""
                                     VerticalContentAlignment="Center" />
                            <Label Content="状态"
                                   Margin="5"
                                   VerticalContentAlignment="Center" />
                            <TextBox Text="{Binding BatchWriteStatus}"
                                     MinWidth="100"
                                     Margin="5"
                                     materialDesign:HintAssist.Hint=""
                                     VerticalContentAlignment="Center" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Button Content="设置"
                                    Margin="5"
                                    Command="{Binding SetCommand}" />
                            <Button Content="读取"
                                    Margin="5"
                                    Command="{Binding ReadCommand}" />
                        </StackPanel>
                    </TreeViewItem>
                </TreeViewItem>
            </TreeView>
            <StackPanel Grid.Row="2"
                        VerticalAlignment="Bottom">
                <Button Content="关闭"
                        Width="70"
                        Margin="10"
                        HorizontalAlignment="Right"
                        Command="{Binding CloseCommand}" />
            </StackPanel>
        </Grid>
    </GroupBox>
</UserControl>
