wabbajack/Wabbajack.App.Wpf/Views/ModListGalleryView.xaml

211 lines
9.7 KiB
XML

<rxui:ReactiveUserControl
x:Class="Wabbajack.ModListGalleryView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:local="clr-namespace:Wabbajack"
xmlns:mahapps="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:rxui="http://reactiveui.net"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:ic="clr-namespace:FluentIcons.WPF;assembly=FluentIcons.WPF"
d:DesignHeight="450"
d:DesignWidth="900"
x:TypeArguments="local:ModListGalleryVM"
mc:Ignorable="d">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="3*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="1"
BorderBrush="Transparent"
BorderThickness="0">
<ScrollViewer Background="Transparent" VerticalScrollBarVisibility="Auto">
<ItemsControl
x:Name="ModListGalleryControl"
HorizontalAlignment="Center"
ScrollViewer.VerticalScrollBarVisibility="Visible">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<local:ModListTileView ViewModel="{Binding}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Border>
<mahapps:ProgressRing Grid.Column="1"
x:Name="LoadingRing"
Visibility="Collapsed" />
<StackPanel Grid.Column="1"
x:Name="NoneFound"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Vertical"
Visibility="Collapsed">
<ic:SymbolIcon
Grid.Column="1"
Foreground="{StaticResource Triadic2Brush}"
VerticalAlignment="Top"
Symbol="DismissCircle"
IsFilled="False"
FontSize="72"
/>
<TextBlock
FontSize="24"
Margin="0, 10, 0, 0"
Foreground="{StaticResource ForegroundBrush}"
Text="No modlists matching specified criteria" />
</StackPanel>
<iconPacks:PackIconControl Grid.Row="1"
x:Name="ErrorIcon"
Width="55"
Height="55"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{StaticResource ErrorBrush}"
Kind="{x:Static iconPacks:PackIconMaterialKind.AlertCircle}"
ToolTip="Error loading modlist gallery"
Visibility="Collapsed" />
<!--<local:TopProgressView Grid.Row="0" Grid.RowSpan="2"
Title="Browsing Modlists"
ShadowMargin="False" />-->
<Grid Grid.Row="0"
HorizontalAlignment="Left"
VerticalAlignment="Stretch"
MinWidth="256"
MaxWidth="480"
Height="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<TextBox
x:Name="SearchBox"
FontSize="14"
Height="36"
VerticalContentAlignment="Center"
ToolTip="Search for a game" />
<TextBlock FontSize="14" IsHitTestVisible="False" Text="Search for a modlist..." VerticalAlignment="Center" Margin="5, 0, 0, 0" Foreground="{StaticResource TextBoxDisabledForeground}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger Binding="{Binding Text, ElementName=SearchBox}" Value="">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<Border BorderThickness="0" Padding="5, 0, 5, 0" Background="{StaticResource SecondaryBrush}" HorizontalAlignment="Right">
<ic:SymbolIcon Symbol="Search" HorizontalAlignment="Right" Margin="0, 0, 0, 0" IsFilled="True"/>
</Border>
</Grid>
<ComboBox
Grid.Row="1"
Margin="0, 10, 0, 0"
VerticalAlignment="Center"
FontSize="14"
Foreground="{StaticResource ForegroundBrush}"
ItemsSource="{Binding GameTypeEntries, Mode=TwoWay}"
SelectedItem="{Binding SelectedGameTypeEntry, Mode=TwoWay}"
IsSynchronizedWithCurrentItem="True"
ToolTip="Filter modlists on game">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0, 2, 0, 2">
<Border Width="24" Height="24" BorderThickness="0" CornerRadius="4" VerticalAlignment="Center">
<Border.Background>
<ImageBrush Stretch="Fill" ImageSource="{Binding GameMetaData.IconSource}"/>
</Border.Background>
</Border>
<TextBlock Margin="10, 0, 0, 0" Text="{Binding FormattedName}" VerticalAlignment="Center" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<Grid Grid.Row="2" Margin="0, 10, 0, 0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<CheckBox
x:Name="ShowNSFW"
FontSize="7"
VerticalAlignment="Center"
Foreground="{StaticResource ForegroundBrush}"
ToolTip="Only show Not Safe For Work (NSFW) modlists">
<CheckBox.LayoutTransform>
<ScaleTransform ScaleX="1.6" ScaleY="1.6"/>
</CheckBox.LayoutTransform>
</CheckBox>
<TextBlock Grid.Column="1" Margin="5, 0, 0, 0" Text="Show NSFW modlists" FontSize="14" VerticalAlignment="Center" />
</Grid>
<Grid Grid.Row="3" Margin="0, 10, 0, 0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<CheckBox
x:Name="ShowUnofficialLists"
VerticalAlignment="Center"
Foreground="{StaticResource ForegroundBrush}"
ToolTip="Show modlists from external repositories">
<CheckBox.LayoutTransform>
<ScaleTransform ScaleX="1.6" ScaleY="1.6"/>
</CheckBox.LayoutTransform>
</CheckBox>
<TextBlock Grid.Column="1" Margin="5, 0, 0, 0" Text="Show unofficial modlists" FontSize="14" VerticalAlignment="Center" />
</Grid>
<Grid Grid.Row="4" Margin="0, 10, 0, 0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<CheckBox
x:Name="OnlyInstalledCheckbox"
VerticalAlignment="Center"
Foreground="{StaticResource ForegroundBrush}"
ToolTip="Show only modlists for games you have installed on your PC">
<CheckBox.LayoutTransform>
<ScaleTransform ScaleX="1.6" ScaleY="1.6"/>
</CheckBox.LayoutTransform>
</CheckBox>
<TextBlock Grid.Column="1" Margin="5, 0, 0, 0" Text="Show only modlists for installed games" FontSize="14" VerticalAlignment="Center" />
</Grid>
<Button
x:Name="ClearFiltersButton"
Grid.Row="6"
Style="{StaticResource LargeButtonStyle}"
ToolTip="Reset filters to the default options"
VerticalAlignment="Bottom"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center"
FontSize="14">
<Button.Content>
<StackPanel Orientation="Horizontal">
<ic:SymbolIcon Symbol="FilterDismiss" />
<TextBlock Margin="10, 0, 0, 0">Reset filters</TextBlock>
</StackPanel>
</Button.Content>
</Button>
</Grid>
</Grid>
</rxui:ReactiveUserControl>