2026-07-03 10:47:27 +08:00
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
|
|
|
|
|
|
namespace WCTDataMiner.Wpf.ViewModels;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 主窗口 ViewModel - 导航控制
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class MainViewModel : ObservableObject
|
|
|
|
|
{
|
2026-07-03 10:49:23 +08:00
|
|
|
private readonly ImportViewModel _importViewModel;
|
|
|
|
|
private readonly ScenarioListViewModel _scenarioListViewModel;
|
|
|
|
|
|
2026-07-03 10:47:27 +08:00
|
|
|
[ObservableProperty]
|
|
|
|
|
private ObservableObject _currentView = null!;
|
|
|
|
|
|
|
|
|
|
[ObservableProperty]
|
|
|
|
|
private string? _selectedTxPanel;
|
|
|
|
|
|
|
|
|
|
[ObservableProperty]
|
|
|
|
|
private string? _selectedTxHardware;
|
|
|
|
|
|
|
|
|
|
[ObservableProperty]
|
|
|
|
|
private string? _selectedTxSoftware;
|
|
|
|
|
|
|
|
|
|
[ObservableProperty]
|
|
|
|
|
private string? _selectedRxType;
|
|
|
|
|
|
|
|
|
|
// 筛选选项列表
|
|
|
|
|
public List<string> TxPanels { get; } = new() { "全部", "singleMold", "dualMold" };
|
|
|
|
|
public List<string> TxHardwares { get; } = new() { "全部", "v1.0", "v2.0" };
|
|
|
|
|
public List<string> TxSoftwares { get; } = new() { "全部", "hex2_1", "hex2_2" };
|
|
|
|
|
public List<string> RxTypes { get; } = new() { "全部", "iPhone15", "iPhone16", "Android" };
|
|
|
|
|
|
2026-07-03 10:49:23 +08:00
|
|
|
public MainViewModel(ImportViewModel importViewModel, ScenarioListViewModel scenarioListViewModel)
|
2026-07-03 10:47:27 +08:00
|
|
|
{
|
2026-07-03 10:49:23 +08:00
|
|
|
_importViewModel = importViewModel;
|
|
|
|
|
_scenarioListViewModel = scenarioListViewModel;
|
|
|
|
|
_currentView = _scenarioListViewModel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[RelayCommand]
|
|
|
|
|
private void NavigateToImport()
|
|
|
|
|
{
|
|
|
|
|
CurrentView = _importViewModel;
|
2026-07-03 10:47:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[RelayCommand]
|
|
|
|
|
private void NavigateToScenarios()
|
|
|
|
|
{
|
2026-07-03 10:49:23 +08:00
|
|
|
CurrentView = _scenarioListViewModel;
|
2026-07-03 10:47:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[RelayCommand]
|
|
|
|
|
private void NavigateToPlossChart(int scenarioId)
|
|
|
|
|
{
|
|
|
|
|
CurrentView = new PlossChartViewModel { ScenarioId = scenarioId };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[RelayCommand]
|
|
|
|
|
private void NavigateToQfodChart(int scenarioId)
|
|
|
|
|
{
|
|
|
|
|
CurrentView = new QfodChartViewModel { ScenarioId = scenarioId };
|
|
|
|
|
}
|
2026-07-03 10:49:23 +08:00
|
|
|
}
|