"Hide ButtonIcons" and "Hide Button Text" when using Old Themes (ie. Brushed...
A simple tabbed application launcher.
Brought to you by:
madproton
This is not really a bug but a reference for users who created their own themes.
The code-behind for "Hide ButtonIcons" and "Hide Button Text" were removed and are now being handled in FavoritesButton.xaml (Themes\xxx\FavoritesButtonstyle.xaml) and TabButton.xaml (Themes\xxx\TabButtonStyle.xaml using DataContext Binding.
Old Themes include the following:
IF you did not manually edit the theme, copy the following files to your theme's directory:
https://sourceforge.net/projects/maxlauncher/upload/MaxLauncher/Old%20Theme%20Files/
IF you manually edited the theme, make the following changes:
1. FavoritesButtonStyle.xaml
From:
<Grid.RowDefinitions>
<RowDefinition Height="{DynamicResource FavoritesButton.ImageHeight}"/>
<RowDefinition x:Name="ButtonTextRowHeight" Height="*"/>
</Grid.RowDefinitions>
<Image
To:
<Grid.RowDefinitions>
<RowDefinition x:Name="ButtonImageHeight" Height="{DynamicResource FavoritesButton.ImageHeight}"/>
<RowDefinition x:Name="ButtonTextRowHeight" Height="*"/>
</Grid.RowDefinitions>
<Image x:Name="ButtonImage"
From:
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsTextVisible}" Value="False">
<Setter Property="Height" TargetName="ButtonTextRowHeight" Value="0" />
</DataTrigger>
To:
<DataTrigger Binding="{Binding DataContext.HideButtonText, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}}" Value="True">
<Setter Property="Visibility" TargetName="ButtonText" Value="Collapsed" />
<Setter Property="Height" TargetName="ButtonTextRowHeight" Value="Auto" />
</DataTrigger>
<DataTrigger Binding="{Binding DataContext.HideButtonIcons, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}}" Value="True">
<Setter Property="Source" TargetName="ButtonImage" Value="{x:Null}" />
<Setter Property="Visibility" TargetName="ButtonImage" Value="Collapsed" />
<Setter Property="Height" TargetName="ButtonImageHeight" Value="Auto" />
</DataTrigger>
2. TabButtonStyle.xaml
From:
<Grid.RowDefinitions>
<RowDefinition Height="{DynamicResource FavoritesButton.ImageHeight}"/>
<RowDefinition x:Name="ButtonTextRowHeight" Height="*"/>
</Grid.RowDefinitions>
<Image
To:
<Grid.RowDefinitions>
<RowDefinition x:Name="ButtonImageHeight" Height="{DynamicResource TabButton.ImageHeight}"/>
<RowDefinition x:Name="ButtonTextRowHeight" Height="*"/>
</Grid.RowDefinitions>
<Image x:Name="ButtonImage"
From:
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsTextVisible}" Value="False">
<Setter Property="Height" TargetName="ButtonTextRowHeight" Value="0" />
</DataTrigger>
To:
<DataTrigger Binding="{Binding DataContext.HideButtonText, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}}" Value="True">
<Setter Property="Visibility" TargetName="ButtonText" Value="Collapsed" />
<Setter Property="Height" TargetName="ButtonTextRowHeight" Value="Auto" />
</DataTrigger>
<DataTrigger Binding="{Binding DataContext.HideButtonIcons, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}}" Value="True">
<Setter Property="Source" TargetName="ButtonImage" Value="{x:Null}" />
<Setter Property="Visibility" TargetName="ButtonImage" Value="Collapsed" />
<Setter Property="Height" TargetName="ButtonImageHeight" Value="Auto" />
</DataTrigger>