mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
32 lines
940 B
C#
32 lines
940 B
C#
|
using System.Reactive;
|
||
|
using ReactiveUI;
|
||
|
using ReactiveUI.Fody.Helpers;
|
||
|
using Wabbajack.App.Messages;
|
||
|
using Wabbajack.App.Screens;
|
||
|
using Wabbajack.App.ViewModels;
|
||
|
using Wabbajack.DTOs.SavedSettings;
|
||
|
using Wabbajack.Paths;
|
||
|
|
||
|
namespace Wabbajack.App.Controls;
|
||
|
|
||
|
public class InstalledListViewModel : ViewModelBase
|
||
|
{
|
||
|
private readonly InstallationConfigurationSetting _setting;
|
||
|
public AbsolutePath InstallPath => _setting.Install;
|
||
|
|
||
|
public string Name => _setting.Metadata?.Title ?? "";
|
||
|
public ReactiveCommand<Unit, Unit> Play { get; }
|
||
|
|
||
|
public InstalledListViewModel(InstallationConfigurationSetting setting)
|
||
|
{
|
||
|
Activator = new ViewModelActivator();
|
||
|
_setting = setting;
|
||
|
|
||
|
Play = ReactiveCommand.Create(() =>
|
||
|
{
|
||
|
MessageBus.Instance.Send(new ConfigureLauncher(InstallPath));
|
||
|
MessageBus.Instance.Send(new NavigateTo(typeof(LauncherViewModel)));
|
||
|
});
|
||
|
}
|
||
|
|
||
|
}
|