feat: 重构项目结构,添加 WPF 应用
- 将核心功能提取到 WCTDataMiner.Core 类库 - 添加 WCTDataMiner.Wpf 桌面应用 - 支持数据解析、导出、统计等功能 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
54
src/WCTDataMiner.Wpf/ViewModels/MainViewModel.cs
Normal file
54
src/WCTDataMiner.Wpf/ViewModels/MainViewModel.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
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 };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user