wabbajack/Wabbajack.App/Screens/SettingsView.axaml.cs

43 lines
1.5 KiB
C#
Raw Normal View History

using System.Reactive.Disposables;
using Avalonia.Interactivity;
using ReactiveUI;
using Wabbajack.App.Views;
using Wabbajack.Common;
2021-10-23 16:51:17 +00:00
namespace Wabbajack.App.Screens;
public partial class SettingsView : ScreenBase<SettingsViewModel>
{
2021-11-04 13:01:48 +00:00
public SettingsView() : base("Settings")
{
2021-10-23 16:51:17 +00:00
InitializeComponent();
this.WhenActivated(disposables =>
{
2021-10-23 16:51:17 +00:00
this.BindCommand(ViewModel, vm => vm.NexusLogin, view => view.NexusLogIn)
.DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.NexusLogout, view => view.NexusLogOut)
.DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.LoversLabLogin, view => view.LoversLabLogIn)
2021-11-09 22:40:21 +00:00
.DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.LoversLabLogout, view => view.LoversLabLogOut)
.DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.VectorPlexusLogin, view => view.VectorPlexusLogIn)
.DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.VectorPlexusLogout, view => view.VectorPlexusLogOut)
.DisposeWith(disposables);
this.OneWayBind(ViewModel, vm => vm.Resources, view => view.ResourcesList.Items)
.DisposeWith(disposables);
2021-10-23 16:51:17 +00:00
});
}
private void SaveSettingsAndRestart(object? sender, RoutedEventArgs e)
{
ViewModel!.SaveResourceSettingsAndRestart().FireAndForget();
}
}