Shortcut Guide

This commit is contained in:
Niels Laute
2021-08-01 23:56:39 +02:00
parent 31da2e49dc
commit 04f2de09d7
9 changed files with 207 additions and 202 deletions

View File

@@ -80,14 +80,14 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
// normalization for switch statements // normalization for switch statements
switch (GeneralSettingsConfig.Theme.ToUpperInvariant()) switch (GeneralSettingsConfig.Theme.ToUpperInvariant())
{ {
case "LIGHT":
_isLightThemeRadioButtonChecked = true;
break;
case "DARK": case "DARK":
_isDarkThemeRadioButtonChecked = true; _themeIndex = 0;
break;
case "LIGHT":
_themeIndex = 1;
break; break;
case "SYSTEM": case "SYSTEM":
_isSystemThemeRadioButtonChecked = true; _themeIndex = 2;
break; break;
} }
@@ -116,9 +116,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
private bool _isElevated; private bool _isElevated;
private bool _runElevated; private bool _runElevated;
private bool _isAdmin; private bool _isAdmin;
private bool _isDarkThemeRadioButtonChecked; private int _themeIndex;
private bool _isLightThemeRadioButtonChecked;
private bool _isSystemThemeRadioButtonChecked;
private bool _autoDownloadUpdates; private bool _autoDownloadUpdates;
private UpdatingSettings.UpdatingState _updatingState = UpdatingSettings.UpdatingState.UpToDate; private UpdatingSettings.UpdatingState _updatingState = UpdatingSettings.UpdatingState.UpToDate;
@@ -255,86 +254,76 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
} }
} }
[SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "This may throw if the XAML page is not initialized in tests (https://github.com/microsoft/PowerToys/pull/2676)")] public int ThemeIndex
public bool IsDarkThemeRadioButtonChecked
{ {
get get
{ {
return _isDarkThemeRadioButtonChecked; return _themeIndex;
} }
set set
{ {
if (value == true) if (_themeIndex != value)
{ {
GeneralSettingsConfig.Theme = "dark"; if (value == 0)
_isDarkThemeRadioButtonChecked = value;
try
{ {
UpdateUIThemeCallBack(GeneralSettingsConfig.Theme); // set theme to dark.
} GeneralSettingsConfig.Theme = "dark";
catch (Exception e) _themeIndex = value;
{
Logger.LogError("Exception encountered when changing Settings theme", e); try
{
UpdateUIThemeCallBack(GeneralSettingsConfig.Theme);
}
#pragma warning disable CA1031 // Do not catch general exception types
catch (Exception e)
#pragma warning restore CA1031 // Do not catch general exception types
{
Logger.LogError("Exception encountered when changing Settings theme", e);
}
NotifyPropertyChanged();
} }
NotifyPropertyChanged(); if (value == 1)
}
}
}
[SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "This may throw if the XAML page is not initialized in tests (https://github.com/microsoft/PowerToys/pull/2676)")]
public bool IsLightThemeRadioButtonChecked
{
get
{
return _isLightThemeRadioButtonChecked;
}
set
{
if (value == true)
{
GeneralSettingsConfig.Theme = "light";
_isLightThemeRadioButtonChecked = value;
try
{ {
UpdateUIThemeCallBack(GeneralSettingsConfig.Theme); // set theme to light.
} GeneralSettingsConfig.Theme = "light";
catch (Exception e) _themeIndex = value;
{
Logger.LogError("Exception encountered when changing Settings theme", e); try
{
UpdateUIThemeCallBack(GeneralSettingsConfig.Theme);
}
#pragma warning disable CA1031 // Do not catch general exception types
catch (Exception e)
#pragma warning restore CA1031 // Do not catch general exception types
{
Logger.LogError("Exception encountered when changing Settings theme", e);
}
NotifyPropertyChanged();
} }
NotifyPropertyChanged(); if (value == 2)
}
}
}
[SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "This may throw if the XAML page is not initialized in tests (https://github.com/microsoft/PowerToys/pull/2676)")]
public bool IsSystemThemeRadioButtonChecked
{
get
{
return _isSystemThemeRadioButtonChecked;
}
set
{
if (value == true)
{
GeneralSettingsConfig.Theme = "system";
_isSystemThemeRadioButtonChecked = value;
try
{ {
UpdateUIThemeCallBack(GeneralSettingsConfig.Theme); // set theme to system default.
} GeneralSettingsConfig.Theme = "system";
catch (Exception e) _themeIndex = value;
{
Logger.LogError("Exception encountered when changing Settings theme", e);
}
NotifyPropertyChanged(); try
{
UpdateUIThemeCallBack(GeneralSettingsConfig.Theme);
}
#pragma warning disable CA1031 // Do not catch general exception types
catch (Exception e)
#pragma warning restore CA1031 // Do not catch general exception types
{
Logger.LogError("Exception encountered when changing Settings theme", e);
}
NotifyPropertyChanged();
}
} }
} }
} }

View File

@@ -6,25 +6,11 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" mc:Ignorable="d"
AutomationProperties.Name="{x:Bind Header, Mode=OneTime}"
d:DesignHeight="300" d:DesignHeight="300"
d:DesignWidth="400"> d:DesignWidth="400">
<TextBox x:Name="HotkeyTextBox" <TextBox x:Name="HotkeyTextBox"
x:Uid="SettingsPage_SetShortcut" x:Uid="SettingsPage_SetShortcut"
AutomationProperties.HelpText="{Binding ElementName=ShortcutWarningLabelText, Path=Text}" IsReadOnly="True"/>
IsReadOnly="True">
<ToolTipService.ToolTip>
<TextBlock x:Name="ShortcutWarningLabelText" TextWrapping="WrapWholeWords">
<Run x:Uid="ShortcutWarningLabel"/>
<LineBreak/>
<Run Text="{x:Bind Keys, Mode=OneTime}" FontWeight="SemiBold"/>
</TextBlock>
</ToolTipService.ToolTip>
<TextBox.Header>
<TextBlock>
<Run Text="{x:Bind Header, Mode=OneTime}"/>
<Run Text="&#xE946;" FontFamily="Segoe MDL2 Assets"/>
</TextBlock>
</TextBox.Header>
</TextBox>
</UserControl> </UserControl>

View File

@@ -22,7 +22,16 @@
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Center" VerticalAlignment="Center"
MinHeight="48"> MinHeight="48">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Target="RootGrid.Background" Value="Red" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
<!-- Icon --> <!-- Icon -->
@@ -70,8 +79,9 @@
<Style TargetType="HyperlinkButton" BasedOn="{StaticResource TextBlockButtonStyle}"> <Style TargetType="HyperlinkButton" BasedOn="{StaticResource TextBlockButtonStyle}">
<Style.Setters> <Style.Setters>
<Setter Property="FontWeight" Value="SemiBold"/> <Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Margin" Value="0"/> <Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0,6,0,0"/> <Setter Property="Padding" Value="0,0,0,0"/>
</Style.Setters> </Style.Setters>
</Style> </Style>
</ContentPresenter.Resources> </ContentPresenter.Resources>

View File

@@ -43,7 +43,7 @@
<Grid ColumnSpacing="16"> <Grid ColumnSpacing="16">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="240"/> <ColumnDefinition Width="160"/>
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Border CornerRadius="4" VerticalAlignment="Top"> <Border CornerRadius="4" VerticalAlignment="Top">
@@ -60,7 +60,7 @@
Foreground="{ThemeResource TextFillColorSecondaryBrush}" Foreground="{ThemeResource TextFillColorSecondaryBrush}"
TextWrapping="Wrap"/> TextWrapping="Wrap"/>
<ItemsControl ItemsSource="{x:Bind ModuleLinks}"> <ItemsControl ItemsSource="{x:Bind ModuleLinks}" Margin="0,16,0,0">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate x:DataType="local:SidePanelLink"> <DataTemplate x:DataType="local:SidePanelLink">
<HyperlinkButton NavigateUri="{x:Bind Link}"> <HyperlinkButton NavigateUri="{x:Bind Link}">

View File

@@ -362,9 +362,6 @@ Disabling this module or closing PowerToys will unmute the microphone and camera
<data name="PowerLauncher_MaximumNumberOfResults.Header" xml:space="preserve"> <data name="PowerLauncher_MaximumNumberOfResults.Header" xml:space="preserve">
<value>Maximum number of results</value> <value>Maximum number of results</value>
</data> </data>
<data name="Shortcuts.Text" xml:space="preserve">
<value>Shortcuts</value>
</data>
<data name="PowerLauncher_OpenPowerLauncher.Header" xml:space="preserve"> <data name="PowerLauncher_OpenPowerLauncher.Header" xml:space="preserve">
<value>Open PowerToys Run</value> <value>Open PowerToys Run</value>
</data> </data>
@@ -508,8 +505,11 @@ Disabling this module or closing PowerToys will unmute the microphone and camera
<value>Restart as administrator</value> <value>Restart as administrator</value>
<comment>running PowerToys as a higher level user, account is typically referred to as an admin / administrator</comment> <comment>running PowerToys as a higher level user, account is typically referred to as an admin / administrator</comment>
</data> </data>
<data name="GeneralPage_ToggleSwitch_RunAtStartUp.Header" xml:space="preserve"> <data name="GeneralPage_RunAtStartUp.Header" xml:space="preserve">
<value>Run at startup</value> <value>Run at startup</value>
</data>
<data name="GeneralPage_RunAtStartUp.Description" xml:space="preserve">
<value>PowerToys will launch automatically</value>
</data> </data>
<data name="PowerRename.ModuleDescription" xml:space="preserve"> <data name="PowerRename.ModuleDescription" xml:space="preserve">
<value>A Windows Shell extension for more advanced bulk renaming using search and replace or regular expressions.</value> <value>A Windows Shell extension for more advanced bulk renaming using search and replace or regular expressions.</value>
@@ -574,7 +574,7 @@ Disabling this module or closing PowerToys will unmute the microphone and camera
<value>Press duration before showing (ms)</value> <value>Press duration before showing (ms)</value>
<comment>pressing a key in milliseconds</comment> <comment>pressing a key in milliseconds</comment>
</data> </data>
<data name="ShortcutGuide_Appearance_Behavior.Text" xml:space="preserve"> <data name="ShortcutGuide_Appearance_Behavior.Header" xml:space="preserve">
<value>Appearance &amp; behavior</value> <value>Appearance &amp; behavior</value>
</data> </data>
<data name="ShortcutGuide_Enable.Header" xml:space="preserve"> <data name="ShortcutGuide_Enable.Header" xml:space="preserve">
@@ -584,11 +584,11 @@ Disabling this module or closing PowerToys will unmute the microphone and camera
<data name="ShortcutGuide_OverlayOpacity.Header" xml:space="preserve"> <data name="ShortcutGuide_OverlayOpacity.Header" xml:space="preserve">
<value>Opacity of background</value> <value>Opacity of background</value>
</data> </data>
<data name="ShortcutGuide_DisabledApps.Text" xml:space="preserve"> <data name="ShortcutGuide_DisabledApps.Header" xml:space="preserve">
<value>Disable for apps</value> <value>Exclude apps</value>
</data> </data>
<data name="ShortcutGuide_DisabledApps_TextBoxControl.Header" xml:space="preserve"> <data name="ShortcutGuide_DisabledApps.Description" xml:space="preserve">
<value>Turn off Shortcut Guide when these applications have focus. Add one application name per line.</value> <value>Turns off Shortcut Guide when these applications have focus. Add one application name per line.</value>
</data> </data>
<data name="ShortcutGuide_DisabledApps_TextBoxControl.PlaceholderText" xml:space="preserve"> <data name="ShortcutGuide_DisabledApps_TextBoxControl.PlaceholderText" xml:space="preserve">
<value>Example: outlook.exe</value> <value>Example: outlook.exe</value>
@@ -901,7 +901,7 @@ Made with 💗 by Microsoft and the PowerToys community.</value>
<data name="ImageResizer_FilenameFormatPlaceholder.PlaceholderText" xml:space="preserve"> <data name="ImageResizer_FilenameFormatPlaceholder.PlaceholderText" xml:space="preserve">
<value>Example: %1 (%2)</value> <value>Example: %1 (%2)</value>
</data> </data>
<data name="ColorModeHeader.Text" xml:space="preserve"> <data name="ColorModeHeader.Header" xml:space="preserve">
<value>Choose a mode</value> <value>Choose a mode</value>
</data> </data>
<data name="Radio_Theme_Dark.Content" xml:space="preserve"> <data name="Radio_Theme_Dark.Content" xml:space="preserve">
@@ -916,7 +916,7 @@ Made with 💗 by Microsoft and the PowerToys community.</value>
<value>Windows default</value> <value>Windows default</value>
<comment>Windows refers to the Operating system</comment> <comment>Windows refers to the Operating system</comment>
</data> </data>
<data name="Windows_Color_Settings.Text" xml:space="preserve"> <data name="Windows_Color_Settings.Content" xml:space="preserve">
<value>Windows color settings</value> <value>Windows color settings</value>
<comment>Windows refers to the Operating system</comment> <comment>Windows refers to the Operating system</comment>
</data> </data>
@@ -1087,7 +1087,7 @@ Made with 💗 by Microsoft and the PowerToys community.</value>
<value>Quick layout switch</value> <value>Quick layout switch</value>
</data> </data>
<data name="ShortcutGuide_OpenShortcutGuide.Header" xml:space="preserve"> <data name="ShortcutGuide_OpenShortcutGuide.Header" xml:space="preserve">
<value>Open Shortcut Guide</value> <value>Activation shortcut</value>
</data> </data>
<data name="Oobe_GetStarted.Text" xml:space="preserve"> <data name="Oobe_GetStarted.Text" xml:space="preserve">
<value>Let's get started!</value> <value>Let's get started!</value>

View File

@@ -5,11 +5,10 @@
<!-- Template for the header of a section of settings --> <!-- Template for the header of a section of settings -->
<DataTemplate x:Key="SectionHeaderTemplate"> <DataTemplate x:Key="SectionHeaderTemplate">
<TextBlock <TextBlock Text="{Binding}"
Text="{Binding}" Style="{ThemeResource BodyStrongTextBlockStyle}"
Style="{ThemeResource BodyStrongTextBlockStyle}" Margin="2,32,0,8"
Margin="2,32,0,8" AutomationProperties.HeadingLevel="Level2" />
AutomationProperties.HeadingLevel="Level2" />
</DataTemplate> </DataTemplate>
<!-- Template for content of a section of settings --> <!-- Template for content of a section of settings -->

View File

@@ -7,6 +7,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters" xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters"
xmlns:localConverters="using:Microsoft.PowerToys.Settings.UI.Converters" xmlns:localConverters="using:Microsoft.PowerToys.Settings.UI.Converters"
xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls" xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d" mc:Ignorable="d"
AutomationProperties.LandmarkType="Main"> AutomationProperties.LandmarkType="Main">
@@ -58,31 +59,53 @@
</HyperlinkButton> </HyperlinkButton>
<TextBlock x:Uid="ShortcutGuide_Appearance_Behavior" <TextBlock
Style="{StaticResource SettingsGroupTitleStyle}"/> Style="{StaticResource SettingsGroupTitleStyle}"/>
<!-- Replaced the Radiobuttons parent control with a StackPanel to mitigate the Tab and Arrow key related keyboard navigation issues due to XAML Islands <!-- Replaced the Radiobuttons parent control with a StackPanel to mitigate the Tab and Arrow key related keyboard navigation issues due to XAML Islands
Tracking issue in the winui repository - https://github.com/microsoft/microsoft-ui-xaml/issues/3156 --> Tracking issue in the winui repository - https://github.com/microsoft/microsoft-ui-xaml/issues/3156 -->
<TextBlock x:Name="RadioButtons_Name_Theme" <TextBlock x:Name="RadioButtons_Name_Theme"
x:Uid="ColorModeHeader"
Margin="{StaticResource SmallTopMargin}"/> Margin="{StaticResource SmallTopMargin}"/>
<StackPanel AutomationProperties.LabeledBy="{Binding ElementName=RadioButtons_Name_Theme}">
<RadioButton x:Uid="Radio_Theme_Dark"
IsChecked="{ Binding Mode=TwoWay, Path=IsDarkThemeRadioButtonChecked}"/>
<RadioButton x:Uid="Radio_Theme_Light"
IsChecked="{ Binding Mode=TwoWay, Path=IsLightThemeRadioButtonChecked}"/>
<RadioButton x:Uid="Radio_Theme_Default"
IsChecked="{ Binding Mode=TwoWay, Path=IsSystemThemeRadioButtonChecked}"/>
<HyperlinkButton Click="OpenColorsSettings_Click" Margin="-12,0,0,0">
<TextBlock x:Uid="Windows_Color_Settings" />
</HyperlinkButton>
</StackPanel>
<ToggleSwitch x:Uid="GeneralPage_ToggleSwitch_RunAtStartUp"
Margin="{StaticResource SmallTopMargin}"
IsOn="{Binding Mode=TwoWay, Path=Startup}"/>
<toolkitcontrols:HeaderedItemsControl IsEnabled="True" x:Uid="ShortcutGuide_Appearance_Behavior">
<muxc:Expander IsExpanded="True" Style="{StaticResource SettingsExpanderStyle}">
<muxc:Expander.Header>
<controls:Setting x:Uid="ColorModeHeader" Icon="&#xE771;" Style="{StaticResource ExpanderHeaderSettingStyle}">
<controls:Setting.Description>
<HyperlinkButton Click="OpenColorsSettings_Click"
x:Uid="Windows_Color_Settings"/>
</controls:Setting.Description>
<controls:Setting.ActionContent>
<ComboBox SelectedIndex="{x:Bind Mode=TwoWay, Path=ViewModel.ThemeIndex}">
<ComboBoxItem x:Uid="Radio_Theme_Dark"/>
<ComboBoxItem x:Uid="Radio_Theme_Light"/>
<ComboBoxItem x:Uid="Radio_Theme_Default"/>
</ComboBox>
</controls:Setting.ActionContent>
</controls:Setting>
</muxc:Expander.Header>
<muxc:Expander.Content>
<StackPanel Orientation="Vertical">
<controls:Setting x:Uid="GeneralPage_RunAtStartUp" Style="{StaticResource ExpanderContentSettingStyle}">
<controls:Setting.ActionContent>
<ToggleSwitch IsOn="{Binding Mode=TwoWay, Path=Startup}"/>
</controls:Setting.ActionContent>
</controls:Setting>
</StackPanel>
</muxc:Expander.Content>
</muxc:Expander>
</toolkitcontrols:HeaderedItemsControl>
<TextBlock x:Uid="General_Updates" <TextBlock x:Uid="General_Updates"

View File

@@ -18,8 +18,7 @@
<StackPanel Orientation="Vertical" <StackPanel Orientation="Vertical"
x:Name="PowerRenameView" x:Name="PowerRenameView"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch">
Margin="0,0,48,0">
<controls:Setting x:Uid="PowerRename_Toggle_Enable"> <controls:Setting x:Uid="PowerRename_Toggle_Enable">
<controls:Setting.Icon> <controls:Setting.Icon>

View File

@@ -5,7 +5,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls" xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls" xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters" xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters"
mc:Ignorable="d" mc:Ignorable="d"
AutomationProperties.LandmarkType="Main"> AutomationProperties.LandmarkType="Main">
@@ -21,84 +22,82 @@
<StackPanel Orientation="Vertical" <StackPanel Orientation="Vertical"
x:Name="ShortcutGuideView" x:Name="ShortcutGuideView">
HorizontalAlignment="Left"
Margin="0,0,48,0"
MaxWidth="{StaticResource MaxContentWidth}">
<ToggleSwitch x:Uid="ShortcutGuide_Enable"
IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.IsEnabled}"/>
<TextBlock x:Uid="Shortcuts"
Style="{StaticResource SettingsGroupTitleStyle}"
Opacity="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled, Converter={StaticResource ModuleEnabledToOpacityConverter}}"/>
<controls:HotkeySettingsControl x:Uid="ShortcutGuide_OpenShortcutGuide"
HorizontalAlignment="Left"
MinWidth="240"
Margin="{StaticResource SmallTopMargin}"
HotkeySettings="{x:Bind Path=ViewModel.OpenShortcutGuide, Mode=TwoWay}"
Keys="Win, Ctrl, Alt, Shift"
Enabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<TextBlock x:Uid="ShortcutGuide_Appearance_Behavior" <controls:Setting x:Uid="ShortcutGuide_Enable">
Style="{StaticResource SettingsGroupTitleStyle}" <controls:Setting.Icon>
Opacity="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled, Converter={StaticResource ModuleEnabledToOpacityConverter}}"/> <BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsShortcutGuide.png" ShowAsMonochrome="False" />
</controls:Setting.Icon>
<controls:Setting.ActionContent>
<ToggleSwitch IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.IsEnabled}" FlowDirection="RightToLeft" />
</controls:Setting.ActionContent>
</controls:Setting>
<StackPanel Orientation="Horizontal" Margin="{StaticResource MediumTopMargin}" Spacing="12">
<Slider x:Uid="ShortcutGuide_OverlayOpacity"
Minimum="0"
Maximum="100"
Width="240"
Value="{x:Bind Mode=TwoWay, Path=ViewModel.OverlayOpacity}"
IsThumbToolTipEnabled="False"
HorizontalAlignment="Left"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<TextBlock <controls:Setting x:Uid="ShortcutGuide_OpenShortcutGuide" Icon="&#xEDA7;">
Text="{x:Bind Mode=OneWay, Path=ViewModel.OverlayOpacity, Converter={StaticResource StringFormatConverter}, ConverterParameter=' {0}%' }" <controls:Setting.Description>
VerticalAlignment="Center" <TextBlock>
FontSize="16" <Run x:Uid="ShortcutWarningLabel"/>
FontWeight="SemiBold" <Run Text="Win, Ctrl, Alt, Shift"/>
Margin="0,16,0,0" </TextBlock>
Opacity="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled, Converter={StaticResource ModuleEnabledToOpacityConverter}}"/> </controls:Setting.Description>
</StackPanel> <controls:Setting.ActionContent>
<controls:HotkeySettingsControl Width="240" HotkeySettings="{x:Bind Path=ViewModel.OpenShortcutGuide, Mode=TwoWay}" Keys="Win, Ctrl, Alt, Shift"/>
<!-- We cannot navigate to all the radio buttons using the arrow keys because of an XYNavigation issue in the RadioButtons control. </controls:Setting.ActionContent>
The screen reader does not read the heading when we tab into a radio button, even though the LabeledBy automation property is set. </controls:Setting>
Link to the issue in the winui repository - https://github.com/microsoft/microsoft-ui-xaml/issues/3156 -->
<TextBlock Name="ShortcutGuide_Theme" <toolkitcontrols:HeaderedItemsControl x:Uid="ShortcutGuide_Appearance_Behavior">
x:Uid="ColorModeHeader" <muxc:Expander IsExpanded="True" Style="{StaticResource SettingsExpanderStyle}">
Margin="{StaticResource SmallTopMargin}" <muxc:Expander.Header>
Opacity="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled, Converter={StaticResource ModuleEnabledToOpacityConverter}}"/> <controls:Setting x:Uid="ColorModeHeader" Icon="&#xE771;" Style="{StaticResource ExpanderHeaderSettingStyle}">
<muxc:RadioButtons IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}" <controls:Setting.Description>
SelectedIndex="{x:Bind Mode=TwoWay, Path=ViewModel.ThemeIndex}" <HyperlinkButton Click="OpenColorsSettings_Click"
AutomationProperties.LabeledBy="{Binding ElementName=ShortcutGuide_Theme}"> x:Uid="Windows_Color_Settings"
<RadioButton x:Uid="Radio_Theme_Dark" /> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<RadioButton x:Uid="Radio_Theme_Light" /> </controls:Setting.Description>
<RadioButton x:Uid="Radio_Theme_Default"/> <controls:Setting.ActionContent>
</muxc:RadioButtons> <ComboBox SelectedIndex="{x:Bind Mode=TwoWay, Path=ViewModel.ThemeIndex}">
<HyperlinkButton Click="OpenColorsSettings_Click" <ComboBoxItem x:Uid="Radio_Theme_Dark"/>
Margin="-12,0,0,0" <ComboBoxItem x:Uid="Radio_Theme_Light"/>
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"> <ComboBoxItem x:Uid="Radio_Theme_Default"/>
<TextBlock x:Uid="Windows_Color_Settings" /> </ComboBox>
</HyperlinkButton> </controls:Setting.ActionContent>
</controls:Setting>
<TextBlock x:Uid="ShortcutGuide_DisabledApps" </muxc:Expander.Header>
Style="{StaticResource SettingsGroupTitleStyle}" <muxc:Expander.Content>
Opacity="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled, Converter={StaticResource ModuleEnabledToOpacityConverter}}"/> <StackPanel Orientation="Vertical">
<controls:Setting x:Uid="ShortcutGuide_OverlayOpacity" Style="{StaticResource ExpanderContentSettingStyle}">
<TextBox x:Uid="ShortcutGuide_DisabledApps_TextBoxControl" <controls:Setting.ActionContent>
Margin="{StaticResource SmallTopMargin}" <Slider Minimum="0"
Text="{x:Bind Mode=TwoWay, Path=ViewModel.DisabledApps, UpdateSourceTrigger=PropertyChanged}" Maximum="100"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}" Width="240"
ScrollViewer.VerticalScrollBarVisibility ="Visible" Value="{x:Bind Mode=TwoWay, Path=ViewModel.OverlayOpacity}"
ScrollViewer.VerticalScrollMode="Enabled" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
ScrollViewer.IsVerticalRailEnabled="True" </controls:Setting.ActionContent>
TextWrapping="Wrap" </controls:Setting>
AcceptsReturn="True" </StackPanel>
HorizontalAlignment="Left" </muxc:Expander.Content>
MinWidth="240" </muxc:Expander>
MinHeight="160" /> <muxc:Expander IsExpanded="True" Style="{StaticResource SettingsExpanderStyle}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<muxc:Expander.Header>
<controls:Setting x:Uid="ShortcutGuide_DisabledApps" Style="{StaticResource ExpanderHeaderSettingStyle}"/>
</muxc:Expander.Header>
<muxc:Expander.Content>
<TextBox x:Uid="ShortcutGuide_DisabledApps_TextBoxControl"
Text="{x:Bind Mode=TwoWay, Path=ViewModel.DisabledApps, UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
ScrollViewer.VerticalScrollBarVisibility ="Visible"
ScrollViewer.VerticalScrollMode="Enabled"
ScrollViewer.IsVerticalRailEnabled="True"
TextWrapping="Wrap"
AcceptsReturn="True"
MinWidth="240"
MinHeight="160" />
</muxc:Expander.Content>
</muxc:Expander>
</toolkitcontrols:HeaderedItemsControl>
</StackPanel> </StackPanel>
</controls:SettingsPageControl.ModuleContent> </controls:SettingsPageControl.ModuleContent>
<controls:SettingsPageControl.ModuleLinks> <controls:SettingsPageControl.ModuleLinks>