|
3 | 3 | x:Class="Files.App.Views.Settings.AdvancedPage"
|
4 | 4 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
5 | 5 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
| 6 | + xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters" |
6 | 7 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
7 | 8 | xmlns:helpers="using:Files.App.Helpers"
|
8 | 9 | xmlns:i="using:Microsoft.Xaml.Interactivity"
|
|
13 | 14 | mc:Ignorable="d">
|
14 | 15 |
|
15 | 16 | <Page.Resources>
|
16 |
| - <ResourceDictionary Source="/ResourceDictionaries/RightAlignedToggleSwitchStyle.xaml" /> |
| 17 | + <ResourceDictionary> |
| 18 | + <ResourceDictionary.MergedDictionaries> |
| 19 | + <ResourceDictionary Source="/ResourceDictionaries/RightAlignedToggleSwitchStyle.xaml" /> |
| 20 | + </ResourceDictionary.MergedDictionaries> |
| 21 | + |
| 22 | + <converters:BoolNegationConverter x:Key="BoolNegationConverter" /> |
| 23 | + </ResourceDictionary> |
17 | 24 | </Page.Resources>
|
18 | 25 |
|
19 | 26 | <Page.DataContext>
|
|
81 | 88 | </local:SettingsBlockControl>
|
82 | 89 |
|
83 | 90 | <!-- Open on Windows startup -->
|
84 |
| - <local:SettingsBlockControl Title="{helpers:ResourceString Name=SettingsOpenInLogin}" HorizontalAlignment="Stretch"> |
85 |
| - <local:SettingsBlockControl.Icon> |
86 |
| - <FontIcon Glyph="" /> |
87 |
| - </local:SettingsBlockControl.Icon> |
88 |
| - <ToggleSwitch |
89 |
| - AutomationProperties.Name="{helpers:ResourceString Name=SettingsOpenInLogin}" |
90 |
| - IsEnabled="{x:Bind ViewModel.CanOpenOnWindowsStartup, Mode=OneWay}" |
91 |
| - IsOn="{x:Bind ViewModel.OpenOnWindowsStartup, Mode=TwoWay}" |
92 |
| - Style="{StaticResource RightAlignedToggleSwitchStyle}"> |
93 |
| - <i:Interaction.Behaviors> |
94 |
| - <icore:EventTriggerBehavior EventName="Toggled"> |
95 |
| - <icore:InvokeCommandAction Command="{x:Bind ViewModel.OpenFilesOnWindowsStartupCommand, Mode=OneWay}" /> |
96 |
| - </icore:EventTriggerBehavior> |
97 |
| - </i:Interaction.Behaviors> |
98 |
| - </ToggleSwitch> |
99 |
| - </local:SettingsBlockControl> |
| 91 | + <StackPanel> |
| 92 | + <!-- Startup disabled InfoBar --> |
| 93 | + <InfoBar |
| 94 | + x:Name="OpenOnStartupInfoBar" |
| 95 | + x:Load="{x:Bind ViewModel.CanOpenOnWindowsStartup, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}" |
| 96 | + IsClosable="False" |
| 97 | + IsIconVisible="True" |
| 98 | + IsOpen="True" |
| 99 | + Message="{helpers:ResourceString Name=OpenOnStartupDisabled}" |
| 100 | + Severity="Warning" /> |
| 101 | + |
| 102 | + <!-- Setting block --> |
| 103 | + <local:SettingsBlockControl Title="{helpers:ResourceString Name=SettingsOpenInLogin}" HorizontalAlignment="Stretch"> |
| 104 | + <local:SettingsBlockControl.Icon> |
| 105 | + <FontIcon Glyph="" /> |
| 106 | + </local:SettingsBlockControl.Icon> |
| 107 | + <ToggleSwitch |
| 108 | + AutomationProperties.Name="{helpers:ResourceString Name=SettingsOpenInLogin}" |
| 109 | + IsEnabled="{x:Bind ViewModel.CanOpenOnWindowsStartup, Mode=OneWay}" |
| 110 | + IsOn="{x:Bind ViewModel.OpenOnWindowsStartup, Mode=TwoWay}" |
| 111 | + Style="{StaticResource RightAlignedToggleSwitchStyle}"> |
| 112 | + <i:Interaction.Behaviors> |
| 113 | + <icore:EventTriggerBehavior EventName="Toggled"> |
| 114 | + <icore:InvokeCommandAction Command="{x:Bind ViewModel.OpenFilesOnWindowsStartupCommand, Mode=OneWay}" /> |
| 115 | + </icore:EventTriggerBehavior> |
| 116 | + </i:Interaction.Behaviors> |
| 117 | + </ToggleSwitch> |
| 118 | + </local:SettingsBlockControl> |
| 119 | + </StackPanel> |
100 | 120 |
|
101 | 121 | <!-- Leave App Running -->
|
102 | 122 | <local:SettingsBlockControl Title="{helpers:ResourceString Name=SettingsLeaveAppRunning}" HorizontalAlignment="Stretch">
|
|
0 commit comments