55 lines
1.5 KiB
C#
55 lines
1.5 KiB
C#
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||
|
|
using CommunityToolkit.Mvvm.Input;
|
||
|
|
|
||
|
|
namespace WCTDataMiner.Wpf.ViewModels;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 主窗口 ViewModel - 导航控制
|
||
|
|
/// </summary>
|
||
|
|
public partial class MainViewModel : ObservableObject
|
||
|
|
{
|
||
|
|
[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" };
|
||
|
|
|
||
|
|
public MainViewModel()
|
||
|
|
{
|
||
|
|
_currentView = new ScenarioListViewModel();
|
||
|
|
}
|
||
|
|
|
||
|
|
[RelayCommand]
|
||
|
|
private void NavigateToScenarios()
|
||
|
|
{
|
||
|
|
CurrentView = new ScenarioListViewModel();
|
||
|
|
}
|
||
|
|
|
||
|
|
[RelayCommand]
|
||
|
|
private void NavigateToPlossChart(int scenarioId)
|
||
|
|
{
|
||
|
|
CurrentView = new PlossChartViewModel { ScenarioId = scenarioId };
|
||
|
|
}
|
||
|
|
|
||
|
|
[RelayCommand]
|
||
|
|
private void NavigateToQfodChart(int scenarioId)
|
||
|
|
{
|
||
|
|
CurrentView = new QfodChartViewModel { ScenarioId = scenarioId };
|
||
|
|
}
|
||
|
|
}
|