TRX/tools/installer/TRX_InstallerLib/Models/InstallSettingsStep.cs
lahm86 e16fcda94b tools/installer: create common installer library
This creates a generic common installer WPF library for both games.
2025-03-30 12:34:54 +01:00

37 lines
1.1 KiB
C#

using System.Windows.Input;
using TRX_InstallerLib.Utils;
namespace TRX_InstallerLib.Models;
public class InstallSettingsStep : BaseNotifyPropertyChanged, IStep
{
public InstallSettingsStep(InstallSettings installSettings)
{
InstallSettings = installSettings;
InstallSettings.PropertyChanged += (sender, e) =>
{
NotifyPropertyChanged(nameof(CanProceedToNextStep));
};
}
public bool CanProceedToNextStep => InstallSettings.TargetDirectory != null;
public bool CanProceedToPreviousStep => true;
public InstallSettings InstallSettings { get; }
public string SidebarImage => AssemblyUtils.GetEmbeddedResourcePath("side2.jpg");
private RelayCommand? _chooseLocationCommand;
public ICommand ChooseLocationCommand
{
get => _chooseLocationCommand ??= new RelayCommand(ChooseLocation);
}
private void ChooseLocation()
{
var result = FileBrowser.Browse(InstallSettings.TargetDirectory);
if (result is not null)
{
InstallSettings.TargetDirectory = result;
}
}
}