mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Move views and viewmodels to folders.
This commit is contained in:
33
Aaru.Gui/ViewModels/Dialogs/LicenseDialogViewModel.cs
Normal file
33
Aaru.Gui/ViewModels/Dialogs/LicenseDialogViewModel.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.IO;
|
||||
using System.Reactive;
|
||||
using System.Reflection;
|
||||
using Aaru.Gui.Views;
|
||||
using ReactiveUI;
|
||||
|
||||
namespace Aaru.Gui.ViewModels
|
||||
{
|
||||
public class LicenseDialogViewModel : ViewModelBase
|
||||
{
|
||||
readonly LicenseDialog _view;
|
||||
string _versionText;
|
||||
|
||||
public LicenseDialogViewModel(LicenseDialog view)
|
||||
{
|
||||
_view = view;
|
||||
CloseCommand = ReactiveCommand.Create(ExecuteCloseCommand);
|
||||
|
||||
using(Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Aaru.Gui.LICENSE"))
|
||||
using(var reader = new StreamReader(stream))
|
||||
{
|
||||
LicenseText = reader.ReadToEnd();
|
||||
}
|
||||
}
|
||||
|
||||
public string Title => "Aaru's license";
|
||||
public string CloseLabel => "Close";
|
||||
public string LicenseText { get; }
|
||||
public ReactiveCommand<Unit, Unit> CloseCommand { get; }
|
||||
|
||||
void ExecuteCloseCommand() => _view.Close();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user