Replace ReactiveUI
This commit is contained in:
parent
43b4d50e43
commit
5584ab4ec8
41 changed files with 472 additions and 1013 deletions
|
|
@ -2,33 +2,28 @@ using System.Reactive;
|
|||
|
||||
using Avalonia.Platform.Storage;
|
||||
|
||||
using Dock.Model.ReactiveUI.Controls;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
|
||||
using Dock.Model.Mvvm.Controls;
|
||||
|
||||
using InkForge.Desktop.Managers;
|
||||
using InkForge.Desktop.Services;
|
||||
|
||||
using ReactiveUI;
|
||||
|
||||
namespace InkForge.Desktop.ViewModels.Documents;
|
||||
|
||||
public class WelcomePageDocumentViewModel : Document
|
||||
public partial class WelcomePageDocumentViewModel : Document
|
||||
{
|
||||
private readonly WorkspaceManager _workspaceController;
|
||||
|
||||
public ReactiveCommand<Unit, Unit> CreateNew { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> OpenNew { get; }
|
||||
|
||||
public WelcomePageDocumentViewModel(WorkspaceManager workspaceController)
|
||||
{
|
||||
CanClose = false;
|
||||
Title = "Welcome";
|
||||
|
||||
_workspaceController = workspaceController;
|
||||
CreateNew = ReactiveCommand.CreateFromTask(OnCreateNew);
|
||||
OpenNew = ReactiveCommand.CreateFromTask(OnOpenNew);
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private async Task OnCreateNew()
|
||||
{
|
||||
var storageProvider = this.GetStorageProvider()!;
|
||||
|
|
@ -56,6 +51,7 @@ public class WelcomePageDocumentViewModel : Document
|
|||
await _workspaceController.OpenWorkspace(filePath, true);
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private async Task OnOpenNew()
|
||||
{
|
||||
var storageProvider = this.GetStorageProvider()!;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue