<?xml version="1.0" encoding="utf-8"?>
<ui:ContentDialog x:Class="DMS.WPF.Views.Dialogs.AlarmSettingsDialog"
             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:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
             xmlns:valueConverts="clr-namespace:DMS.WPF.ValueConverts"
             xmlns:vmd="clr-namespace:DMS.WPF.ViewModels.Dialogs"
             mc:Ignorable="d" 
             d:DataContext="{d:DesignInstance vmd:AlarmSettingsDialogViewModel}"
             Title="{Binding Title}"
             PrimaryButtonText="{Binding PrimaryButText}"
             CloseButtonText="取消"
             PrimaryButtonCommand="{Binding PrimaryButtonCommand}"
             CloseButtonCommand="{Binding CancleButtonCommand}">
    <ui:ContentDialog.Resources>
        <valueConverts:EnumDescriptionConverter x:Key="EnumDescriptionConverter" />
    </ui:ContentDialog.Resources>
    <Grid Margin="20">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <CheckBox 
            Grid.Row="0"
            Margin="0,10"
            Content="启用报警"
            IsChecked="{Binding IsAlarmEnabled}" />
            
        <StackPanel 
            Grid.Row="1"
            Margin="0,10"
            Orientation="Horizontal">
            <TextBlock 
                VerticalAlignment="Center"
                Text="报警最小值: " />
            <TextBox 
                Width="100"
                Margin="10,0"
                Text="{Binding AlarmMinValue}" />
        </StackPanel>
        
        <StackPanel 
            Grid.Row="2"
            Margin="0,10"
            Orientation="Horizontal">
            <TextBlock 
                VerticalAlignment="Center"
                Text="报警最大值: " />
            <TextBox 
                Width="100"
                Margin="10,0"
                Text="{Binding AlarmMaxValue}" />
        </StackPanel>
        
        <TextBlock 
            Grid.Row="3"
            Margin="0,10"
            FontStyle="Italic"
            Text="注意：最小值应小于最大值，否则可能导致报警异常" />
    </Grid>
</ui:ContentDialog>