mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-04-12 15:33:32 +08:00
298 lines
16 KiB
XML
298 lines
16 KiB
XML
<UserControl x:Class="MicaSetup.Views.MainPage"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:control="clr-namespace:MicaSetup.Design.Controls"
|
|
xmlns:conv="clr-namespace:MicaSetup.Design.Converters"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:design="clr-namespace:MicaSetup.Design"
|
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
xmlns:local="clr-namespace:MicaSetup.Views"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
d:DesignHeight="400"
|
|
d:DesignWidth="500"
|
|
FontSize="15"
|
|
mc:Ignorable="d">
|
|
<UserControl.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<design:ResourceResourceDictionary />
|
|
</ResourceDictionary.MergedDictionaries>
|
|
<conv:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
|
<conv:BoolToVisibilityConverter x:Key="BoolToVisibilityInvertedConverter" IsInverted="True" />
|
|
</ResourceDictionary>
|
|
</UserControl.Resources>
|
|
<Grid>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<Grid Grid.Row="0" Margin="0,8,0,8">
|
|
<i:Interaction.Behaviors>
|
|
<control:WindowDragMoveBehavior />
|
|
</i:Interaction.Behaviors>
|
|
<Image Width="120"
|
|
Height="120"
|
|
VerticalAlignment="Top"
|
|
RenderOptions.BitmapScalingMode="Fant"
|
|
Source="pack://application:,,,/MicaSetup;component/Resources/Images/Favicon.png">
|
|
<Image.Effect>
|
|
<DropShadowEffect BlurRadius="7"
|
|
Direction="275"
|
|
Opacity="0.2"
|
|
ShadowDepth="2"
|
|
Color="DimGray" />
|
|
</Image.Effect>
|
|
</Image>
|
|
</Grid>
|
|
<TextBlock Grid.Row="1"
|
|
Margin="0,8,0,8"
|
|
HorizontalAlignment="Center"
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
|
Text="BetterGI · 更好的原神" />
|
|
<Button Grid.Row="2"
|
|
Height="38"
|
|
MinWidth="170"
|
|
Margin="0,10,0,0"
|
|
Padding="10,0,10,0"
|
|
HorizontalAlignment="Center"
|
|
Command="{Binding StartInstallCommand}"
|
|
FontSize="16"
|
|
IsEnabled="{Binding CanStart}"
|
|
Style="{StaticResource PrimaryButtonStyle}"
|
|
Visibility="{Binding InstallPathShown, Converter={StaticResource BoolToVisibilityInvertedConverter}}">
|
|
<Button.Content>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Padding="2"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
FontFamily="{StaticResource IcoMoon}"
|
|
FontSize="18"
|
|
Text="{x:Static control:Selection.ContactSencryptionCalls}"
|
|
Visibility="{Binding IsElevated, Converter={StaticResource BoolToVisibilityConverter}}" />
|
|
<TextBlock HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Text="{DynamicResource StartInstall}" />
|
|
</StackPanel>
|
|
</Button.Content>
|
|
</Button>
|
|
</Grid>
|
|
|
|
<!-- Customize Pane1 -->
|
|
<StackPanel Margin="18"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Bottom"
|
|
Orientation="Horizontal"
|
|
Visibility="{Binding InstallPathShown, Converter={StaticResource BoolToVisibilityInvertedConverter}}">
|
|
<CheckBox Content="{DynamicResource HaveReadAndApproved}"
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
|
IsChecked="{Binding LicenseRead, Mode=TwoWay}" />
|
|
<Button Margin="3,0,0,0"
|
|
Padding="0"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Background="Transparent"
|
|
BorderBrush="Transparent"
|
|
Command="{Binding ShowOrHideLincenseInfoCommand}">
|
|
<Button.Content>
|
|
<TextBlock HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Cursor="Hand"
|
|
Foreground="{DynamicResource HighGreenBrush}"
|
|
Text="{DynamicResource UserLicenseAgreement}" />
|
|
</Button.Content>
|
|
</Button>
|
|
</StackPanel>
|
|
|
|
<!-- Customize Pane2 -->
|
|
<StackPanel VerticalAlignment="Bottom"
|
|
d:Visibility="Collapsed"
|
|
Visibility="{Binding InstallPathShown, Converter={StaticResource BoolToVisibilityConverter}}">
|
|
<Grid Margin="18">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0"
|
|
Margin="8,0,0,0"
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
|
Text="{DynamicResource InstallationPath}" />
|
|
<Grid Grid.Row="1" Margin="0,4,0,0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<control:TextBoxEx Grid.Column="0"
|
|
Height="36"
|
|
PlaceholderText="{DynamicResource EnterInstallationPath}"
|
|
Text="{Binding InstallPath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
<Button Grid.Column="1"
|
|
Margin="8,0,0,0"
|
|
Command="{Binding SelectFolderCommand}">
|
|
<Button.Content>
|
|
<TextBlock HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
FontFamily="{StaticResource IcoMoon}"
|
|
FontSize="18"
|
|
Text="{x:Static control:Selection.PublicFolder}" />
|
|
</Button.Content>
|
|
</Button>
|
|
</Grid>
|
|
<Grid Grid.Row="2" Margin="0,16,0,0">
|
|
<Grid>
|
|
<StackPanel HorizontalAlignment="Left"
|
|
VerticalAlignment="Bottom"
|
|
Orientation="Horizontal">
|
|
<CheckBox Margin="0,0,24,0"
|
|
Content="{DynamicResource CustomizeAutoRun}"
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
|
IsChecked="{Binding AutoRun, Mode=TwoWay}"
|
|
Visibility="{Binding IsCustomizeVisiableAutoRun, Converter={StaticResource BoolToVisibilityConverter}}" />
|
|
<CheckBox Content="{DynamicResource CustomizeDesktopShortcut}"
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
|
IsChecked="{Binding DesktopShortcut, Mode=TwoWay}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
<Grid>
|
|
<StackPanel HorizontalAlignment="Right"
|
|
VerticalAlignment="Bottom"
|
|
Orientation="Horizontal">
|
|
<Button Command="{Binding ShowOrHideInstallPathCommand}">
|
|
<Button.Content>
|
|
<TextBlock HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Text="{DynamicResource ButtonCancel}" />
|
|
</Button.Content>
|
|
</Button>
|
|
<Button Margin="8,0,0,0"
|
|
Command="{Binding StartInstallCommand}"
|
|
IsEnabled="{Binding CanStart}"
|
|
Style="{StaticResource PrimaryButtonStyle}">
|
|
<Button.Content>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
FontFamily="{StaticResource IcoMoon}"
|
|
FontSize="18"
|
|
Text="{x:Static control:Selection.ContactSencryptionCalls}"
|
|
Visibility="{Binding IsElevated, Converter={StaticResource BoolToVisibilityConverter}}" />
|
|
<TextBlock HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Text="{DynamicResource StartInstall}" />
|
|
</StackPanel>
|
|
</Button.Content>
|
|
</Button>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</StackPanel>
|
|
|
|
<!-- Customize -->
|
|
<StackPanel Margin="18"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Bottom"
|
|
Orientation="Horizontal"
|
|
Visibility="{Binding InstallPathShown, Converter={StaticResource BoolToVisibilityInvertedConverter}}">
|
|
<Button Padding="0"
|
|
Background="Transparent"
|
|
BorderBrush="Transparent"
|
|
Command="{Binding ShowOrHideInstallPathCommand}"
|
|
Cursor="Hand">
|
|
<Button.Content>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
FontFamily="{StaticResource IcoMoon}"
|
|
FontSize="18"
|
|
Foreground="{DynamicResource HighGreenBrush}"
|
|
Text="{x:Static control:Selection.PublicFolder}" />
|
|
<TextBlock Margin="4,0,0,0"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Foreground="{DynamicResource HighGreenBrush}"
|
|
Text="{DynamicResource Customize}" />
|
|
</StackPanel>
|
|
</Button.Content>
|
|
</Button>
|
|
</StackPanel>
|
|
|
|
<!-- License -->
|
|
<Border Margin="15,0,15,15"
|
|
d:Visibility="Collapsed"
|
|
CornerRadius="4"
|
|
Visibility="{Binding LicenseShown, Converter={StaticResource BoolToVisibilityConverter}}">
|
|
<Border.Background>
|
|
<SolidColorBrush Color="{DynamicResource ApplicationBackgroundColor}" />
|
|
</Border.Background>
|
|
<Border.Effect>
|
|
<DropShadowEffect BlurRadius="5"
|
|
ShadowDepth="0"
|
|
Color="LightGray" />
|
|
</Border.Effect>
|
|
<Border.RenderTransform>
|
|
<TranslateTransform />
|
|
</Border.RenderTransform>
|
|
<Border.Triggers>
|
|
<EventTrigger RoutedEvent="Loaded">
|
|
<BeginStoryboard>
|
|
<BeginStoryboard.Storyboard>
|
|
<Storyboard>
|
|
<ThicknessAnimation Storyboard.TargetProperty="Margin"
|
|
From="15,15,15,15"
|
|
To="15,0,15,15"
|
|
Duration="0:0:0.15" />
|
|
</Storyboard>
|
|
</BeginStoryboard.Storyboard>
|
|
</BeginStoryboard>
|
|
</EventTrigger>
|
|
<EventTrigger RoutedEvent="Loaded">
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation BeginTime="0:0:0.0"
|
|
Storyboard.TargetProperty="Opacity"
|
|
From="0"
|
|
To="1"
|
|
Duration="0:0:0.15">
|
|
<DoubleAnimation.EasingFunction>
|
|
<SineEase EasingMode="EaseOut" />
|
|
</DoubleAnimation.EasingFunction>
|
|
</DoubleAnimation>
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</EventTrigger>
|
|
</Border.Triggers>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="auto" />
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0"
|
|
Margin="0,10,0,0"
|
|
HorizontalAlignment="Center"
|
|
FontSize="15"
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
|
Text="{DynamicResource UserLicenseAgreement}" />
|
|
<control:SmoothScrollViewer Grid.Row="1" Margin="5,18,5,0">
|
|
<TextBlock FontSize="13"
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
|
LineHeight="25"
|
|
Text="{Binding LicenseInfo}"
|
|
TextWrapping="Wrap" />
|
|
</control:SmoothScrollViewer>
|
|
<Button Grid.Row="2"
|
|
Height="30"
|
|
Margin="5"
|
|
Padding="18,0,18,0"
|
|
HorizontalAlignment="Right"
|
|
Command="{Binding ShowOrHideLincenseInfoCommand}"
|
|
Content="{DynamicResource ButtonAgree}"
|
|
Style="{StaticResource PrimaryButtonStyle}" />
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
</UserControl>
|