<UserControl x:Class="BOB.Views.Dialogs.EAEL9080View"
             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:oxy="http://oxyplot.org/wpf"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             mc:Ignorable="d"
             xmlns:prism="http://prismlibrary.com/"
             xmlns:oxy1="clr-namespace:OxyPlot.Wpf;assembly=OxyPlot.Wpf"
             xmlns:ucs="clr-namespace:BOB.Views.UserControls"
             prism:ViewModelLocator.AutoWireViewModel="True"
             Background="White"
             Height="850"
             Width="900"
            >
    <prism:Dialog.WindowStyle>
        <Style BasedOn="{StaticResource DialogUserManageStyle}"
               TargetType="Window" />
    </prism:Dialog.WindowStyle>
    <Grid  MouseLeftButtonDown="MouseLeftButtonDown">
        <Grid.RowDefinitions>
            <RowDefinition Height="220" />
            <RowDefinition />
            <RowDefinition Height="350" />
        </Grid.RowDefinitions>

        <!-- 实时监控 -->
        <GroupBox x:Name="实时监控区"
                  Header="实时监控"
                  Padding="0,0,0,0">
            <Grid Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <ucs:NumericalDisplay DataContext="{Binding 电压MV,Mode=TwoWay}"
                            Grid.Column="0" />
                <ucs:NumericalDisplay DataContext="{Binding 电流MV,Mode=TwoWay}"
                            Grid.Column="1" />
                <ucs:NumericalDisplay DataContext="{Binding 功率MV,Mode=TwoWay}"
                            Grid.Column="2" />
            </Grid>
        </GroupBox>

        <!-- 实时曲线 -->
        <GroupBox Header="实时曲线"
                  Grid.Row="1"
                  Padding="0,0,0,0">
            <oxy:PlotView Model="{Binding 曲线Model}">
                <oxy:PlotView.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="视图复位"
                                  Command="{Binding ResetViewCommand}" />
                    </ContextMenu>
                </oxy:PlotView.ContextMenu>
            </oxy:PlotView>
        </GroupBox>

        <!-- 调试选项 -->
        <GroupBox Header="调试选项"
                  Grid.Row="2">
            <TreeView Margin="10">
                <TreeViewItem Header="连接状态设置">
                    <StackPanel Orientation="Horizontal">
                        <Button Content="连接"
                                Margin="5"
                                Command="{Binding 连接命令}" />
                        <Button Content="断开"
                                Margin="5"
                                Command="{Binding 断开命令}" />
                    </StackPanel>
                </TreeViewItem>
                <TreeViewItem Header="查询">
                    <TreeViewItem Header="查询设备标识">
                        <StackPanel Orientation="Horizontal">
                            <Button Content="查询设备标识"
                                    Margin="5"
                                    Command="{Binding 查询设备信息命令}" />
                            <Label Content="结果"
                                   Margin="5"
                                   VerticalContentAlignment="Center" />
                            <TextBox Text="{Binding 设备标识字符串}"
                                     MinWidth="100"
                                     materialDesign:HintAssist.Hint="设备标识字符串"
                                     Margin="5"
                                     VerticalContentAlignment="Center" />
                        </StackPanel>
                    </TreeViewItem>
                </TreeViewItem>
                <TreeViewItem Header="设置">
                    <TreeViewItem Header="远程">
                        <Button Content="设置为远程模式"
                                Command="{Binding 设置为远程模式命令}" />
                    </TreeViewItem>
                    <TreeViewItem Header="模式切换">
                        <StackPanel Orientation="Horizontal">
                            <Button Content="负载模式切换"
                                    Command="{Binding 设置负载工作模式命令}"
                                    Margin="5" />
                            <ComboBox MinWidth="200"
                                      ItemsSource="{Binding 负载模式枚举}"
                                      SelectedItem="{Binding 负载模式}"
                                      materialDesign:HintAssist.Hint="负载模式"
                                      Margin="5" />
                        </StackPanel>
                    </TreeViewItem>
                    <TreeViewItem Header="输出">
                        <StackPanel Orientation="Horizontal">
                            <Button Content="开"
                                    Command="{Binding 电源输出开命令}"
                                    Margin="5" />
                            <Button Content="关"
                                    Command="{Binding 电源输出关命令}"
                                    Margin="5" />
                        </StackPanel>
                    </TreeViewItem>
                </TreeViewItem>
            </TreeView>
        </GroupBox>
        <StackPanel Grid.Row="2" VerticalAlignment="Bottom">
            <Button Content="关闭"
                    Width="70"
                    Margin="10"
                    HorizontalAlignment="Right"
                    Command="{Binding 关闭命令}" /> 
        </StackPanel>
    </Grid>
</UserControl>
