<UserControl x:Class="MonitorModule.Views.Dialogs.ValueLimitView"
                       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:MonitorModule.Views.Dialogs"
             xmlns:oxy="http://oxyplot.org/wpf"
             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             mc:Ignorable="d"
             xmlns:prism="http://prismlibrary.com/"
             xmlns:cons="clr-namespace:UIShare.Converters;assembly=UIShare"
             Background="White"
             prism:ViewModelLocator.AutoWireViewModel="True"
             Height="500"
             Width="900">
    <prism:Dialog.WindowStyle>
        <Style BasedOn="{StaticResource DialogUserManageStyle}"
               TargetType="Window" />
    </prism:Dialog.WindowStyle>
    <GroupBox Padding="0,0,0,0"
              MouseLeftButtonDown="MouseLeftButtonDown">
        <GroupBox.Header>
            <Grid  Margin="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <TextBlock Text="上下限设置"
                           Foreground="White"
                           VerticalAlignment="Center"
                           Margin="5,0,10,0" />
                <Button Content="关闭"
                        Grid.Column="2"
                        Margin="150 0 0 0"
                        Width="60"
                        Command="{Binding CloseCommand}"
                        Height="25" />

            </Grid>
        </GroupBox.Header>
        <Grid Margin="10">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <DataGrid SelectedItem="{Binding SelectValueLimitVM}"
                      SelectionUnit="FullRow"
                      AutoGenerateColumns="False"
                      CanUserAddRows="False"
                      IsReadOnly="False"
                      ItemsSource="{Binding ValueLimitList}"
                      Margin="0,0,0,10">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="信号名"
                                        Binding="{Binding SignalName}"
                                        Width="auto" />
                    <DataGridTextColumn Header="上限"
                                        Binding="{Binding Upper, Mode=TwoWay}"
                                        Width="auto" />
                    <DataGridTextColumn Header="下限"
                                        Binding="{Binding Lower, Mode=TwoWay}"
                                        Width="auto" />
                    <DataGridTextColumn Header="上极限"
                                        Binding="{Binding UpperExtreme, Mode=TwoWay}"
                                        Width="auto" />
                    <DataGridTextColumn Header="下极限"
                                        Binding="{Binding LowerExtreme, Mode=TwoWay}"
                                        Width="auto" />
                    <DataGridTextColumn Header="报警状态"
                                        Binding="{Binding AlarmSatus}"
                                        Width="auto" />

                </DataGrid.Columns>
                <!--<DataGrid.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="删除"
                                  Foreground="Red"
                                  Command="{Binding DeleteCommand}" />
                    </ContextMenu>
                </DataGrid.ContextMenu>-->
            </DataGrid>
            <!--<StackPanel Grid.Row="1"
                        Orientation="Horizontal"
                        HorizontalAlignment="Left"
                        Margin="0,10,0,0">
                <Label Content="待添加监控值"
                       VerticalAlignment="Center" />
                <ComboBox  ItemsSource="{Binding DeviceSingleList}"
                           SelectedItem="{Binding SelectCurve}"
                           materialDesign:HintAssist.Hint=""
                           MinWidth="130"
                           VerticalAlignment="Center" />
                <Button Content="添加"
                        Margin="10,0,10,0"
                        Command="{Binding SelectSignalCommand}" />
            </StackPanel>-->
            <StackPanel Grid.Row="1"
                        Orientation="Horizontal"
                        HorizontalAlignment="Right"
                        Margin="0,10,0,0">
                <Button Content="保存"
                        Width="80"
                        Margin="0,0,10,0"
                        Command="{Binding SaveCommand}" />
            </StackPanel>
        </Grid>
    </GroupBox>
</UserControl>