<local:MyPageRight x:Class="PageOtherTest"
    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"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    PanScroll="{Binding ElementName=PanBack}">
    <local:MyScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" x:Name="PanBack">
        <StackPanel x:Name="PanMain" Margin="25,10" Grid.IsSharedSizeScope="True">
            <local:MyCard Margin="0,15" Title="百宝箱">
                <WrapPanel Margin="25,40,21,5" ItemHeight="50">
                    <local:MyButton MinWidth="100" Text="内存优化" ToolTip="内存优化为 PCL CE 特供版，效果加强！&#xa;&#xa;将物理内存占用降低约 1/3，不仅限于 MC！&#xa;如果使用机械硬盘，这可能会导致一小段时间的严重卡顿。&#xa;使用 --memory 参数启动 PCL 可以静默执行内存优化。" Margin="0,0,15,15" Click="BtnMemory_Click"/>
                    <local:MyButton x:Name="BtnClear" MinWidth="120" Text="清理游戏垃圾" ToolTip="清理 PCL 的缓存与 MC 的日志、崩溃报告等垃圾文件" Margin="0,0,15,15" Click="BtnClear_Click"/>
                    <local:MyButton MinWidth="100" Text="今日人品" Margin="0,0,15,15" Click="BtnLuck_Click"/>
                    <local:MyButton MinWidth="100" Text="崩溃测试" ToolTip="点这个按钮会让启动器直接崩掉，没事别点，造成的一切问题均不受理，相关 issue 会被直接关闭" ColorType="Red" Margin="0,0,15,15" Click="BtnCrash_Click"/>
                    <local:MyButton MinWidth="120" Text="创建快捷方式" ToolTip="创建一个指向 PCL 社区版可执行文件的快捷方式" Margin="0,0,15,15" Click="BtnCreateShortcut_Click"/>
                    <local:MyButton MinWidth="120" Text="查看启动计数" Margin="0,0,15,15" Click="BtnLaunchCount_Click"/>
                </WrapPanel>
            </local:MyCard>
            <local:MyCard Margin="0,0,0,15" Title="下载自定义文件">
                <StackPanel Orientation="Vertical" Margin="25,40,25,20">
                    <TextBlock Text="使用 PCL 的高速多线程下载引擎下载任意文件。请注意，部分网站（例如百度网盘）可能会报错 (403) 已禁止，无法正常下载。" TextWrapping="Wrap"/>
                    <Grid Margin="0,10,0,0">
                        <Grid.Resources>
                            <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource BasedOnTextBlock}">
                                <Setter Property="VerticalAlignment" Value="Center"/>
                                <Setter Property="Margin" Value="0,0,25,0"/>
                                <Setter Property="FontSize" Value="13"/>
                                <Setter Property="Foreground" Value="{DynamicResource ColorBrush1}"/>
                            </Style>
                        </Grid.Resources>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        
                        <TextBlock  Grid.Column="0" Grid.Row="0" Text="下载地址"/>
                        <local:MyTextBox x:Name="TextDownloadUrl" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2" TextChanged="TextDownloadUrl_TextChanged">
                            <local:MyTextBox.ValidateRules>
                                <local:ValidateHttpOrUnc/>
                            </local:MyTextBox.ValidateRules>
                        </local:MyTextBox>
                        
                        <TextBlock Grid.Column="0" Grid.Row="1" Text="User-Agent"/>
                        <local:MyTextBox x:Name="TextUserAgent" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" Margin="0,10"/>
                        
                        <TextBlock Grid.Column="0" Grid.Row="2" Text="保存到"/>
                        <local:MyTextBox x:Name="TextDownloadFolder" Grid.Column="1" Grid.Row="2" Margin="0,10">
                            <local:MyTextBox.ValidateRules>
                                <local:ValidateFolderPath/>
                            </local:MyTextBox.ValidateRules>
                        </local:MyTextBox>
                        <local:MyTextButton Grid.Column="2" Grid.Row="2" Margin="10,0,5,0" VerticalAlignment="Center" Text="选择" Click="MyTextButton_Click"/>

                        <TextBlock  Grid.Column="0" Grid.Row="3" Text="文件名"/>
                        <local:MyTextBox x:Name="TextDownloadName" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2">
                            <local:MyTextBox.ValidateRules>
                                <local:ValidateFileName/>
                            </local:MyTextBox.ValidateRules>
                        </local:MyTextBox>
                    </Grid>
                    <Grid Margin="0,15,0,0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="35"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <local:MyButton x:Name="BtnDownloadStart" Grid.Column="0" Width="140" Text="开始下载" ColorType="Highlight" Margin="0,0,15,0" HorizontalAlignment="Right" Click="BtnDownloadStart_Click"/>
                        <local:MyButton x:Name="BtnDownloadOpen" Grid.Column="1" Width="140" Text="打开文件夹" Margin="0,0,15,0" HorizontalAlignment="Left" Click="BtnDownloadOpen_Click"/>
                    </Grid>
                </StackPanel>
            </local:MyCard>
            <local:MyCard x:Name="CardSkin" Margin="0,0,0,15" Title="下载正版玩家的皮肤">
                <StackPanel Margin="25,40,25,15">
                    <Grid x:Name="PanSkinID" Margin="0,14,0,2">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" SharedSizeGroup="Name" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="正版玩家名" Margin="0,0,25,0" />
                        <local:MyTextBox x:Name="TextSkinID" Grid.Column="1" MaxLength="50" />
                        <Grid Height="35" Grid.Row="1" Grid.ColumnSpan="2" Margin="0,14,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" SharedSizeGroup="Button" />
                                <ColumnDefinition Width="Auto" SharedSizeGroup="Button" />
                            </Grid.ColumnDefinitions>
                            <local:MyButton x:Name="BtnSkinSave" Text="保存皮肤" MinWidth="140" Padding="13,0" Margin="0,0,20,0" Grid.Row="1" />
                        </Grid>
                    </Grid>
                </StackPanel>
            </local:MyCard>
            <local:MyCard Margin="0,0,0,15" Title="瞅眼服务器">
                <local:MinecraftServerQuery Margin="15,40,15,15"/>
            </local:MyCard>
            <local:MyCard Margin="0,0,0,15" Title="自定义成就图片生成器 (仅支持英文)" CanSwap="True" IsSwapped="True">
                <StackPanel Margin="25,30,25,15">
                    <Grid Margin="0,4,0,2">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <TextBlock Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" Text="物品名（ID）" Margin="0,0,25,0" />
                        <local:MyTextBox Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2" x:Name="AchievementBlockTextBox" MaxLength="50" Margin="0,10" >
                            <local:MyTextBox.ValidateRules>
                                <local:ValidateRegex Regex="^[a-z0-9_]+$" ErrorDescription="请输入正确的物品 ID！"/>
                            </local:MyTextBox.ValidateRules>
                        </local:MyTextBox>
                        
                        <TextBlock Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Left" Text="成就名" Margin="0,0,25,0" />
                        <local:MyTextBox Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" x:Name="AchievementTitleTextBox" MaxLength="50">
                            <local:MyTextBox.ValidateRules>
                                <local:ValidateNullOrEmpty/>
                            </local:MyTextBox.ValidateRules>
                        </local:MyTextBox>
                        
                        <TextBlock Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Left" Text="第一行" Margin="0,0,25,0" />
                        <local:MyTextBox Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="2" x:Name="AchievementString1TextBox" MaxLength="50" Margin="0,10">
                            <local:MyTextBox.ValidateRules>
                                <local:ValidateNullOrEmpty/>
                            </local:MyTextBox.ValidateRules>
                        </local:MyTextBox>
                        
                        <TextBlock Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Left" Text="第二行（可选）" Margin="0,0,25,0" />
                        <local:MyTextBox Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2" x:Name="AchievementString2TextBox" MaxLength="50" />
                    </Grid>
                    <Grid Margin="0,15,0,10">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="35"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <local:MyButton x:Name="BtnAchievementPreview" Grid.Column="0" Width="140" Text="预览成就图像" ColorType="Highlight" Margin="0,0,15,0" HorizontalAlignment="Right" Click="BtnAchievementPreview_Click"/>
                        <local:MyButton x:Name="BtnAchievementSave" Grid.Column="1" Width="140" Text="保存图片" Margin="0,0,15,0" HorizontalAlignment="Left" Click="BtnAchievementSave_Click"/>
                    </Grid>
                    <Image x:Name="AchievementImage" Width="320" Height="64" Stretch="Uniform" Visibility="Collapsed"/>
                </StackPanel>
            </local:MyCard>
        </StackPanel>
    </local:MyScrollViewer>
</local:MyPageRight>
