Migrate GUI to CommunityToolkit.Mvvm.

This commit is contained in:
2025-08-20 21:19:43 +01:00
parent f5414ff23d
commit 13ea0d299b
41 changed files with 1519 additions and 3388 deletions

View File

@@ -31,12 +31,12 @@
// ****************************************************************************/
using System.IO;
using System.Reactive;
using System.Reflection;
using System.Windows.Input;
using Aaru.Gui.Views.Dialogs;
using Aaru.Localization;
using CommunityToolkit.Mvvm.Input;
using JetBrains.Annotations;
using ReactiveUI;
namespace Aaru.Gui.ViewModels.Dialogs;
@@ -48,7 +48,7 @@ public sealed class LicenseViewModel : ViewModelBase
public LicenseViewModel(LicenseDialog view)
{
_view = view;
CloseCommand = ReactiveCommand.Create(ExecuteCloseCommand);
CloseCommand = new RelayCommand(Close);
// TODO: Localize
using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Aaru.Gui.LICENSE");
@@ -66,8 +66,8 @@ public sealed class LicenseViewModel : ViewModelBase
[NotNull]
public string CloseLabel => UI.ButtonLabel_Close;
public string LicenseText { get; }
public ReactiveCommand<Unit, Unit> CloseCommand { get; }
public string LicenseText { get; }
public ICommand CloseCommand { get; }
void ExecuteCloseCommand() => _view.Close();
void Close() => _view.Close();
}