2026-06-05 13:44:39 +09:00

94 lines
5.1 KiB
XML

<UserControl x:Class="AuroraLaser.Views.UCLaserCompactControl"
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:AuroraLaser.Views"
xmlns:uic="clr-namespace:AuroraUIComponent;assembly=AuroraUIComponent"
xmlns:aurora="clr-namespace:Aurora.View;assembly=Aurora"
xmlns:behavior="http://schemas.microsoft.com/xaml/behaviors" xmlns:usercontrols="clr-namespace:AuroraUIComponent.UserControls;assembly=AuroraUIComponent"
d:DataContext="{d:DesignInstance Type=local:UCLaserCompactControlViewModel}"
mc:Ignorable="d"
d:DesignHeight="220" d:DesignWidth="300"
x:Name="uc" IsEnabled="{Binding IsUCViewEnabled}">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<aurora:SharedResourceDictionary Source="pack://application:,,,/AuroraUIComponent;component/Style/Generic.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="TextBoxBorder" TargetType="Border">
<Setter Property="Background" Value="{StaticResource BLGPurple}"/>
<Setter Property="BorderBrush" Value="#401A69"/>
<Setter Property="BorderThickness" Value="2"/>
<Setter Property="MinHeight" Value="28"/>
</Style>
<Style TargetType="Button" BasedOn="{StaticResource StButtonAccent}">
<Setter Property="MinHeight" Value="30"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontWeight" Value="SemiBold"/>
</Style>
<Style TargetType="TextBlock">
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="FontSize" Value="11.5"/>
<Setter Property="Foreground" Value="{StaticResource BLGLightGray}"/>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<behavior:Interaction.Triggers>
<behavior:PropertyChangedTrigger Binding="{Binding IsVisible, ElementName=uc}">
<behavior:InvokeCommandAction Command="{Binding CMD_VisibleChanged}" CommandParameter="{Binding IsVisible, ElementName=uc}"/>
</behavior:PropertyChangedTrigger>
</behavior:Interaction.Triggers>
<Grid >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<GroupBox Grid.Column="0"
Style="{StaticResource StGBMonitor}" Header="Target Power">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="{Binding LaserTargetPower}" Grid.Column="0" HorizontalAlignment="Right" Margin="10,5,0,0" FontSize="20"/>
<TextBlock Text="%" Grid.Column="1" Margin="10,5,0,0" FontSize="10"/>
</StackPanel>
</GroupBox>
<GroupBox Grid.Column="1"
Style="{StaticResource StGBMonitor}" Header="Actual Power">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="{Binding LaserActualPower}" Grid.Column="0" HorizontalAlignment="Right" Margin="10,5,0,0" FontSize="20"/>
<TextBlock Text="%" Grid.Column="1" Margin="10,5,0,0" FontSize="10"/>
</StackPanel>
</GroupBox>
</Grid>
<Grid Grid.Row="1" Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<usercontrols:UCNumericUpDown KeyText="Laser Power" Unit="W" Value="{Binding ElementName=uc, Path=DataContext.LaserTargetPowerWatt}"
DecimalPlaces="3"/>
<Button Grid.Column="1" Content="Set" Margin="2,2,0,2"
Command="{Binding CMD_LaserPowerWattSet}"/>
<usercontrols:UCNumericUpDown Grid.Row="1" KeyText="Laser Power" Unit="%" Value="{Binding ElementName=uc, Path=DataContext.LaserTargetPower}"
DecimalPlaces="1"/>
<Button Grid.Row="1" Grid.Column="1" Content="Set" Margin="2,2,0,2"
Command="{Binding CMD_LaserPowerSet}"/>
</Grid>
</Grid>
</UserControl>