<?xml version="1.0" encoding="utf-8"?>
<ui:ContentDialog x:Class="DMS.WPF.Views.Dialogs.HistorySettingsDialog"
             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:HistorySettingsDialogViewModel}"
             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" />
        </Grid.RowDefinitions>
        
        <CheckBox 
            Grid.Row="0"
            Margin="0,10"
            Content="启用历史记录"
            IsChecked="{Binding IsHistoryEnabled}" />
            
        <StackPanel 
            Grid.Row="1"
            Margin="0,10"
            Orientation="Horizontal">
            <TextBlock 
                VerticalAlignment="Center"
                Text="历史记录死区值: " />
            <TextBox 
                Width="100"
                Margin="10,0"
                Text="{Binding HistoryDeadband}" />
            <TextBlock 
                VerticalAlignment="Center"
                Text="(当值变化超过此值时才记录)" />
        </StackPanel>
    </Grid>
</ui:ContentDialog>