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(); InitializeComponent();
this.settings = settings; this.settings = settings;
HotkeyControl.SetHotkey(new Infrastructure.Hotkey.HotkeyModel(settings.Hotkey));
HotkeyControl.HotkeyChanged += (_, _) => HotkeyControl.HotkeyChanged += (_, _) =>
{ {
if (HotkeyControl.CurrentHotkeyAvailable) if (HotkeyControl.CurrentHotkeyAvailable)

View file

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