78 lines
		
	
	
		
			4.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
		
		
			
		
	
	
			78 lines
		
	
	
		
			4.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
| 
								 | 
							
								<UserControl x:Class="DM_Weight.Views.FridgeWindow"
							 | 
						||
| 
								 | 
							
								             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:DM_Weight.Views"
							 | 
						||
| 
								 | 
							
								             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" 
							 | 
						||
| 
								 | 
							
								             xmlns:rules="clr-namespace:DM_Weight.Common"
							 | 
						||
| 
								 | 
							
								             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
							 | 
						||
| 
								 | 
							
								             xmlns:behavior="clr-namespace:DM_Weight.Commons.ValidatRules;assembly=DM_Weight.Commons"
							 | 
						||
| 
								 | 
							
								             mc:Ignorable="d" 
							 | 
						||
| 
								 | 
							
								             d:DesignHeight="450" d:DesignWidth="800">
							 | 
						||
| 
								 | 
							
								    <i:Interaction.Behaviors>
							 | 
						||
| 
								 | 
							
								        <behavior:ValidationErrorMappingBehavior HasValidationError="{Binding IsInvalid, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
							 | 
						||
| 
								 | 
							
								    </i:Interaction.Behaviors>
							 | 
						||
| 
								 | 
							
								    <Grid Width="400">
							 | 
						||
| 
								 | 
							
								        <Grid.ColumnDefinitions>
							 | 
						||
| 
								 | 
							
								            <ColumnDefinition Width="*"/>
							 | 
						||
| 
								 | 
							
								            <ColumnDefinition Width="2*"/>
							 | 
						||
| 
								 | 
							
								        </Grid.ColumnDefinitions>
							 | 
						||
| 
								 | 
							
								        <Grid.RowDefinitions>
							 | 
						||
| 
								 | 
							
								            <RowDefinition Height="*"/>
							 | 
						||
| 
								 | 
							
								            <RowDefinition Height="1.2*"/>
							 | 
						||
| 
								 | 
							
								            <RowDefinition Height="2*"/>
							 | 
						||
| 
								 | 
							
								            <RowDefinition Height="2*"/>
							 | 
						||
| 
								 | 
							
								            <RowDefinition Height="2*"/>
							 | 
						||
| 
								 | 
							
								            <RowDefinition Height="*"/>
							 | 
						||
| 
								 | 
							
								        </Grid.RowDefinitions>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        <TextBlock Margin="6 0 0 0" Text="冰箱温度区间:" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="14" FontWeight="Bold" />
							 | 
						||
| 
								 | 
							
								        <TextBox Grid.Row="1"
							 | 
						||
| 
								 | 
							
								                Grid.Column="1"
							 | 
						||
| 
								 | 
							
								                materialDesign:HintAssist.Hint="温度区间2-8度以-分隔"
							 | 
						||
| 
								 | 
							
								                Margin="6 0 0 10"
							 | 
						||
| 
								 | 
							
								                Style="{StaticResource MaterialDesignOutlinedTextBox}">
							 | 
						||
| 
								 | 
							
								            <TextBox.Text>
							 | 
						||
| 
								 | 
							
								                <Binding Path="TemperatureRange" Delay="1000" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" NotifyOnValidationError="True">
							 | 
						||
| 
								 | 
							
								                    <Binding.ValidationRules>
							 | 
						||
| 
								 | 
							
								                        <rules:TemperatureRangeRule/>
							 | 
						||
| 
								 | 
							
								                    </Binding.ValidationRules>
							 | 
						||
| 
								 | 
							
								                </Binding>
							 | 
						||
| 
								 | 
							
								            </TextBox.Text>
							 | 
						||
| 
								 | 
							
								        </TextBox>
							 | 
						||
| 
								 | 
							
								        <!--<TextBlock Text="冰箱温度:" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="14" FontWeight="Bold" />
							 | 
						||
| 
								 | 
							
								        <TextBox Grid.Row="1"
							 | 
						||
| 
								 | 
							
								                Grid.Column="1"
							 | 
						||
| 
								 | 
							
								                materialDesign:HintAssist.Hint="保留小数点后一位"
							 | 
						||
| 
								 | 
							
								                Margin="6 10 0 10"
							 | 
						||
| 
								 | 
							
								                Style="{StaticResource MaterialDesignOutlinedTextBox}">
							 | 
						||
| 
								 | 
							
								            <TextBox.Text>
							 | 
						||
| 
								 | 
							
								                <Binding Path="TemperatureValue" Delay="1000" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" NotifyOnValidationError="True">
							 | 
						||
| 
								 | 
							
								                    <Binding.ValidationRules>
							 | 
						||
| 
								 | 
							
								                        <rules:TemperatureRule/>
							 | 
						||
| 
								 | 
							
								                    </Binding.ValidationRules>
							 | 
						||
| 
								 | 
							
								                </Binding>
							 | 
						||
| 
								 | 
							
								            </TextBox.Text>
							 | 
						||
| 
								 | 
							
								        </TextBox>-->
							 | 
						||
| 
								 | 
							
								        <TextBlock Text="冰箱状态:" Margin="0 18 0 0" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="14" FontWeight="Bold" />
							 | 
						||
| 
								 | 
							
								        <ToggleButton Grid.Row="2" Grid.Column="1"  Width="38" Height="38" Margin="6 18 0 0"
							 | 
						||
| 
								 | 
							
								            HorizontalAlignment="Left"
							 | 
						||
| 
								 | 
							
								            x:Name="MaterialDesignFilledTextBoxEnabledComboBox"
							 | 
						||
| 
								 | 
							
								            Style="{StaticResource MaterialDesignActionToggleButton}"
							 | 
						||
| 
								 | 
							
								            IsChecked="{Binding FridgeState}"
							 | 
						||
| 
								 | 
							
								            ToolTip="冰箱状态"
							 | 
						||
| 
								 | 
							
								            Content="打开"
							 | 
						||
| 
								 | 
							
								            materialDesign:ToggleButtonAssist.OnContent="关闭" />
							 | 
						||
| 
								 | 
							
								        <TextBlock Text="报警状态:" Margin="0 18 0 0" Grid.Row="3" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="14" FontWeight="Bold" />
							 | 
						||
| 
								 | 
							
								        <ToggleButton Grid.Row="3" Grid.Column="1"  Width="38" Height="38" Margin="6 18 0 0"
							 | 
						||
| 
								 | 
							
								            HorizontalAlignment="Left"
							 | 
						||
| 
								 | 
							
								            Style="{StaticResource MaterialDesignActionToggleButton}"
							 | 
						||
| 
								 | 
							
								            IsChecked="{Binding AlarmState}"
							 | 
						||
| 
								 | 
							
								            ToolTip="报警状态"
							 | 
						||
| 
								 | 
							
								            Content="打开"
							 | 
						||
| 
								 | 
							
								            materialDesign:ToggleButtonAssist.OnContent="关闭" />
							 | 
						||
| 
								 | 
							
								        <Button Grid.Row="4" Grid.ColumnSpan="2"  Content="保存" Command="{Binding SaveCommand}" IsEnabled="{Binding BtnIsEnable}" />
							 | 
						||
| 
								 | 
							
								    </Grid>
							 | 
						||
| 
								 | 
							
								</UserControl>
							 |