143 lines
7.6 KiB
XML
143 lines
7.6 KiB
XML
<UserControl
|
|
x:Class="TuneBossPC.Views.DiagnosticsStrip"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:vm="clr-namespace:TuneBossPC.ViewModels">
|
|
|
|
<UserControl.Resources>
|
|
<BooleanToVisibilityConverter x:Key="BoolToVis" />
|
|
</UserControl.Resources>
|
|
|
|
<Border Background="{StaticResource Surface1Brush}"
|
|
BorderBrush="{StaticResource BorderBrush}"
|
|
BorderThickness="0,1,0,0">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" /> <!-- start/stop button -->
|
|
<ColumnDefinition Width="1" /> <!-- divider -->
|
|
<ColumnDefinition Width="*" /> <!-- gauges -->
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- Start/Stop diagnostics button -->
|
|
<Button Grid.Column="0"
|
|
Width="110"
|
|
BorderThickness="0"
|
|
Background="Transparent"
|
|
Padding="0"
|
|
HorizontalContentAlignment="Stretch"
|
|
VerticalContentAlignment="Stretch"
|
|
Cursor="Hand"
|
|
Command="{Binding ToggleCommand}"
|
|
ToolTip="Start / Stop diagnostics">
|
|
<Grid>
|
|
<!-- Pulses gently while diagnostics is streaming -->
|
|
<Border CornerRadius="0" Margin="0">
|
|
<Border.Style>
|
|
<Style TargetType="Border">
|
|
<Setter Property="Background" Value="{StaticResource StatusGreenBrush}" />
|
|
<Setter Property="Opacity" Value="0" />
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsRunning}" Value="True">
|
|
<DataTrigger.EnterActions>
|
|
<BeginStoryboard x:Name="BlinkSb">
|
|
<Storyboard RepeatBehavior="Forever" AutoReverse="True">
|
|
<DoubleAnimation Storyboard.TargetProperty="Opacity"
|
|
From="0.08" To="0.40"
|
|
Duration="0:0:0.75" />
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</DataTrigger.EnterActions>
|
|
<DataTrigger.ExitActions>
|
|
<StopStoryboard BeginStoryboardName="BlinkSb" />
|
|
</DataTrigger.ExitActions>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Border.Style>
|
|
</Border>
|
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False">
|
|
<Ellipse Width="11" Height="11" HorizontalAlignment="Center" Margin="0,0,0,4">
|
|
<Ellipse.Style>
|
|
<Style TargetType="Ellipse">
|
|
<Setter Property="Fill" Value="{StaticResource TextDisabledBrush}" />
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsRunning}" Value="True">
|
|
<Setter Property="Fill" Value="{StaticResource StatusGreenBrush}" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Ellipse.Style>
|
|
</Ellipse>
|
|
<TextBlock HorizontalAlignment="Center"
|
|
FontFamily="{StaticResource DataFont}"
|
|
FontSize="12">
|
|
<TextBlock.Style>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="Text" Value="START" />
|
|
<Setter Property="Foreground" Value="{StaticResource TextSecondaryBrush}" />
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsRunning}" Value="True">
|
|
<Setter Property="Text" Value="STOP" />
|
|
<Setter Property="Foreground" Value="{StaticResource StatusGreenBrush}" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Button>
|
|
|
|
<!-- Vertical divider -->
|
|
<Border Grid.Column="1"
|
|
Background="{StaticResource BorderBrush}" />
|
|
|
|
<!-- 6 gauge slots -->
|
|
<ItemsControl Grid.Column="2"
|
|
ItemsSource="{Binding Slots}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<UniformGrid Rows="1" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate DataType="{x:Type vm:GaugeSlotViewModel}">
|
|
<Border BorderBrush="{StaticResource BorderBrush}"
|
|
BorderThickness="0,0,1,0">
|
|
<!-- Right-click to change channel -->
|
|
<Border.ContextMenu>
|
|
<ContextMenu Tag="{Binding}">
|
|
<MenuItem Header="Change channel..."
|
|
Click="ChangeChannel_Click"
|
|
Tag="{Binding}" />
|
|
</ContextMenu>
|
|
</Border.ContextMenu>
|
|
<StackPanel VerticalAlignment="Center"
|
|
HorizontalAlignment="Center"
|
|
Margin="4,2">
|
|
<TextBlock Text="{Binding Label}"
|
|
Style="{StaticResource LabelText}"
|
|
FontSize="15"
|
|
HorizontalAlignment="Center"
|
|
Margin="0,0,0,3" />
|
|
<StackPanel Orientation="Horizontal"
|
|
HorizontalAlignment="Center">
|
|
<TextBlock Text="{Binding Value}"
|
|
FontFamily="{StaticResource DataFont}"
|
|
FontSize="46" FontWeight="Bold"
|
|
Foreground="{StaticResource AccentBrush}" />
|
|
<TextBlock Text="{Binding Unit}"
|
|
Style="{StaticResource LabelText}"
|
|
FontSize="15"
|
|
VerticalAlignment="Bottom"
|
|
Margin="4,0,0,2" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</Grid>
|
|
</Border>
|
|
</UserControl>
|