2019-11-09 13:30:36 +00:00
|
|
|
|
using System.Diagnostics;
|
2020-01-19 04:01:51 +00:00
|
|
|
|
using System.Reactive.Disposables;
|
|
|
|
|
using System.Reactive.Linq;
|
2019-11-09 13:30:36 +00:00
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
using MahApps.Metro.Controls;
|
2020-01-19 04:01:51 +00:00
|
|
|
|
using ReactiveUI;
|
2019-11-09 13:30:36 +00:00
|
|
|
|
using Wabbajack.Lib.ModListRegistry;
|
|
|
|
|
|
2019-11-30 09:08:04 +00:00
|
|
|
|
namespace Wabbajack
|
2019-11-09 13:30:36 +00:00
|
|
|
|
{
|
2020-01-19 04:01:51 +00:00
|
|
|
|
public partial class ModListGalleryView : ReactiveUserControl<ModListGalleryVM>
|
2019-11-09 13:30:36 +00:00
|
|
|
|
{
|
|
|
|
|
public ModListGalleryView()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2020-01-19 04:01:51 +00:00
|
|
|
|
|
|
|
|
|
this.WhenActivated(dispose =>
|
|
|
|
|
{
|
|
|
|
|
this.WhenAny(x => x.ViewModel.BackCommand)
|
|
|
|
|
.BindToStrict(this, x => x.BackButton.Command)
|
|
|
|
|
.DisposeWith(dispose);
|
|
|
|
|
this.WhenAny(x => x.ViewModel.ModLists)
|
|
|
|
|
.BindToStrict(this, x => x.ModListGalleryControl.ItemsSource)
|
|
|
|
|
.DisposeWith(dispose);
|
|
|
|
|
this.WhenAny(x => x.ViewModel.ModLists.Count)
|
|
|
|
|
.Select(x => x > 0 ? Visibility.Collapsed : Visibility.Visible)
|
|
|
|
|
.BindToStrict(this, x => x.LoadingRing.Visibility)
|
|
|
|
|
.DisposeWith(dispose);
|
|
|
|
|
});
|
2019-11-09 13:30:36 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|