<local:MyScrollViewer x:Class="PageComp"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:PCL"
      mc:Ignorable="d" 
      DataContext="{Binding RelativeSource={RelativeSource Self}}"
      VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
    <local:MyScrollViewer.Resources>
        <BooleanToVisibilityConverter x:Key="VisibilityConverter"/>
    </local:MyScrollViewer.Resources>
    <StackPanel Orientation="Vertical" Margin="25">
        <StackPanel x:Name="PanAlways">
            <local:MySearchBox x:Name="PanSearchBox" Margin="0,0,0,15" HintText="搜索资源" SearchButtonVisibility="Visible"/>
            <local:MyCard Margin="0,0,0,15">
                <Grid Margin="7" HorizontalAlignment="Stretch">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="1.0*"/>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="1.3*" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="1.0*" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="28" />
                        <RowDefinition Height="8" />
                        <RowDefinition Height="28" />
                    </Grid.RowDefinitions>
                    <!--来源-->
                    <TextBlock x:Name="LabSource" VerticalAlignment="Center" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" Text="来源" Margin="5,0,5,0" />
                    <local:MyComboBox x:Name="ComboSearchSource" Grid.Row="0" Grid.Column="1">
                        <local:MyComboBoxItem Content="全部" Tag="3" IsSelected="True" />
                        <local:MyComboBoxItem Content="CurseForge" Tag="1" Visibility="{Binding SupportCurseForge, Converter={StaticResource VisibilityConverter}}"/>
                        <local:MyComboBoxItem Content="Modrinth" Tag="2" Visibility="{Binding SupportModrinth, Converter={StaticResource VisibilityConverter}}"/>
                    </local:MyComboBox>
                    <!--Tags-->
                    <TextBlock x:Name="LabTag" VerticalAlignment="Center" Grid.Column="2" HorizontalAlignment="Left" Text="标签" Margin="5,0,5,0" />
                    <local:MyComboBox x:Name="ComboSearchTag" Grid.Column="3" MaxDropDownHeight="320" />
                    <!--排序方式-->
                    <TextBlock x:Name="LabSort" VerticalAlignment="Center" Grid.Row="0" Grid.Column="4" HorizontalAlignment="Left" Text="排序方式" Margin="5,0,5,0" />
                    <local:MyComboBox x:Name="ComboSearchSort" Grid.Row="0" Grid.Column="5" MaxDropDownHeight="320">
                        <local:MyComboBoxItem Content="默认" Tag="1" IsSelected="True" />
                        <local:MyComboBoxItem Content="相关性" Tag="2" />
                        <local:MyComboBoxItem Content="下载量" Tag="3" />
                        <local:MyComboBoxItem Content="关注量" Tag="4" />
                        <local:MyComboBoxItem Content="最新发布" Tag="5" />
                        <local:MyComboBoxItem Content="最近更新" Tag="6" />
                    </local:MyComboBox>
                    <!--版本-->
                    <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="版本" Margin="5,0,5,0" Grid.Row="2"/>
                    <local:MyComboBox x:Name="TextSearchVersion" Grid.Row="2" Grid.Column="1" IsEditable="True" MaxDropDownHeight="320">
                        <local:MyComboBoxItem Content="任意" IsSelected="True" />
                        <local:MyComboBoxItem Content="1.21.5" />
                        <local:MyComboBoxItem Content="1.21.1" />
                        <local:MyComboBoxItem Content="1.20.6" />
                        <local:MyComboBoxItem Content="1.20.1" />
                        <local:MyComboBoxItem Content="1.19.4" />
                        <local:MyComboBoxItem Content="1.19.2" />
                        <local:MyComboBoxItem Content="1.18.2" />
                        <local:MyComboBoxItem Content="1.16.5" />
                        <local:MyComboBoxItem Content="1.12.2" />
                        <local:MyComboBoxItem Content="1.10.2" />
                        <local:MyComboBoxItem Content="1.8.9" />
                        <local:MyComboBoxItem Content="1.7.10" />
                    </local:MyComboBox>
                    <!--加载器-->
                    <TextBlock x:Name="LabLoader" VerticalAlignment="Center" HorizontalAlignment="Left" Text="加载器" Margin="5,0,5,0" Grid.Row="2" Grid.Column="2"/>
                    <local:MyComboBox x:Name="ComboSearchLoader" Grid.Row="2" Grid.Column="3" MaxDropDownHeight="320">
                        <local:MyComboBoxItem Content="任意" IsSelected="True" Tag="0" />
                        <local:MyComboBoxItem Content="Forge" Tag="1" />
                        <local:MyComboBoxItem Content="NeoForge" Tag="6" />
                        <local:MyComboBoxItem Content="Fabric" Tag="4" />
                        <local:MyComboBoxItem Content="Quilt" Tag="5" />
                    </local:MyComboBox>
                    <local:MyComboBox x:Name="ComboSearchShaderLoader" Visibility="Collapsed" Grid.Row="2" Grid.Column="3" MaxDropDownHeight="320">
                        <local:MyComboBoxItem Content="任意加载器" Tag="" IsSelected="True" />
                        <local:MyComboBoxItem Content="原版可用" Tag="/vanilla" ToolTip="作为资源包加载，可以直接在原版游戏里使用。" />
                        <local:MyComboBoxItem Content="Iris" Tag="/iris" />
                        <local:MyComboBoxItem Content="OptiFine" Tag="/optifine" />
                    </local:MyComboBox>
                    <!--按钮-->
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Column="6">
                        <local:MyIconButton x:Name="BtnSearchReset" Logo="M931.07 384.75a368 368 0 0 0-704 95.25H64l192 192 192-192H288.91C312 333.51 439.12 221.13 592 221.13c169.21 0 306.87 137.66 306.87 306.87S761.21 834.87 592 834.87a307.37 307.37 0 0 1-194.56-69.55 30.57 30.57 0 0 0-38.79 47.25 368.1 368.1 0 0 0 572.42-427.82z"
                                            ToolTip="重置条件" LogoScale="0.9" Margin="3,0,0,0" Grid.Column="1"/>
                        <local:MyIconButton x:Name="BtnSearchInstallModPack" Logo="M955 610h-59c-15 0-29 13-29 29v196c0 15-13 29-29 29h-649c-15 0-29-13-29-29v-196c0-15-13-29-29-29h-59c-15 0-29 13-29 29V905c0 43 35 78 78 78h787c43 0 78-35 78-78V640c0-15-13-29-29-29zM492 740c11 11 29 11 41 0l265-265c11-11 11-29 0-41l-41-41c-11-11-29-11-41 0l-110 110c-11 11-33 3-33-13V68C571 53 555 39 541 39h-59c-15 0-29 13-29 29v417c0 17-21 25-33 13l-110-110c-11-11-29-11-41 0L226 433c-11 11-11 29 0 41L492 740z" Margin="3,0,0,0" Grid.Column="2" Visibility="Collapsed" 
                                            ToolTip="在当前选择的 Minecraft 文件夹下安装整合包" LogoScale="0.9" ToolTipService.HorizontalOffset="-55" ToolTipService.VerticalOffset="5" />
                    </StackPanel>
                </Grid>
            </local:MyCard>
        </StackPanel>
        <StackPanel x:Name="PanContent">
            <local:MyHint x:Name="HintError" HasBorder="True" Text="无法连接到 Modrinth，所以目前仅显示了来自 CurseForge 的内容，搜索结果可能不全。&#xa;请稍后重试，或使用 VPN 以改善网络环境。" Theme="Yellow" Margin="0,0,0,15" />
            <local:MyCard x:Name="CardProjects" UseAnimation="False">
                <StackPanel x:Name="PanProjects" Margin="12" />
            </local:MyCard>
            <local:MyCard Margin="0,15,0,0" x:Name="CardPages" HorizontalAlignment="Center">
                <StackPanel Orientation="Horizontal" Height="23" Margin="10,7">
                    <local:MyIconButton x:Name="BtnPageFirst" IsEnabled="False" Opacity="0.2" Margin="0,0.5,5,0.5"
                        Logo="M496.213333 329.856L315.306667 510.848l180.992 181.077333a42.666667 42.666667 0 1 1-60.330667 60.330667l-211.2-211.2a42.453333 42.453333 0 0 1-11.818667-22.613333l-0.597333-5.034667v-5.034667a42.496 42.496 0 0 1 12.373333-27.648l211.2-211.2a42.666667 42.666667 0 0 1 60.373334 60.330667z m298.666667 0l-180.949333 180.992 180.992 181.077333a42.666667 42.666667 0 1 1-60.330667 60.330667l-211.2-211.2a42.453333 42.453333 0 0 1-11.818667-22.613333l-0.597333-5.034667v-5.034667a42.496 42.496 0 0 1 12.373333-27.648l211.2-211.2a42.666667 42.666667 0 0 1 60.373334 60.330667z" />
                    <local:MyIconButton x:Name="BtnPageLeft" IsEnabled="False" Opacity="0.2" Margin="0,0,5,0"
                        Logo="M650.752 278.357333l-241.322667 241.365334 241.322667 241.365333a42.666667 42.666667 0 1 1-60.330667 60.330667l-271.530666-271.530667a42.453333 42.453333 0 0 1-11.818667-22.613333l-0.597333-5.034667v-5.034667a42.496 42.496 0 0 1 12.416-27.648l271.530666-271.530666a42.666667 42.666667 0 0 1 60.330667 60.330666z" />
                    <TextBlock x:Name="LabPage" Text="1" 
                               Margin="8,0,13,0" FontSize="15" VerticalAlignment="Center" Foreground="{DynamicResource ColorBrush3}" />
                    <local:MyIconButton x:Name="BtnPageRight" Margin="0,0,30,0"
                        Logo="M404.309333 278.357333l241.322667 241.365334-241.322667 241.365333a42.666667 42.666667 0 1 0 60.330667 60.330667l271.530667-271.530667a42.453333 42.453333 0 0 0 11.818666-22.613333l0.597334-5.034667v-5.034667a42.496 42.496 0 0 0-12.416-27.648L464.64 218.026667a42.666667 42.666667 0 0 0-60.330667 60.330666z" />
                </StackPanel>
            </local:MyCard>
        </StackPanel>
        <local:MyCard HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="True" x:Name="PanLoad" UseAnimation="False" Margin="40,50">
            <local:MyLoading Text="正在获取XXX列表" Margin="20,20,20,17" x:Name="Load" HorizontalAlignment="Center" VerticalAlignment="Center" />
        </local:MyCard>
    </StackPanel>
</local:MyScrollViewer>