feat(wpf): 添加数据导入功能
This commit is contained in:
@@ -8,6 +8,9 @@ namespace WCTDataMiner.Wpf.ViewModels;
|
||||
/// </summary>
|
||||
public partial class MainViewModel : ObservableObject
|
||||
{
|
||||
private readonly ImportViewModel _importViewModel;
|
||||
private readonly ScenarioListViewModel _scenarioListViewModel;
|
||||
|
||||
[ObservableProperty]
|
||||
private ObservableObject _currentView = null!;
|
||||
|
||||
@@ -29,15 +32,23 @@ public partial class MainViewModel : ObservableObject
|
||||
public List<string> TxSoftwares { get; } = new() { "全部", "hex2_1", "hex2_2" };
|
||||
public List<string> RxTypes { get; } = new() { "全部", "iPhone15", "iPhone16", "Android" };
|
||||
|
||||
public MainViewModel()
|
||||
public MainViewModel(ImportViewModel importViewModel, ScenarioListViewModel scenarioListViewModel)
|
||||
{
|
||||
_currentView = new ScenarioListViewModel();
|
||||
_importViewModel = importViewModel;
|
||||
_scenarioListViewModel = scenarioListViewModel;
|
||||
_currentView = _scenarioListViewModel;
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void NavigateToImport()
|
||||
{
|
||||
CurrentView = _importViewModel;
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void NavigateToScenarios()
|
||||
{
|
||||
CurrentView = new ScenarioListViewModel();
|
||||
CurrentView = _scenarioListViewModel;
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
@@ -51,4 +62,4 @@ public partial class MainViewModel : ObservableObject
|
||||
{
|
||||
CurrentView = new QfodChartViewModel { ScenarioId = scenarioId };
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user