feat: redesign Pump page with Fluent card layout, bottom snackbar, and RPM chart
- 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>
This commit is contained in:
54
Views/UserControls/UnlockSnackbarView.xaml.cs
Normal file
54
Views/UserControls/UnlockSnackbarView.xaml.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Threading;
|
||||
using HC_APTBS.ViewModels.Dialogs;
|
||||
|
||||
namespace HC_APTBS.Views.UserControls
|
||||
{
|
||||
public partial class UnlockSnackbarView : UserControl
|
||||
{
|
||||
private DispatcherTimer? _autoHideTimer;
|
||||
|
||||
public UnlockSnackbarView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContextChanged += OnDataContextChanged;
|
||||
}
|
||||
|
||||
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.OldValue is UnlockProgressViewModel oldVm)
|
||||
oldVm.PropertyChanged -= OnVmPropertyChanged;
|
||||
|
||||
if (e.NewValue is UnlockProgressViewModel newVm)
|
||||
newVm.PropertyChanged += OnVmPropertyChanged;
|
||||
}
|
||||
|
||||
private void OnVmPropertyChanged(object? sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName != nameof(UnlockProgressViewModel.IsSuccess)) return;
|
||||
if (DataContext is not UnlockProgressViewModel vm) return;
|
||||
|
||||
if (vm.IsSuccess == true)
|
||||
{
|
||||
_autoHideTimer?.Stop();
|
||||
_autoHideTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(3) };
|
||||
_autoHideTimer.Tick += (_, _) =>
|
||||
{
|
||||
_autoHideTimer!.Stop();
|
||||
if (vm.CloseCommand.CanExecute(null))
|
||||
vm.CloseCommand.Execute(null);
|
||||
};
|
||||
_autoHideTimer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDismissClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is UnlockProgressViewModel vm && vm.CloseCommand.CanExecute(null))
|
||||
vm.CloseCommand.Execute(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user