20240801_FJEQ_upperpc/FujianEarthquake_seabed_now/FujianEarthquake/Views/UserControls/PowSettingView.xaml
XuMin e0c45efc7d 新增页面:
1 编写参数设置,保护设置,开关设置的界面
2024-09-12 18:55:41 +08:00

122 lines
6.7 KiB
XML

<UserControl x:Class="FujianEarthquake.Views.UserControls.PowSettingView"
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:FujianEarthquake.Views.UserControls"
xmlns:converters="clr-namespace:FujianEarthquake.Common"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:hc="https://handyorg.github.io/handycontrol"
mc:Ignorable="d"
Background="{DynamicResource RegionBrush}"
FontFamily="{StaticResource DigitalDisplay}"
Height="250" Width="420">
<UserControl.Resources>
<converters:BtnConvert x:Key="BtnConvert"/>
<sys:Boolean x:Key="BoolTrue">True</sys:Boolean>
<sys:Boolean x:Key="BoolFalse">False</sys:Boolean>
<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 Width="22" Height="22" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource PrimaryBrush}"
hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right"
VerticalAlignment="Center" Margin="0,0,10,2" Command="hc:ControlCommands.Close"/>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition Height="0.3*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center"
VerticalAlignment="Bottom">
<TextBlock Text="输出开关:" FontSize="18" Foreground="White" Background="Transparent"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Image Source="{Binding OutputState}" Height="30" Width="30" Margin="10,0,0,0"
Stretch="Fill"/>
<Button Name="OutputPowerPicker" HorizontalAlignment="Center" VerticalAlignment="Center"
Width="90" Height="35" Background="Transparent" Margin="10,0,0,0"
BorderThickness="1" BorderBrush="White" Style="{StaticResource ButtonStyle}"
Command="{Binding ShoreBaseStationSwitch}" IsEnabled="{Binding OutputPowerOpenBtnIsEnabled}">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="8"/>
</Style>
</Button.Resources>
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/Images/Start.png" Stretch="Fill" Width="16"
Height="16"/>
<TextBlock Text="打开" Foreground="White" Margin="10,0,0,0" FontSize="14"
VerticalAlignment="Center"/>
</StackPanel>
</Button.Content>
<Button.CommandParameter>
<MultiBinding Converter="{StaticResource ResourceKey=BtnConvert}">
<MultiBinding.Bindings>
<Binding ElementName="OutputPowerPicker" Path="Name"/>
<Binding Source="{StaticResource BoolTrue}"/>
</MultiBinding.Bindings>
</MultiBinding>
</Button.CommandParameter>
</Button>
<Button HorizontalAlignment="Center" VerticalAlignment="Center"
Width="90" Height="35" Background="Transparent" Margin="20,0,0,0"
BorderThickness="1" BorderBrush="White" Style="{StaticResource ButtonStyle}"
Command="{Binding ShoreBaseStationSwitch}" IsEnabled="{Binding OutputPowerCloseBtnIsEnabled}">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="8"/>
</Style>
</Button.Resources>
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/Images/Stop.png" Stretch="Fill" Width="16"
Height="16"/>
<TextBlock Text="关闭" Foreground="White" Margin="10,0,0,0" FontSize="14"
VerticalAlignment="Center" HorizontalAlignment="Center"/>
</StackPanel>
</Button.Content>
<Button.CommandParameter>
<MultiBinding Converter="{StaticResource ResourceKey=BtnConvert}">
<MultiBinding.Bindings>
<Binding ElementName="OutputPowerPicker" Path="Name"/>
<Binding Source="{StaticResource BoolFalse}"/>
</MultiBinding.Bindings>
</MultiBinding>
</Button.CommandParameter>
</Button>
</StackPanel>
</Grid>
</Grid>
</UserControl>