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

210 lines
10 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="*" />
</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"
Height="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<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"
mahapps:TextBoxHelper.Watermark="Search for a modlist..." />
<Border BorderThickness="0" Width="30" Background="{StaticResource DarkPrimaryBrush}" HorizontalAlignment="Right">
<ic:SymbolIcon Symbol="Search" HorizontalAlignment="Center" IsFilled="True"/>
</Border>
</Grid>
<ComboBox
Grid.Row="1"
Margin="0, 10, 0, 0"
VerticalAlignment="Center"
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, 25, 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.4" ScaleY="1.4"/>
</CheckBox.LayoutTransform>
</CheckBox>
<TextBlock Grid.Column="1" Margin="3, 0, 0, 0" Text="Show unofficial 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="ShowNSFW"
FontSize="7"
VerticalAlignment="Center"
Foreground="{StaticResource ForegroundBrush}"
ToolTip="Only show Not Safe For Work (NSFW) modlists">
<CheckBox.LayoutTransform>
<ScaleTransform ScaleX="1.4" ScaleY="1.4"/>
</CheckBox.LayoutTransform>
</CheckBox>
<TextBlock Grid.Column="1" Margin="3, 0, 0, 0" Text="Show only NSFW 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.4" ScaleY="1.4"/>
</CheckBox.LayoutTransform>
</CheckBox>
<TextBlock Grid.Column="1" Margin="3, 0, 0, 0" Text="Show only modlists for installed games" FontSize="14" VerticalAlignment="Center" />
</Grid>
<Grid Grid.Row="5" Margin="0, 25, 0, 0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.ColumnSpan="2" FontSize="14" Text="Total modlist size"/>
<mahapps:RangeSlider Grid.ColumnSpan="2" Grid.Row="1" Margin="0, 10, 0, 0" x:Name="SizeSliderFilter" MinRangeWidth="3" AutoToolTipPlacement="TopLeft" AutoToolTipPrecision="1" mahapps:SliderHelper.TrackValueFillBrush="{StaticResource PrimaryVariantBrush}" mahapps:SliderHelper.ThumbFillBrush="{StaticResource PrimaryVariantBrush}" mahapps:SliderHelper.ThumbFillHoverBrush="{StaticResource PrimaryBrush}" mahapps:SliderHelper.ThumbFillPressedBrush="{StaticResource PrimaryBrush}"/>
<TextBlock Grid.Row="2" Text="{Binding ElementName=SizeSliderFilter, Path=Minimum, Converter={StaticResource MathConverter}, ConverterParameter='Round(x,1)', StringFormat={}{0} GB}" Foreground="{StaticResource PrimaryVariantBrush}"/>
<TextBlock Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" Text="{Binding ElementName=SizeSliderFilter, Path=Maximum, Converter={StaticResource MathConverter}, ConverterParameter='Round(x,1)', StringFormat={}{0} GB}" Foreground="{StaticResource PrimaryVariantBrush}"/>
</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>