Modified Property grid content swapping to be powered by DataTriggers

This commit is contained in:
Justin Swanson 2019-10-13 15:10:17 -05:00
parent c5a049664a
commit b20d1a3118
3 changed files with 18 additions and 49 deletions

View File

@ -1146,7 +1146,7 @@
</Style>
<Style TargetType="{x:Type Button}">
<Style TargetType="{x:Type Button}" x:Key="MainButtonStyle" >
<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
<Setter Property="Background" Value="{StaticResource ButtonBackground}"/>
<Setter Property="BorderBrush" Value="{StaticResource ButtonBorder}"/>
@ -1187,6 +1187,7 @@
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource MainButtonStyle}" TargetType="{x:Type Button}" />
<!-- ToggleButton-->
<Style TargetType="{x:Type ToggleButton}">

View File

@ -32,17 +32,6 @@ namespace Wabbajack
_state._nexusSiteURL = "https://github.com/wabbajack-tools/wabbajack";
if (mode == RunMode.Compile)
{
this.Slideshow.PropertyCompilerGrid.Visibility = Visibility.Visible;
this.Slideshow.PropertyInstallerGrid.Visibility = Visibility.Hidden;
}
else
{
this.Slideshow.PropertyCompilerGrid.Visibility = Visibility.Hidden;
this.Slideshow.PropertyInstallerGrid.Visibility = Visibility.Visible;
}
new Thread(() =>
{
if (mode == RunMode.Compile)

View File

@ -13,34 +13,7 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- Properties -->
<Grid
Name="PropertyCompilerGrid"
Grid.Row="1"
Grid.Column="0"
Margin="0,0,2,4">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Image
Grid.Row="0"
Margin="0,0,0,4"
Source="{Binding SplashScreenImage}"
Stretch="Fill" />
<Button
Grid.Row="1"
Height="30"
Command="{Binding AppState.OpenModListPropertiesCommand}"
IsEnabled="{Binding AppState.UIReady}">
<TextBlock
FontSize="15"
FontWeight="Bold"
Text="Modlist Properties" />
</Button>
</Grid>
<Grid
Name="PropertyInstallerGrid"
Grid.Row="1"
Grid.Column="0"
Margin="0,0,2,4">
@ -54,17 +27,24 @@
Stretch="Fill" />
<Button
Grid.Row="1"
Height="30"
Command="{Binding AppState.OpenReadmeCommand}">
<TextBlock
FontSize="15"
FontWeight="Bold"
Text="Open README" />
FontSize="15"
FontWeight="Bold">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource MainButtonStyle}">
<Style.Triggers>
<DataTrigger Binding="{Binding AppState.Mode}" Value="{x:Static local:RunMode.Install}">
<Setter Property="Command" Value="{Binding AppState.OpenReadmeCommand}" />
<Setter Property="Content" Value="Open README" />
</DataTrigger>
<DataTrigger Binding="{Binding AppState.Mode}" Value="{x:Static local:RunMode.Compile}">
<Setter Property="Command" Value="{Binding AppState.OpenModListPropertiesCommand}" />
<Setter Property="Content" Value="Modlist Properties" />
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</Grid>
<!-- End Properties -->
<!-- Slideshow -->
<Grid
Grid.Row="1"
Grid.Column="1"
@ -133,6 +113,5 @@
Text="View Nexus Site" />
</Button>
</Grid>
<!-- End Slideshow -->
</Grid>
</UserControl>