Fix two binding

This commit is contained in:
Kevin Zhang 2021-12-01 21:02:06 -06:00
parent 05c1466b8b
commit 604393003b
2 changed files with 42 additions and 53 deletions

View file

@ -28,6 +28,7 @@ namespace Flow.Launcher.Resources.Pages
{
InitializeComponent();
this.settings = settings;
HotkeyControl.SetHotkey(new Infrastructure.Hotkey.HotkeyModel(settings.Hotkey));
HotkeyControl.HotkeyChanged += (_, _) =>
{
if (HotkeyControl.CurrentHotkeyAvailable)

View file

@ -1,15 +1,15 @@
<Page
x:Class="Flow.Launcher.Resources.Pages.WelcomePage5"
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:local="clr-namespace:Flow.Launcher.Resources.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure"
Title="WelcomePage5"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<Page x:Class="Flow.Launcher.Resources.Pages.WelcomePage5"
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:local="clr-namespace:Flow.Launcher.Resources.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure"
Title="WelcomePage5"
d:DesignHeight="450"
d:DesignWidth="800"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
mc:Ignorable="d">
<Page.Resources>
<Style x:Key="StyleImageFadeIn" TargetType="{x:Type Image}">
<Setter Property="Opacity" Value="0" />
@ -20,10 +20,7 @@
<BeginStoryboard>
<BeginStoryboard.Storyboard>
<Storyboard x:Name="FadeIn">
<DoubleAnimation
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0:0:2">
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:2">
<DoubleAnimation.EasingFunction>
<QuadraticEase EasingMode="EaseOut" />
</DoubleAnimation.EasingFunction>
@ -54,55 +51,46 @@
</Border.Background>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<Image
Name="Logo"
Width="90"
Height="90"
Source="../../images/app.png"
Style="{DynamicResource StyleImageFadeIn}" />
<Image Name="Logo"
Width="90"
Height="90"
Source="../../images/app.png"
Style="{DynamicResource StyleImageFadeIn}" />
</StackPanel>
</Border>
<StackPanel Grid.Row="1" Margin="24,20,24,20">
<StackPanel>
<TextBlock
FontSize="20"
FontWeight="SemiBold"
Text="{DynamicResource Welcome_Page5_Title}" />
<TextBlock
Margin="0,10,0,0"
FontSize="14"
Text="{DynamicResource Welcome_Page5_Text01}"
TextWrapping="WrapWithOverflow" />
<TextBlock FontSize="20" FontWeight="SemiBold" Text="{DynamicResource Welcome_Page5_Title}" />
<TextBlock Margin="0,10,0,0"
FontSize="14"
Text="{DynamicResource Welcome_Page5_Text01}"
TextWrapping="WrapWithOverflow" />
<StackPanel Margin="0,30,0,0" Orientation="Horizontal">
<CheckBox IsChecked="{Binding Settings.HideOnStartup}" Style="{DynamicResource DefaultCheckBoxStyle}" />
<TextBlock
Margin="0,5,0,0"
FontSize="14"
FontWeight="SemiBold"
Text="{DynamicResource hideOnStartup}" />
<TextBlock Margin="0,5,0,0"
FontSize="14"
FontWeight="SemiBold"
Text="{DynamicResource hideOnStartup}" />
</StackPanel>
<StackPanel Margin="0,0,0,0" Orientation="Horizontal">
<CheckBox
Checked="OnAutoStartupChecked"
IsChecked="{Binding Settings.StartFlowLauncherOnSystemStartup}"
Style="{DynamicResource DefaultCheckBoxStyle}"
Unchecked="OnAutoStartupUncheck" />
<TextBlock
Margin="0,5,0,0"
FontSize="14"
FontWeight="SemiBold"
Text="{DynamicResource startFlowLauncherOnSystemStartup}" />
<CheckBox Checked="OnAutoStartupChecked"
IsChecked="{Binding Settings.StartFlowLauncherOnSystemStartup}"
Style="{DynamicResource DefaultCheckBoxStyle}"
Unchecked="OnAutoStartupUncheck" />
<TextBlock Margin="0,5,0,0"
FontSize="14"
FontWeight="SemiBold"
Text="{DynamicResource startFlowLauncherOnSystemStartup}" />
</StackPanel>
<Button
Width="150"
Height="40"
Margin="0,60,0,0"
HorizontalAlignment="Right"
Content="{DynamicResource done}"
Style="{DynamicResource AccentButtonStyle}" />
<Button Width="150"
Height="40"
Margin="0,60,0,0"
HorizontalAlignment="Right"
Content="{DynamicResource done}"
Style="{DynamicResource AccentButtonStyle}" />
</StackPanel>
</StackPanel>