2021-10-22 04:28:52 +00:00
|
|
|
using System.Reactive;
|
|
|
|
using ReactiveUI;
|
|
|
|
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 InstalledListViewModel(InstallationConfigurationSetting setting)
|
|
|
|
{
|
|
|
|
Activator = new ViewModelActivator();
|
|
|
|
_setting = setting;
|
|
|
|
|
|
|
|
Play = ReactiveCommand.Create(() =>
|
|
|
|
{
|
|
|
|
MessageBus.Instance.Send(new ConfigureLauncher(InstallPath));
|
|
|
|
MessageBus.Instance.Send(new NavigateTo(typeof(LauncherViewModel)));
|
|
|
|
});
|
|
|
|
}
|
2021-10-23 16:51:17 +00:00
|
|
|
|
|
|
|
public AbsolutePath InstallPath => _setting.Install;
|
|
|
|
|
|
|
|
public string Name => _setting.Metadata?.Title ?? "";
|
|
|
|
public ReactiveCommand<Unit, Unit> Play { get; }
|
2021-10-22 04:28:52 +00:00
|
|
|
}
|