105 lines
5.0 KiB
XML
105 lines
5.0 KiB
XML
<UserControl x:Class="HC_APTBS.Views.UserControls.DfiManageView"
|
|
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"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="150" d:DesignWidth="800" MaxHeight="150">
|
|
|
|
<UserControl.Resources>
|
|
<Style x:Key="LcdGreen" TargetType="Border">
|
|
<Setter Property="BorderThickness" Value="3"/>
|
|
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
|
<Setter Property="BorderBrush">
|
|
<Setter.Value>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
|
<GradientStop Color="DarkSlateGray" Offset="0"/>
|
|
<GradientStop Color="LawnGreen" Offset="1"/>
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Background">
|
|
<Setter.Value>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
|
<GradientStop Color="LawnGreen" Offset="0"/>
|
|
<GradientStop Color="#57B000" Offset="1.5"/>
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</UserControl.Resources>
|
|
|
|
<Grid Margin="50,0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="75"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="120"/>
|
|
<ColumnDefinition Width="450"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- LEFT: version picker + read/write buttons -->
|
|
<ComboBox Margin="5" VerticalAlignment="Bottom"
|
|
SelectedIndex="{Binding VersionIndex}">
|
|
<ComboBoxItem Content="V1"/>
|
|
<ComboBoxItem Content="V2"/>
|
|
<ComboBoxItem Content="V3"/>
|
|
<ComboBoxItem Content="V4"/>
|
|
</ComboBox>
|
|
|
|
<Grid Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition/>
|
|
</Grid.ColumnDefinitions>
|
|
<Button Content="READ" Margin="2"
|
|
Command="{Binding ReadDfiCommand}"
|
|
FontSize="12" FontWeight="Bold" Padding="4"/>
|
|
<Button Grid.Column="1" Content="WRITE" Margin="2"
|
|
Command="{Binding WriteDfiCommand}"
|
|
FontSize="12" FontWeight="Bold" Padding="4"/>
|
|
</Grid>
|
|
|
|
<!-- TOP RIGHT: DFI value LCD + auto checkbox -->
|
|
<Grid Grid.Row="0" Grid.Column="1" Margin="150,5">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition/>
|
|
</Grid.ColumnDefinitions>
|
|
<Border Grid.ColumnSpan="2" Style="{StaticResource LcdGreen}"/>
|
|
<Border Grid.ColumnSpan="2" BorderThickness="1" BorderBrush="Black" SnapsToDevicePixels="True"/>
|
|
<TextBlock Text="DFI:"
|
|
HorizontalAlignment="Center" VerticalAlignment="Bottom"
|
|
Foreground="Black" FontSize="18" FontFamily="Consolas"/>
|
|
<TextBlock Text="{Binding CurrentDfi, StringFormat=F2, Mode=OneWay}"
|
|
Grid.Column="1"
|
|
HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
FontSize="26" FontWeight="Bold" Foreground="Black"/>
|
|
</Grid>
|
|
|
|
<!-- AUTO checkbox — sits outside the column pair; placed in Column=1 outside normal layout -->
|
|
<CheckBox IsChecked="{Binding IsAutoMode}"
|
|
Content="AUTO"
|
|
Grid.Row="0" Grid.Column="1"
|
|
HorizontalAlignment="Right" VerticalAlignment="Center"
|
|
Margin="0,0,10,0"
|
|
Foreground="Black" FontSize="20"/>
|
|
|
|
<!-- BOTTOM RIGHT: slider with range labels + current value -->
|
|
<Grid Grid.Row="1" Grid.Column="1">
|
|
<Slider Value="{Binding SliderRaw}"
|
|
Minimum="-145" Maximum="145"
|
|
TickFrequency="5" SmallChange="5" LargeChange="5"
|
|
IsSnapToTickEnabled="True" TickPlacement="BottomRight"
|
|
Margin="10,0" VerticalAlignment="Center"
|
|
Foreground="Black"/>
|
|
<TextBlock Text="-1.45" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="10,0,0,0" Foreground="DimGray"/>
|
|
<TextBlock Text="+1.45" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,10,0" Foreground="DimGray"/>
|
|
<TextBlock Text="{Binding SliderDfiValue, StringFormat=F2, Mode=OneWay}"
|
|
HorizontalAlignment="Center" VerticalAlignment="Bottom"
|
|
Margin="0,0,0,4" FontSize="20" Foreground="Black"/>
|
|
</Grid>
|
|
</Grid>
|
|
</UserControl>
|