2024-04-27 11:50:55 +00:00
|
|
|
|
using System.Reactive.Disposables;
|
|
|
|
|
using System.Reactive.Linq;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using ReactiveUI;
|
2024-05-04 14:25:24 +00:00
|
|
|
|
using ReactiveMarbles.ObservableEvents;
|
|
|
|
|
using System.Reactive;
|
2024-04-27 11:50:55 +00:00
|
|
|
|
|
|
|
|
|
namespace Wabbajack
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaction logic for CreateModListTileView.xaml
|
|
|
|
|
/// </summary>
|
2024-05-19 16:14:47 +00:00
|
|
|
|
public partial class CompiledModListTileView : ReactiveUserControl<CompiledModListTileVM>
|
2024-04-27 11:50:55 +00:00
|
|
|
|
{
|
2024-05-19 16:14:47 +00:00
|
|
|
|
public CompiledModListTileView()
|
2024-04-27 11:50:55 +00:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2024-05-04 14:25:24 +00:00
|
|
|
|
this.WhenActivated(dispose =>
|
2024-04-27 11:50:55 +00:00
|
|
|
|
{
|
2024-04-28 20:21:22 +00:00
|
|
|
|
ViewModel.WhenAnyValue(vm => vm.CompilerSettings.ModListImage)
|
|
|
|
|
.Select(imagePath => { UIUtils.TryGetBitmapImageFromFile(imagePath, out var bitmapImage); return bitmapImage; })
|
2024-04-27 11:50:55 +00:00
|
|
|
|
.BindToStrict(this, v => v.ModlistImage.ImageSource)
|
2024-05-04 14:25:24 +00:00
|
|
|
|
.DisposeWith(dispose);
|
|
|
|
|
|
|
|
|
|
CompiledModListTile
|
|
|
|
|
.Events().MouseDown
|
|
|
|
|
.Select(args => Unit.Default)
|
|
|
|
|
.InvokeCommand(this, x => x.ViewModel.CompileModListCommand)
|
|
|
|
|
.DisposeWith(dispose);
|
2024-04-27 11:50:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ViewModel.WhenAnyValue(x => x.LoadingImageLock.IsLoading)
|
|
|
|
|
.Select(x => x ? Visibility.Visible : Visibility.Collapsed)
|
|
|
|
|
.BindToStrict(this, x => x.LoadingProgress.Visibility)
|
2024-05-04 14:25:24 +00:00
|
|
|
|
.DisposeWith(dispose);
|
2024-04-27 11:50:55 +00:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|