- Replace sub-nav + HiddenTabsTabControl with 3-column Fluent card layout: PumpCommandsCard (vertical ME/FBKW/PreIn sliders) + DfiCalibrationCard / PumpLiveDataCard (KPI tiles + RPM rolling chart + redesigned status bytes) / PumpIdentificationCard + DtcCard - Add PumpTopStripView: pump selector, model badge, CAN + K-Line chips - Move immobilizer unlock to MainWindow bottom snackbar (UnlockSnackbarView): auto-close on success after 3 s, persist on failure with manual Dismiss - Redesign StatusDisplayView to 2×8 rounded 28px tiles with bit index + tooltip - Add NullToVisibilityConverter; add SnackbarShell, PumpCard, and related styles - Delete obsolete views: UnlockProgressDialog, UnlockPanelView, PumpIdentificationPanelView, PumpLiveDataView, DfiManageView, DtcListView, PumpControlView - PumpPageViewModel: remove PumpSubPage enum, add RpmChart wired to Root.PumpRpm Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
103 lines
6.2 KiB
XML
103 lines
6.2 KiB
XML
<UserControl x:Class="HC_APTBS.Views.UserControls.DtcCard"
|
|
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:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="280" d:DesignWidth="320">
|
|
|
|
<!-- DataContext = DtcListViewModel (via {Binding DtcList}) -->
|
|
<UserControl.Resources>
|
|
<BooleanToVisibilityConverter x:Key="BoolToVis"/>
|
|
</UserControl.Resources>
|
|
|
|
<Border Style="{StaticResource PumpCard}">
|
|
<DockPanel LastChildFill="True">
|
|
|
|
<!-- ── Card header ───────────────────────────────────────────── -->
|
|
<DockPanel DockPanel.Dock="Top" Margin="0,0,0,10">
|
|
<ui:SymbolIcon DockPanel.Dock="Left" Symbol="Warning24" FontSize="16"
|
|
Foreground="{DynamicResource SystemFillColorCautionBrush}"
|
|
Margin="0,0,8,0" VerticalAlignment="Center"/>
|
|
<TextBlock Text="{DynamicResource Pump.Dtcs.Title}"
|
|
Style="{StaticResource PumpCardHeader}" Margin="0"/>
|
|
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal"
|
|
VerticalAlignment="Center" HorizontalAlignment="Right">
|
|
<ui:Button Content="{DynamicResource Dtc.Read}"
|
|
Command="{Binding ReadCommand}"
|
|
Appearance="Secondary"
|
|
Height="28" Margin="0,0,6,0"/>
|
|
<ui:Button Content="{DynamicResource Dtc.Clear}"
|
|
Command="{Binding ClearCommand}"
|
|
Appearance="Secondary"
|
|
Height="28"/>
|
|
</StackPanel>
|
|
</DockPanel>
|
|
|
|
<!-- ── Busy indicator ─────────────────────────────────────────── -->
|
|
<ProgressBar DockPanel.Dock="Top"
|
|
IsIndeterminate="True" Height="3" Margin="0,0,0,6"
|
|
Visibility="{Binding IsBusy, Converter={StaticResource BoolToVis}}"/>
|
|
|
|
<!-- ── Status text ─────────────────────────────────────────────── -->
|
|
<TextBlock DockPanel.Dock="Top"
|
|
Text="{Binding StatusText}"
|
|
FontSize="11"
|
|
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
|
|
Margin="0,0,0,6"/>
|
|
|
|
<!-- ── "No faults" success pill ───────────────────────────────── -->
|
|
<Border DockPanel.Dock="Top"
|
|
Background="{DynamicResource SystemFillColorSuccessBackgroundBrush}"
|
|
BorderBrush="{DynamicResource SystemFillColorSuccessBrush}"
|
|
BorderThickness="1" CornerRadius="6" Padding="10,6"
|
|
HorizontalAlignment="Left" Margin="0,0,0,4"
|
|
Visibility="{Binding IsClear, Converter={StaticResource BoolToVis}}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<ui:SymbolIcon Symbol="CheckmarkCircle24" FontSize="14"
|
|
Foreground="{DynamicResource SystemFillColorSuccessBrush}"
|
|
Margin="0,0,6,0" VerticalAlignment="Center"/>
|
|
<TextBlock Text="{DynamicResource Dtc.NoFaults}"
|
|
FontSize="12" FontWeight="SemiBold"
|
|
Foreground="{DynamicResource SystemFillColorSuccessBrush}"
|
|
VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<!-- ── DTC rows ───────────────────────────────────────────────── -->
|
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
|
<ItemsControl ItemsSource="{Binding Codes}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border Background="{DynamicResource SystemFillColorCautionBackgroundBrush}"
|
|
BorderBrush="{DynamicResource SystemFillColorCautionBrush}"
|
|
BorderThickness="0,0,0,1" CornerRadius="4"
|
|
Padding="8,6" Margin="0,2">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="90"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="{Binding Code}"
|
|
FontFamily="Consolas" FontWeight="Bold"
|
|
FontSize="12"
|
|
Foreground="{DynamicResource SystemFillColorCriticalBrush}"
|
|
VerticalAlignment="Center"/>
|
|
<TextBlock Grid.Column="1"
|
|
Text="{Binding Description}"
|
|
FontSize="12"
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
|
TextWrapping="Wrap"
|
|
VerticalAlignment="Center"/>
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</ScrollViewer>
|
|
|
|
</DockPanel>
|
|
</Border>
|
|
</UserControl>
|