wabbajack/Wabbajack.App/Screens/BrowseView.axaml.cs
2021-10-23 10:51:17 -06:00

39 lines
1.4 KiB
C#

using System.Reactive.Disposables;
using ReactiveUI;
using Wabbajack.App.Views;
namespace Wabbajack.App.Screens;
public partial class BrowseView : ScreenBase<BrowseViewModel>
{
public BrowseView()
{
InitializeComponent();
this.WhenActivated(disposables =>
{
this.OneWayBind(ViewModel, vm => vm.ModLists, view => view.GalleryList.Items)
.DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SearchText, view => view.SearchBox.Text)
.DisposeWith(disposables);
this.OneWayBind(ViewModel, vm => vm.GamesList, view => view.GamesList.Items)
.DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedGame, view => view.GamesList.SelectedItem)
.DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.ResetFiltersCommand, view => view.ClearFiltersButton)
.DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.OnlyInstalledGames, view => view.OnlyInstalledCheckbox.IsChecked)
.DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.OnlyUtilityLists, view => view.ShowUtilityLists.IsChecked)
.DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.ShowNSFW, view => view.ShowNSFW.IsChecked)
.DisposeWith(disposables);
});
}
}