You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
523 B
21 lines
523 B
using System;
|
|
using ReactiveUI;
|
|
|
|
namespace MyAvaloniaApp.ViewModels;
|
|
|
|
/// <summary>
|
|
/// 应用程序级别的 ViewModel,实现 IScreen 接口
|
|
/// </summary>
|
|
public class AppViewModel : ReactiveObject, IScreen
|
|
{
|
|
public RoutingState Router { get; }
|
|
|
|
public MainWindowViewModel MainWindowViewModel { get; }
|
|
|
|
public AppViewModel()
|
|
{
|
|
Router = new RoutingState();
|
|
// 先创建 MainWindowViewModel,传入自身作为 IScreen
|
|
MainWindowViewModel = new MainWindowViewModel(this);
|
|
}
|
|
}
|
|
|