Fix binding on modlist size to work two-way so slider doesn't start at min value

This commit is contained in:
trawzified 2024-02-03 11:46:19 +01:00
parent dd7e25f67d
commit 3a88748e35

View File

@ -63,13 +63,18 @@ namespace Wabbajack
this.BindStrict(ViewModel, vm => vm.ShowUnofficialLists, x => x.ShowUnofficialLists.IsChecked)
.DisposeWith(dispose);
this.WhenAny(x => x.SizeSliderFilter.LowerValue)
.Select(x => x * Math.Pow(1024, 3))
.BindToStrict(ViewModel, vm => vm.MinModlistSize)
this.BindStrict(ViewModel,
vm => vm.MinModlistSize,
view => view.SizeSliderFilter.LowerValue,
(double vmProp) => vmProp / Math.Pow(1024, 3),
(double vProp) => vProp * Math.Pow(1024, 3))
.DisposeWith(dispose);
this.WhenAny(x => x.SizeSliderFilter.UpperValue)
.Select(x => x * Math.Pow(1024, 3))
.BindToStrict(ViewModel, vm => vm.MaxModlistSize)
this.BindStrict(ViewModel,
vm => vm.MaxModlistSize,
view => view.SizeSliderFilter.UpperValue,
(double vmProp) => vmProp / Math.Pow(1024, 3),
(double vProp) => vProp * Math.Pow(1024, 3))
.DisposeWith(dispose);
this.WhenAny(x => x.ViewModel.ClearFiltersCommand)