mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Fix to disable inputs when compiling
This commit is contained in:
parent
bf9c315a2f
commit
451dee01b6
29
Wabbajack/Converters/InverseBooleanConverter.cs
Normal file
29
Wabbajack/Converters/InverseBooleanConverter.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Wabbajack
|
||||
{
|
||||
[ValueConversion(typeof(bool), typeof(bool))]
|
||||
public class InverseBooleanConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (targetType != typeof(bool))
|
||||
throw new InvalidOperationException($"The target must be of type bool");
|
||||
return !((bool)value);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (targetType != typeof(bool))
|
||||
throw new InvalidOperationException($"The target must be of type bool");
|
||||
return !((bool)value);
|
||||
}
|
||||
}
|
||||
}
|
@ -10,6 +10,7 @@
|
||||
<!--Converters-->
|
||||
<local:BoolToVisibilityConverter x:Key="bool2VisibilityConverter" />
|
||||
<local:BoolToVisibilityHiddenConverter x:Key="bool2VisibilityHiddenConverter" />
|
||||
<local:InverseBooleanConverter x:Key="InverseBooleanConverter" />
|
||||
<local:IsNotNullVisibilityConverter x:Key="IsNotNullVisibilityConverter"/>
|
||||
|
||||
<!--Colors-->
|
||||
|
@ -30,7 +30,7 @@
|
||||
Margin="5,0,5,5"
|
||||
Background="Transparent"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
IsEnabled="{Binding UIReady}"
|
||||
IsEnabled="{Binding Compiling, Converter={StaticResource InverseBooleanConverter}}"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel
|
||||
Margin="0,20,0,0"
|
||||
|
@ -161,6 +161,7 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="Converters\InverseBooleanConverter.cs" />
|
||||
<Compile Include="Converters\BoolToVisibilityHiddenConverter.cs" />
|
||||
<Compile Include="Views\BeginButton.xaml.cs">
|
||||
<DependentUpon>BeginButton.xaml</DependentUpon>
|
||||
|
Loading…
Reference in New Issue
Block a user