20240301_JSEQ_upperpc/JiangsuEarthquakeNow/JiangsuEarthquake/Views/UserControls/AlarmSettingView.xaml

130 lines
8.7 KiB
Plaintext
Raw Permalink Normal View History

<UserControl x:Class="JiangsuEarthquake.Views.UserControls.AlarmSettingView"
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:JiangsuEarthquake.Views.UserControls"
mc:Ignorable="d"
xmlns:hc="https://handyorg.github.io/handycontrol"
Background="{DynamicResource RegionBrush}"
FontFamily="{StaticResource DigitalDisplay}"
Height="300" Width="420">
<UserControl.Resources>
<Style TargetType="TextBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox" >
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}" CornerRadius="0"
SnapsToDevicePixels="True">
<ScrollViewer x:Name="PART_ContentHost" Focusable="False"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="4*"/>
</Grid.RowDefinitions>
<TextBlock Text="报 警 设 置" FontSize="20" Foreground="White" Background="Transparent"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
<hc:Divider VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0,0,0,4"
Width="400"/>
<!--<Button Height="30" Width="30" Margin="0,0,5,1" Style="{StaticResource ButtonPrimary}"
hc:IconElement.Geometry="{StaticResource CloseGeometry}" hc:BorderElement.CornerRadius="24"
Background="#E614273A" Foreground="{DynamicResource TextIconBrush}"
HorizontalAlignment="Right" VerticalAlignment="Center" Command="hc:ControlCommands.Close"/>-->
<Button Width="24" Height="24" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource PrimaryBrush}"
hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right"
VerticalAlignment="Center" Margin="0,0,5,2" Command="hc:ControlCommands.Close"/>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition Height="0.3*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="报警参数:" FontSize="17" Foreground="White" Background="Transparent"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
<ComboBox Name="AlarmParaCom" Width="140" FontSize="17" VerticalAlignment="Center"
HorizontalAlignment="Center" Foreground="White" Background="Transparent"
Margin="20,0,0,0" HorizontalContentAlignment="Center"
SelectedItem="{Binding AlarmParaComSelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock Text="报警功能:" FontSize="17" Foreground="White" Background="Transparent"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
<ComboBox Name="AlarmFuncCom" Width="140" FontSize="17" VerticalAlignment="Center"
HorizontalAlignment="Center" Foreground="White" Background="Transparent"
Margin="20,0,0,0" HorizontalContentAlignment="Center" BorderBrush="#50A0A0A0"
SelectedItem="{Binding AlarmFuncComSelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock Text="阈值上限:" FontSize="17" Foreground="White" Background="Transparent"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox Name="AlarmUpTB" Width="140" FontSize="17" VerticalAlignment="Center"
HorizontalAlignment="Center" Foreground="White" Background="Transparent"
Margin="20,0,0,0" HorizontalContentAlignment="Center" BorderThickness="0,0,0,1"
BorderBrush="#50A0A0A0" PreviewTextInput="AlarmUpTB_PreviewTextInput"
InputMethod.IsInputMethodEnabled="False" CaretBrush="White"
Text="{Binding AlarmUpTBText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
<TextBlock Grid.Row="2" Background="Transparent" Foreground="White" HorizontalAlignment="Right"
VerticalAlignment="Center" Text="A / V" FontSize="13" Margin="0,0,45,0"/>
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock Text="阈值下限:" FontSize="17" Foreground="White" Background="Transparent"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox Name="AlarmDownTB" Width="140" FontSize="17" VerticalAlignment="Center"
HorizontalAlignment="Center" Foreground="White" Background="Transparent"
Margin="20,0,0,0" HorizontalContentAlignment="Center" BorderThickness="0,0,0,1"
BorderBrush="#50A0A0A0" PreviewTextInput="AlarmDownTB_PreviewTextInput"
InputMethod.IsInputMethodEnabled="False" CaretBrush="White"
Text="{Binding AlarmDownTBText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
<TextBlock Grid.Row="3" Background="Transparent" Foreground="White" HorizontalAlignment="Right"
VerticalAlignment="Center" Text="A / V" FontSize="13" Margin="0,0,45,0"/>
<Button Name="AlarmSetButton" Grid.Row="4" Width="140" Height="38" Background="#2614273A" Foreground="White"
Content="设 置" FontSize="19" HorizontalAlignment="Center" VerticalAlignment="Bottom"
Command="{Binding AlarmSetButtonCommand}" Margin="15,0,0,0"
IsEnabled="{Binding AlarmSetButtonIsEnabled}" Style="{StaticResource ButtonStyle}">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="8"/>
</Style>
</Button.Resources>
</Button>
<TextBlock Name="AlarmSetMsg" Grid.Row="4" Foreground="Red" Background="Transparent"
HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,5,5"
FontSize="13" Text="{Binding AlarmSetMsg}"/>
<StackPanel Orientation="Vertical" Grid.Row="4" Margin="15,0,0,0" VerticalAlignment="Bottom">
<TextBlock Background="Transparent" Foreground="White" HorizontalAlignment="Left"
VerticalAlignment="Center" Text="电流: 0-20A(↑20%)" FontSize="13" Margin="0,0,0,5"/>
<TextBlock Background="Transparent" Foreground="White" HorizontalAlignment="Left"
VerticalAlignment="Center" Text="电压: 0-100V(↑20%)" FontSize="13" />
</StackPanel>
<TextBlock Name="AlarmSetMessage" Grid.Row="4" Background="Transparent" Foreground="{Binding AlarmSetMessageForeground}" Text="{Binding AlarmSetMessage}"
FontSize="12" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,20,0"
Visibility="{Binding AlarmSetMsgVisibility}"/>
</Grid>
</Grid>
</UserControl>