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:
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-->
|
<!--Converters-->
|
||||||
<local:BoolToVisibilityConverter x:Key="bool2VisibilityConverter" />
|
<local:BoolToVisibilityConverter x:Key="bool2VisibilityConverter" />
|
||||||
<local:BoolToVisibilityHiddenConverter x:Key="bool2VisibilityHiddenConverter" />
|
<local:BoolToVisibilityHiddenConverter x:Key="bool2VisibilityHiddenConverter" />
|
||||||
|
<local:InverseBooleanConverter x:Key="InverseBooleanConverter" />
|
||||||
<local:IsNotNullVisibilityConverter x:Key="IsNotNullVisibilityConverter"/>
|
<local:IsNotNullVisibilityConverter x:Key="IsNotNullVisibilityConverter"/>
|
||||||
|
|
||||||
<!--Colors-->
|
<!--Colors-->
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
Margin="5,0,5,5"
|
Margin="5,0,5,5"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
HorizontalScrollBarVisibility="Disabled"
|
HorizontalScrollBarVisibility="Disabled"
|
||||||
IsEnabled="{Binding UIReady}"
|
IsEnabled="{Binding Compiling, Converter={StaticResource InverseBooleanConverter}}"
|
||||||
VerticalScrollBarVisibility="Auto">
|
VerticalScrollBarVisibility="Auto">
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Margin="0,20,0,0"
|
Margin="0,20,0,0"
|
||||||
|
@ -161,6 +161,7 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
|
<Compile Include="Converters\InverseBooleanConverter.cs" />
|
||||||
<Compile Include="Converters\BoolToVisibilityHiddenConverter.cs" />
|
<Compile Include="Converters\BoolToVisibilityHiddenConverter.cs" />
|
||||||
<Compile Include="Views\BeginButton.xaml.cs">
|
<Compile Include="Views\BeginButton.xaml.cs">
|
||||||
<DependentUpon>BeginButton.xaml</DependentUpon>
|
<DependentUpon>BeginButton.xaml</DependentUpon>
|
||||||
|
Reference in New Issue
Block a user