[OOBE] Refactor UI code, minor UI tweaks (#16578)

* Move content to dedicated XAML

* Select modules enum

* Remove redundant code, UI fixes

* Markdown rendering tweaks

* Address feedback
This commit is contained in:
Niels Laute 2022-03-08 16:27:17 +01:00 committed by GitHub
parent 139c6c2c8d
commit 9cf39654d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 341 additions and 344 deletions

View File

@ -62,13 +62,13 @@ namespace PowerToys.Settings
if (ShowOobe)
{
PowerToysTelemetry.Log.WriteEvent(new OobeStartedEvent());
OobeWindow oobeWindow = new OobeWindow((int)Microsoft.PowerToys.Settings.UI.OOBE.Enums.PowerToysModulesEnum.Overview);
OobeWindow oobeWindow = new OobeWindow(Microsoft.PowerToys.Settings.UI.OOBE.Enums.PowerToysModulesEnum.Overview);
oobeWindow.Show();
}
else if (ShowScoobe)
{
PowerToysTelemetry.Log.WriteEvent(new ScoobeStartedEvent());
OobeWindow scoobeWindow = new OobeWindow((int)Microsoft.PowerToys.Settings.UI.OOBE.Enums.PowerToysModulesEnum.WhatsNew);
OobeWindow scoobeWindow = new OobeWindow(Microsoft.PowerToys.Settings.UI.OOBE.Enums.PowerToysModulesEnum.WhatsNew);
scoobeWindow.Show();
}
}

View File

@ -125,7 +125,7 @@ namespace PowerToys.Settings
// open oobe
ShellPage.SetOpenOobeCallback(() =>
{
var oobe = new OobeWindow((int)Microsoft.PowerToys.Settings.UI.OOBE.Enums.PowerToysModulesEnum.Overview);
var oobe = new OobeWindow(Microsoft.PowerToys.Settings.UI.OOBE.Enums.PowerToysModulesEnum.Overview);
oobe.Show();
});

View File

@ -7,6 +7,7 @@ using System.Windows;
using System.Windows.Interop;
using interop;
using Microsoft.PowerToys.Settings.UI.Helpers;
using Microsoft.PowerToys.Settings.UI.OOBE.Enums;
using Microsoft.PowerToys.Settings.UI.OOBE.Views;
using Microsoft.Toolkit.Wpf.UI.XamlHost;
using Windows.ApplicationModel.Resources;
@ -20,7 +21,7 @@ namespace PowerToys.Settings
{
private static Window inst;
private OobeShellPage shellPage;
private int initialModule;
private PowerToysModulesEnum initialModule;
public static bool IsOpened
{
@ -30,7 +31,7 @@ namespace PowerToys.Settings
}
}
public OobeWindow(int initialModule)
public OobeWindow(PowerToysModulesEnum initialModule)
{
InitializeComponent();
Utils.FitToScreen(this);

View File

@ -17,7 +17,7 @@
</Grid.RowDefinitions>
<Image x:Name="HeaderImage"
Source="{x:Bind ModuleImageSource}"
Source="{x:Bind HeroImage}"
Stretch="UniformToFill" />
<ScrollViewer Grid.Row="1"
@ -27,18 +27,18 @@
VerticalAlignment="Top">
<TextBlock x:Name="TitleTxt"
Text="{x:Bind ModuleTitle}"
Text="{x:Bind Title}"
AutomationProperties.HeadingLevel="Level1"
Style="{StaticResource TitleTextBlockStyle}" />
<TextBlock x:Name="DescriptionTxt"
Margin="0,8,0,0"
Text="{x:Bind ModuleDescription}"
Text="{x:Bind Description}"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
TextWrapping="Wrap" />
<ContentPresenter x:Name="ModuleContentPresenter"
Content="{x:Bind ModuleContent}"
Content="{x:Bind PageContent}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
Margin="0,12,0,0"/>

View File

@ -14,33 +14,33 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
this.InitializeComponent();
}
public string ModuleTitle
public string Title
{
get { return (string)GetValue(ModuleTitleProperty); }
set { SetValue(ModuleTitleProperty, value); }
get { return (string)GetValue(TitleProperty); }
set { SetValue(TitleProperty, value); }
}
public string ModuleDescription
public string Description
{
get => (string)GetValue(ModuleDescriptionProperty);
set => SetValue(ModuleDescriptionProperty, value);
get => (string)GetValue(DescriptionProperty);
set => SetValue(DescriptionProperty, value);
}
public string ModuleImageSource
public string HeroImage
{
get => (string)GetValue(ModuleImageSourceProperty);
set => SetValue(ModuleImageSourceProperty, value);
get => (string)GetValue(HeroImageProperty);
set => SetValue(HeroImageProperty, value);
}
public object ModuleContent
public object PageContent
{
get { return (object)GetValue(ModuleContentProperty); }
set { SetValue(ModuleContentProperty, value); }
get { return (object)GetValue(PageContentProperty); }
set { SetValue(PageContentProperty, value); }
}
public static readonly DependencyProperty ModuleTitleProperty = DependencyProperty.Register("ModuleTitle", typeof(string), typeof(SettingsPageControl), new PropertyMetadata(default(string)));
public static readonly DependencyProperty ModuleDescriptionProperty = DependencyProperty.Register("ModuleDescription", typeof(string), typeof(SettingsPageControl), new PropertyMetadata(default(string)));
public static readonly DependencyProperty ModuleImageSourceProperty = DependencyProperty.Register("ModuleImageSource", typeof(string), typeof(SettingsPageControl), new PropertyMetadata(default(string)));
public static readonly DependencyProperty ModuleContentProperty = DependencyProperty.Register("ModuleContent", typeof(object), typeof(SettingsPageControl), new PropertyMetadata(new Grid()));
public static readonly DependencyProperty TitleProperty = DependencyProperty.Register("Title", typeof(string), typeof(SettingsPageControl), new PropertyMetadata(default(string)));
public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register("Description", typeof(string), typeof(SettingsPageControl), new PropertyMetadata(default(string)));
public static readonly DependencyProperty HeroImageProperty = DependencyProperty.Register("HeroImage", typeof(string), typeof(SettingsPageControl), new PropertyMetadata(default(string)));
public static readonly DependencyProperty PageContentProperty = DependencyProperty.Register("PageContent", typeof(object), typeof(SettingsPageControl), new PropertyMetadata(new Grid()));
}
}

View File

@ -7,7 +7,6 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Enums
public enum PowerToysModulesEnum
{
Overview = 0,
WhatsNew,
AlwaysOnTop,
Awake,
ColorPicker,
@ -20,5 +19,6 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Enums
Run,
ShortcutGuide,
VideoConference,
WhatsNew,
}
}

View File

@ -17,20 +17,6 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.ViewModel
public bool IsNew { get; set; }
public string Image { get; set; }
public string Icon { get; set; }
public string FluentIcon { get; set; }
public string PreviewImageSource { get; set; }
public string Description { get; set; }
public string Link { get; set; }
public string DescriptionLink { get; set; }
public OobePowerToysModule()
{
}
@ -45,13 +31,6 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.ViewModel
ModuleName = other.ModuleName;
Tag = other.Tag;
IsNew = other.IsNew;
Image = other.Image;
Icon = other.Icon;
FluentIcon = other.FluentIcon;
PreviewImageSource = other.PreviewImageSource;
Description = other.Description;
Link = other.Link;
DescriptionLink = other.DescriptionLink;
timeOpened = other.timeOpened;
}

View File

@ -9,11 +9,10 @@
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls">
<controls:OOBEPageControl ModuleTitle="{x:Bind ViewModel.ModuleName}"
ModuleImageSource="{x:Bind ViewModel.PreviewImageSource}"
ModuleDescription="{x:Bind ViewModel.Description}">
<controls:OOBEPageControl x:Uid="Oobe_AlwaysOnTop"
HeroImage="ms-appx:///Assets/Modules/OOBE/AlwaysOnTop.png">
<controls:OOBEPageControl.ModuleContent>
<controls:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
@ -29,13 +28,13 @@
<StackPanel Orientation="Horizontal" Spacing="12" Margin="0,24,0,0">
<Button x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click"/>
<HyperlinkButton NavigateUri="{x:Bind ViewModel.Link}"
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_AlwaysOnTop"
Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_AlwaysOnTop"
TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>
</controls:OOBEPageControl.ModuleContent>
</controls:OOBEPageControl.PageContent>
</controls:OOBEPageControl>
</Page>

View File

@ -8,11 +8,10 @@
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls">
<controls:OOBEPageControl ModuleTitle="{x:Bind ViewModel.ModuleName}"
ModuleImageSource="{x:Bind ViewModel.PreviewImageSource}"
ModuleDescription="{x:Bind ViewModel.Description}">
<controls:OOBEPageControl x:Uid="Oobe_Awake"
HeroImage="ms-appx:///Assets/Modules/OOBE/Awake.png">
<controls:OOBEPageControl.ModuleContent>
<controls:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
@ -27,13 +26,13 @@
<StackPanel Orientation="Horizontal" Spacing="12" Margin="0,24,0,0">
<Button x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click"/>
<HyperlinkButton NavigateUri="{x:Bind ViewModel.Link}"
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_Awake"
Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_Awake"
TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>
</controls:OOBEPageControl.ModuleContent>
</controls:OOBEPageControl.PageContent>
</controls:OOBEPageControl>
</Page>

View File

@ -9,11 +9,10 @@
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls">
<controls:OOBEPageControl ModuleTitle="{x:Bind ViewModel.ModuleName}"
ModuleImageSource="{x:Bind ViewModel.PreviewImageSource}"
ModuleDescription="{x:Bind ViewModel.Description}">
<controls:OOBEPageControl x:Uid="Oobe_ColorPicker"
HeroImage="ms-appx:///Assets/Modules/OOBE/ColorPicker.gif">
<controls:OOBEPageControl.ModuleContent>
<controls:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
@ -30,12 +29,12 @@
<Button x:Uid="Launch_ColorPicker" Style="{StaticResource AccentButtonStyle}" Click="Start_ColorPicker_Click"/>
<Button x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click"/>
<HyperlinkButton NavigateUri="{x:Bind ViewModel.Link}" Style="{StaticResource TextButtonStyle}">
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_ColorPicker" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_ColorPicker"
TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>
</controls:OOBEPageControl.ModuleContent>
</controls:OOBEPageControl.PageContent>
</controls:OOBEPageControl>
</Page>

View File

@ -8,11 +8,10 @@
xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls"
mc:Ignorable="d">
<controls:OOBEPageControl ModuleTitle="{x:Bind ViewModel.ModuleName}"
ModuleImageSource="{x:Bind ViewModel.PreviewImageSource}"
ModuleDescription="{x:Bind ViewModel.Description}">
<controls:OOBEPageControl x:Uid="Oobe_FancyZones"
HeroImage="ms-appx:///Assets/Modules/OOBE/FancyZones.gif">
<controls:OOBEPageControl.ModuleContent>
<controls:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
@ -29,12 +28,12 @@
<StackPanel Orientation="Horizontal" Spacing="12" Margin="0,24,0,0">
<Button x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click"/>
<HyperlinkButton NavigateUri="{x:Bind ViewModel.Link}" Style="{StaticResource TextButtonStyle}">
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_FancyZones" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_FancyZones"
TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>
</controls:OOBEPageControl.ModuleContent>
</controls:OOBEPageControl.PageContent>
</controls:OOBEPageControl>
</Page>

View File

@ -8,11 +8,10 @@
xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls"
mc:Ignorable="d">
<controls:OOBEPageControl ModuleTitle="{x:Bind ViewModel.ModuleName}"
ModuleImageSource="{x:Bind ViewModel.PreviewImageSource}"
ModuleDescription="{x:Bind ViewModel.Description}">
<controls:OOBEPageControl x:Uid="Oobe_FileExplorer"
HeroImage="ms-appx:///Assets/Modules/OOBE/FileExplorer.png">
<controls:OOBEPageControl.ModuleContent>
<controls:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock x:Uid="Oobe_HowToEnable"
Style="{ThemeResource OobeSubtitleStyle}" />
@ -22,12 +21,12 @@
<StackPanel Orientation="Horizontal" Spacing="12" Margin="0,24,0,0">
<Button x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click"/>
<HyperlinkButton NavigateUri="{x:Bind ViewModel.Link}" Style="{StaticResource TextButtonStyle}">
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_FileExplorerAddOns" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_PowerPreview"
TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>
</controls:OOBEPageControl.ModuleContent>
</controls:OOBEPageControl.PageContent>
</controls:OOBEPageControl>
</Page>

View File

@ -9,11 +9,10 @@
xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls"
mc:Ignorable="d">
<controls:OOBEPageControl ModuleTitle="{x:Bind ViewModel.ModuleName}"
ModuleImageSource="{x:Bind ViewModel.PreviewImageSource}"
ModuleDescription="{x:Bind ViewModel.Description}">
<controls:OOBEPageControl x:Uid="Oobe_ImageResizer"
HeroImage="ms-appx:///Assets/Modules/OOBE/ImageResizer.gif">
<controls:OOBEPageControl.ModuleContent>
<controls:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock x:Uid="Oobe_HowToLaunch"
Style="{ThemeResource OobeSubtitleStyle}" />
@ -28,12 +27,12 @@
<StackPanel Orientation="Horizontal" Spacing="12" Margin="0,24,0,0">
<Button x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click"/>
<HyperlinkButton NavigateUri="{x:Bind ViewModel.Link}" Style="{StaticResource TextButtonStyle}">
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_ImageResizer" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_ImageResizer"
TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>
</controls:OOBEPageControl.ModuleContent>
</controls:OOBEPageControl.PageContent>
</controls:OOBEPageControl>
</Page>

View File

@ -5,11 +5,10 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls" xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls"
mc:Ignorable="d">
<controls:OOBEPageControl ModuleTitle="{x:Bind ViewModel.ModuleName}"
ModuleImageSource="{x:Bind ViewModel.PreviewImageSource}"
ModuleDescription="{x:Bind ViewModel.Description}">
<controls:OOBEPageControl x:Uid="Oobe_KBM"
HeroImage="ms-appx:///Assets/Modules/OOBE/KBM.gif">
<controls:OOBEPageControl.ModuleContent>
<controls:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock x:Uid="Oobe_HowToCreateMappings"
@ -25,12 +24,12 @@
<StackPanel Orientation="Horizontal" Spacing="12" Margin="0,24,0,0">
<Button x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click"/>
<HyperlinkButton NavigateUri="{x:Bind ViewModel.Link}" Style="{StaticResource TextButtonStyle}">
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_KeyboardManager" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_KBM"
TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>
</controls:OOBEPageControl.ModuleContent>
</controls:OOBEPageControl.PageContent>
</controls:OOBEPageControl>
</Page>

View File

@ -8,11 +8,10 @@
xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls"
mc:Ignorable="d">
<controls:OOBEPageControl ModuleTitle="{x:Bind ViewModel.ModuleName}"
ModuleImageSource="{x:Bind ViewModel.PreviewImageSource}"
ModuleDescription="{x:Bind ViewModel.Description}">
<controls:OOBEPageControl x:Uid="Oobe_MouseUtils"
HeroImage="ms-appx:///Assets/Modules/OOBE/MouseUtils.gif">
<controls:OOBEPageControl.ModuleContent>
<controls:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock x:Uid="Oobe_MouseUtils_FindMyMouse"
Style="{ThemeResource OobeSubtitleStyle}" />
@ -29,13 +28,13 @@
<StackPanel Orientation="Horizontal" Spacing="12" Margin="0,24,0,0">
<Button x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click"/>
<HyperlinkButton NavigateUri="{x:Bind ViewModel.Link}" Style="{StaticResource TextButtonStyle}">
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_MouseUtilities" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_MouseUtils"
TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>
</controls:OOBEPageControl.ModuleContent>
</controls:OOBEPageControl.PageContent>
</controls:OOBEPageControl>
</Page>

View File

@ -7,21 +7,16 @@
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
mc:Ignorable="d">
<controls:OOBEPageControl ModuleTitle="{x:Bind ViewModel.ModuleName}"
ModuleImageSource="{x:Bind ViewModel.PreviewImageSource}">
<controls:OOBEPageControl x:Uid="Oobe_Overview"
HeroImage="ms-appx:///Assets/Modules/OOBE/OOBEPTHero.png">
<controls:OOBEPageControl.ModuleContent>
<controls:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock Margin="0,4,0,8"
x:Uid="Oobe_Overview_Description"
TextWrapping="Wrap"/>
<HyperlinkButton NavigateUri="{x:Bind ViewModel.DescriptionLink}" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="Oobe_Overview_DescriptionLinkText"
TextWrapping="Wrap" />
</HyperlinkButton>
<TextBlock x:Uid="Oobe_HowToUse"
Style="{ThemeResource OobeSubtitleStyle}" />
<HyperlinkButton NavigateUri="{x:Bind ViewModel.Link}" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="Oobe_Overview_LatestVersionLink"
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="Oobe_Overview_DescriptionLinkText"
TextWrapping="Wrap" />
</HyperlinkButton>
@ -30,6 +25,6 @@
Click="SettingsLaunchButton_Click"/>
</StackPanel>
</StackPanel>
</controls:OOBEPageControl.ModuleContent>
</controls:OOBEPageControl.PageContent>
</controls:OOBEPageControl>
</Page>

View File

@ -7,10 +7,10 @@
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls"
mc:Ignorable="d">
<controls:OOBEPageControl ModuleTitle="{x:Bind ViewModel.ModuleName}"
ModuleImageSource="{x:Bind ViewModel.PreviewImageSource}"
ModuleDescription="{x:Bind ViewModel.Description}">
<controls:OOBEPageControl.ModuleContent>
<controls:OOBEPageControl x:Uid="Oobe_PowerRename"
HeroImage="ms-appx:///Assets/Modules/OOBE/PowerRename.gif">
<controls:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock x:Uid="Oobe_HowToUse"
@ -26,12 +26,12 @@
<StackPanel Orientation="Horizontal" Spacing="12" Margin="0,24,0,0">
<Button x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click"/>
<HyperlinkButton NavigateUri="{x:Bind ViewModel.Link}" Style="{StaticResource TextButtonStyle}">
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_PowerRename" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_PowerRename"
TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>
</controls:OOBEPageControl.ModuleContent>
</controls:OOBEPageControl.PageContent>
</controls:OOBEPageControl>
</Page>

View File

@ -5,14 +5,14 @@
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls" xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls"
mc:Ignorable="d">
<controls:OOBEPageControl ModuleTitle="{x:Bind ViewModel.ModuleName}"
ModuleImageSource="{x:Bind ViewModel.PreviewImageSource}"
ModuleDescription="{x:Bind ViewModel.Description}">
<controls:OOBEPageControl x:Uid="Oobe_Run"
HeroImage="ms-appx:///Assets/Modules/OOBE/Run.gif">
<controls:OOBEPageControl.ModuleContent>
<controls:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock x:Uid="Oobe_HowToLaunch"
Style="{ThemeResource OobeSubtitleStyle}" />
@ -28,12 +28,12 @@
<Button x:Uid="Launch_Run" Style="{StaticResource AccentButtonStyle}" Click="Start_Run_Click"/>
<Button x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click"/>
<HyperlinkButton NavigateUri="{x:Bind ViewModel.Link}" Style="{StaticResource TextButtonStyle}">
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_PowerToysRun" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_Run"
TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>
</controls:OOBEPageControl.ModuleContent>
</controls:OOBEPageControl.PageContent>
</controls:OOBEPageControl>
</Page>

View File

@ -3,24 +3,14 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
xmlns:winui="using:Microsoft.UI.Xaml.Controls"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:localModels="using:Microsoft.PowerToys.Settings.UI.OOBE.ViewModel"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
winui:BackdropMaterial.ApplyToRootOrPageBackground="True"
muxc:BackdropMaterial.ApplyToRootOrPageBackground="True"
mc:Ignorable="d"
HighContrastAdjustment="None">
<UserControl.Resources>
<DataTemplate x:Key="NavigationViewMenuItem" x:DataType="localModels:OobePowerToysModule">
<winui:NavigationViewItem Content="{x:Bind ModuleName}" Tag="{x:Bind Tag}">
<winui:NavigationViewItem.Icon>
<BitmapIcon UriSource="{x:Bind FluentIcon}" ShowAsMonochrome="False"/>
</winui:NavigationViewItem.Icon>
</winui:NavigationViewItem>
</DataTemplate>
</UserControl.Resources>
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="LayoutVisualStates">
@ -43,19 +33,131 @@
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<winui:NavigationView IsSettingsVisible="False"
<muxc:NavigationView IsSettingsVisible="False"
IsPaneToggleButtonVisible="False"
IsPaneOpen="True"
x:Name="NavigationView"
OpenPaneLength="296"
PaneDisplayMode="Left"
SelectionChanged="NavigationView_SelectionChanged"
IsBackButtonVisible="Collapsed"
MenuItemsSource="{x:Bind Modules, Mode=OneTime}"
MenuItemTemplate="{StaticResource NavigationViewMenuItem}">
<winui:NavigationView.Content>
IsBackButtonVisible="Collapsed">
<muxc:NavigationView.MenuItems>
<muxc:NavigationViewItem x:Uid="Shell_General"
Tag="Overview">
<muxc:NavigationViewItem.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsPowerToys.png"
ShowAsMonochrome="False" />
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
<muxc:NavigationViewItem x:Uid="Shell_AlwaysOnTop"
Tag="AlwaysOnTop">
<muxc:NavigationViewItem.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsAlwaysOnTop.png"
ShowAsMonochrome="False" />
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
<muxc:NavigationViewItem x:Uid="Shell_Awake"
Tag="Awake">
<muxc:NavigationViewItem.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsAwake.png"
ShowAsMonochrome="False" />
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
<muxc:NavigationViewItem x:Uid="Shell_ColorPicker"
Tag="ColorPicker">
<muxc:NavigationViewItem.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsColorPicker.png"
ShowAsMonochrome="False" />
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
<muxc:NavigationViewItem x:Uid="Shell_FancyZones"
Tag="FancyZones">
<muxc:NavigationViewItem.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsFancyZones.png"
ShowAsMonochrome="False" />
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
<muxc:NavigationViewItem x:Uid="Shell_PowerPreview"
Tag="FileExplorer">
<muxc:NavigationViewItem.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsFileExplorerPreview.png"
ShowAsMonochrome="False" />
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
<muxc:NavigationViewItem x:Uid="Shell_ImageResizer"
Tag="ImageResizer">
<muxc:NavigationViewItem.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsImageResizer.png"
ShowAsMonochrome="False" />
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
<muxc:NavigationViewItem x:Uid="Shell_KeyboardManager"
Tag="KBM">
<muxc:NavigationViewItem.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsKeyboardManager.png"
ShowAsMonochrome="False" />
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
<muxc:NavigationViewItem x:Uid="Shell_MouseUtilities"
Tag="MouseUtils">
<muxc:NavigationViewItem.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsMouseUtils.png"
ShowAsMonochrome="False" />
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
<muxc:NavigationViewItem x:Uid="Shell_PowerRename"
Tag="PowerRename">
<muxc:NavigationViewItem.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsPowerRename.png"
ShowAsMonochrome="False" />
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
<muxc:NavigationViewItem x:Uid="Shell_PowerLauncher"
Tag="Run">
<muxc:NavigationViewItem.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsPowerToysRun.png"
ShowAsMonochrome="False" />
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
<muxc:NavigationViewItem x:Uid="Shell_ShortcutGuide"
Tag="ShortcutGuide">
<muxc:NavigationViewItem.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsShortcutGuide.png"
ShowAsMonochrome="False" />
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
<muxc:NavigationViewItem x:Uid="Shell_VideoConference"
Tag="VideoConference">
<muxc:NavigationViewItem.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsVideoConferenceMute.png"
ShowAsMonochrome="False" />
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
</muxc:NavigationView.MenuItems>
<muxc:NavigationView.FooterMenuItems>
<muxc:NavigationViewItem x:Uid="Shell_WhatsNew"
Tag="WhatsNew">
<muxc:NavigationViewItem.Icon>
<FontIcon Glyph="&#xF133;"/>
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
</muxc:NavigationView.FooterMenuItems>
<muxc:NavigationView.Content>
<Frame x:Name="NavigationFrame" />
</winui:NavigationView.Content>
</winui:NavigationView>
</muxc:NavigationView.Content>
</muxc:NavigationView>
</Grid>
</UserControl>

View File

@ -57,212 +57,125 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Views
OobeShellHandler = this;
UpdateUITheme();
Modules = new ObservableCollection<OobePowerToysModule>();
ResourceLoader loader = ResourceLoader.GetForViewIndependentUse();
Modules.Insert((int)PowerToysModulesEnum.Overview, new OobePowerToysModule()
{
ModuleName = loader.GetString("Oobe_Welcome"),
Tag = "Overview",
ModuleName = "Overview",
IsNew = false,
Icon = "\uEF3C",
Image = "ms-appx:///Assets/Modules/ColorPicker.png",
FluentIcon = "ms-appx:///Assets/FluentIcons/FluentIconsPowerToys.png",
PreviewImageSource = "ms-appx:///Assets/Modules/OOBE/OOBEPTHero.png",
DescriptionLink = "https://aka.ms/PowerToysOverview",
Link = "https://github.com/microsoft/PowerToys/releases/",
});
Modules.Insert((int)PowerToysModulesEnum.WhatsNew, new OobePowerToysModule()
{
ModuleName = loader.GetString("Oobe_WhatsNew"),
Tag = "WhatsNew",
IsNew = false,
Icon = "\uEF3C",
FluentIcon = "ms-appx:///Assets/FluentIcons/FluentIconsSettings.png",
});
Modules.Insert((int)PowerToysModulesEnum.AlwaysOnTop, new OobePowerToysModule()
{
ModuleName = loader.GetString("Oobe_AlwaysOnTop"),
Tag = "AlwaysOnTop",
ModuleName = "AlwaysOnTop",
IsNew = true,
Icon = "\uEC32",
Image = "ms-appx:///Assets/Modules/AlwaysOnTop.png",
FluentIcon = "ms-appx:///Assets/FluentIcons/FluentIconsAlwaysOnTop.png",
PreviewImageSource = "ms-appx:///Assets/Modules/OOBE/AlwaysOnTop.png",
Description = loader.GetString("Oobe_AlwaysOnTop_Description"),
Link = "https://aka.ms/PowerToysOverview_AlwaysOnTop",
});
Modules.Insert((int)PowerToysModulesEnum.Awake, new OobePowerToysModule()
{
ModuleName = loader.GetString("Oobe_Awake"),
Tag = "Awake",
ModuleName = "Awake",
IsNew = false,
Icon = "\uEC32",
Image = "ms-appx:///Assets/Modules/Awake.png",
FluentIcon = "ms-appx:///Assets/FluentIcons/FluentIconsAwake.png",
PreviewImageSource = "ms-appx:///Assets/Modules/OOBE/Awake.png",
Description = loader.GetString("Oobe_Awake_Description"),
Link = "https://aka.ms/PowerToysOverview_Awake",
});
Modules.Insert((int)PowerToysModulesEnum.ColorPicker, new OobePowerToysModule()
{
ModuleName = loader.GetString("Oobe_ColorPicker"),
Tag = "ColorPicker",
ModuleName = "ColorPicker",
IsNew = false,
Icon = "\uEF3C",
Image = "ms-appx:///Assets/Modules/ColorPicker.png",
FluentIcon = "ms-appx:///Assets/FluentIcons/FluentIconsColorPicker.png",
PreviewImageSource = "ms-appx:///Assets/Modules/OOBE/ColorPicker.gif",
Description = loader.GetString("Oobe_ColorPicker_Description"),
Link = "https://aka.ms/PowerToysOverview_ColorPicker",
});
Modules.Insert((int)PowerToysModulesEnum.FancyZones, new OobePowerToysModule()
{
ModuleName = loader.GetString("Oobe_FancyZones"),
Tag = "FancyZones",
ModuleName = "FancyZones",
IsNew = false,
Icon = "\uE737",
Image = "ms-appx:///Assets/Modules/FancyZones.png",
FluentIcon = "ms-appx:///Assets/FluentIcons/FluentIconsFancyZones.png",
PreviewImageSource = "ms-appx:///Assets/Modules/OOBE/FancyZones.gif",
Description = loader.GetString("Oobe_FancyZones_Description"),
Link = "https://aka.ms/PowerToysOverview_FancyZones",
});
Modules.Insert((int)PowerToysModulesEnum.FileExplorer, new OobePowerToysModule()
{
ModuleName = loader.GetString("Oobe_FileExplorer"),
Tag = "FileExplorer",
ModuleName = "FileExplorer",
IsNew = false,
Icon = "\uEC50",
FluentIcon = "ms-appx:///Assets/FluentIcons/FluentIconsFileExplorerPreview.png",
Image = "ms-appx:///Assets/Modules/PowerPreview.png",
Description = loader.GetString("Oobe_FileExplorer_Description"),
PreviewImageSource = "ms-appx:///Assets/Modules/OOBE/FileExplorer.png",
Link = "https://aka.ms/PowerToysOverview_FileExplorerAddOns",
});
Modules.Insert((int)PowerToysModulesEnum.ImageResizer, new OobePowerToysModule()
{
ModuleName = loader.GetString("Oobe_ImageResizer"),
Tag = "ImageResizer",
ModuleName = "ImageResizer",
IsNew = false,
Icon = "\uEB9F",
Image = "ms-appx:///Assets/Modules/ImageResizer.png",
FluentIcon = "ms-appx:///Assets/FluentIcons/FluentIconsImageResizer.png",
Description = loader.GetString("Oobe_ImageResizer_Description"),
PreviewImageSource = "ms-appx:///Assets/Modules/OOBE/ImageResizer.gif",
Link = "https://aka.ms/PowerToysOverview_ImageResizer",
});
Modules.Insert((int)PowerToysModulesEnum.KBM, new OobePowerToysModule()
{
ModuleName = loader.GetString("Oobe_KBM"),
Tag = "KBM",
ModuleName = "KBM",
IsNew = false,
Icon = "\uE765",
Image = "ms-appx:///Assets/Modules/KeyboardManager.png",
FluentIcon = "ms-appx:///Assets/FluentIcons/FluentIconsKeyboardManager.png",
Description = loader.GetString("Oobe_KBM_Description"),
PreviewImageSource = "ms-appx:///Assets/Modules/OOBE/KBM.gif",
Link = "https://aka.ms/PowerToysOverview_KeyboardManager",
});
Modules.Insert((int)PowerToysModulesEnum.MouseUtils, new OobePowerToysModule()
{
ModuleName = loader.GetString("Oobe_MouseUtils"),
Tag = "MouseUtils",
ModuleName = "MouseUtils",
IsNew = true,
Icon = "\uE962",
FluentIcon = "ms-appx:///Assets/FluentIcons/FluentIconsMouseUtils.png",
Image = "ms-appx:///Assets/Modules/MouseUtils.png",
Description = loader.GetString("Oobe_MouseUtils_Description"),
PreviewImageSource = "ms-appx:///Assets/Modules/OOBE/MouseUtils.gif",
Link = "https://aka.ms/PowerToysOverview_MouseUtilities", // TODO: Add correct link after it's been created.
});
Modules.Insert((int)PowerToysModulesEnum.PowerRename, new OobePowerToysModule()
{
ModuleName = loader.GetString("Oobe_PowerRename"),
Tag = "PowerRename",
ModuleName = "PowerRename",
IsNew = false,
Icon = "\uE8AC",
Image = "ms-appx:///Assets/Modules/PowerRename.png",
FluentIcon = "ms-appx:///Assets/FluentIcons/FluentIconsPowerRename.png",
Description = loader.GetString("Oobe_PowerRename_Description"),
PreviewImageSource = "ms-appx:///Assets/Modules/OOBE/PowerRename.gif",
Link = "https://aka.ms/PowerToysOverview_PowerRename",
});
Modules.Insert((int)PowerToysModulesEnum.Run, new OobePowerToysModule()
{
ModuleName = loader.GetString("Oobe_Run"),
Tag = "Run",
ModuleName = "Run",
IsNew = false,
Icon = "\uE773",
Image = "ms-appx:///Assets/Modules/PowerLauncher.png",
FluentIcon = "ms-appx:///Assets/FluentIcons/FluentIconsPowerToysRun.png",
PreviewImageSource = "ms-appx:///Assets/Modules/OOBE/Run.gif",
Description = loader.GetString("Oobe_PowerRun_Description"),
Link = "https://aka.ms/PowerToysOverview_PowerToysRun",
});
Modules.Insert((int)PowerToysModulesEnum.ShortcutGuide, new OobePowerToysModule()
{
ModuleName = loader.GetString("Oobe_ShortcutGuide"),
Tag = "ShortcutGuide",
ModuleName = "ShortcutGuide",
IsNew = false,
Icon = "\uEDA7",
FluentIcon = "ms-appx:///Assets/FluentIcons/FluentIconsShortcutGuide.png",
Image = "ms-appx:///Assets/Modules/ShortcutGuide.png",
Description = loader.GetString("Oobe_ShortcutGuide_Description"),
PreviewImageSource = "ms-appx:///Assets/Modules/OOBE/OOBEShortcutGuide.png",
Link = "https://aka.ms/PowerToysOverview_ShortcutGuide",
});
Modules.Insert((int)PowerToysModulesEnum.VideoConference, new OobePowerToysModule()
{
ModuleName = loader.GetString("Oobe_VideoConference"),
Tag = "VideoConference",
ModuleName = "VideoConference",
IsNew = true,
Icon = "\uEC50",
FluentIcon = "ms-appx:///Assets/FluentIcons/FluentIconsVideoConferenceMute.png",
Image = "ms-appx:///Assets/Modules/VideoConference.png",
Description = loader.GetString("Oobe_VideoConference_Description"),
PreviewImageSource = "ms-appx:///Assets/Modules/OOBE/VideoConferenceMute.png",
Link = "https://aka.ms/PowerToysOverview_VideoConference",
});
Modules.Insert((int)PowerToysModulesEnum.WhatsNew, new OobePowerToysModule()
{
ModuleName = "WhatsNew",
IsNew = false,
});
}
public void OnClosing()
{
if (NavigationView.SelectedItem != null)
Microsoft.UI.Xaml.Controls.NavigationViewItem selectedItem = NavigationView.SelectedItem as Microsoft.UI.Xaml.Controls.NavigationViewItem;
if (selectedItem != null)
{
((OobePowerToysModule)NavigationView.SelectedItem).LogClosingModuleEvent();
Modules[(int)(PowerToysModulesEnum)Enum.Parse(typeof(PowerToysModulesEnum), (string)selectedItem.Tag, true)].LogClosingModuleEvent();
}
}
public void NavigateToModule(int moduleIndex)
public void NavigateToModule(PowerToysModulesEnum selectedModule)
{
if (Modules.Count > 0)
if (selectedModule == PowerToysModulesEnum.WhatsNew)
{
NavigationView.SelectedItem = Modules[moduleIndex];
NavigationView.SelectedItem = NavigationView.FooterMenuItems[0];
}
else
{
NavigationView.SelectedItem = NavigationView.MenuItems[(int)selectedModule];
}
}
[SuppressMessage("Usage", "CA1801:Review unused parameters", Justification = "Params are required for event handler signature requirements.")]
private void NavigationView_SelectionChanged(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewSelectionChangedEventArgs args)
{
OobePowerToysModule selectedItem = args.SelectedItem as OobePowerToysModule;
Microsoft.UI.Xaml.Controls.NavigationViewItem selectedItem = args.SelectedItem as Microsoft.UI.Xaml.Controls.NavigationViewItem;
switch (selectedItem.Tag)
if (selectedItem != null)
{
case "Overview": NavigationFrame.Navigate(typeof(OobeOverview)); break;
case "WhatsNew": NavigationFrame.Navigate(typeof(OobeWhatsNew)); break;
case "AlwaysOnTop": NavigationFrame.Navigate(typeof(OobeAlwaysOnTop)); break;
case "Awake": NavigationFrame.Navigate(typeof(OobeAwake)); break;
case "ColorPicker": NavigationFrame.Navigate(typeof(OobeColorPicker)); break;
case "FancyZones": NavigationFrame.Navigate(typeof(OobeFancyZones)); break;
case "Run": NavigationFrame.Navigate(typeof(OobeRun)); break;
case "ImageResizer": NavigationFrame.Navigate(typeof(OobeImageResizer)); break;
case "KBM": NavigationFrame.Navigate(typeof(OobeKBM)); break;
case "PowerRename": NavigationFrame.Navigate(typeof(OobePowerRename)); break;
case "FileExplorer": NavigationFrame.Navigate(typeof(OobeFileExplorer)); break;
case "ShortcutGuide": NavigationFrame.Navigate(typeof(OobeShortcutGuide)); break;
case "VideoConference": NavigationFrame.Navigate(typeof(OobeVideoConference)); break;
case "MouseUtils": NavigationFrame.Navigate(typeof(OobeMouseUtils)); break;
switch (selectedItem.Tag)
{
case "Overview": NavigationFrame.Navigate(typeof(OobeOverview)); break;
case "WhatsNew": NavigationFrame.Navigate(typeof(OobeWhatsNew)); break;
case "AlwaysOnTop": NavigationFrame.Navigate(typeof(OobeAlwaysOnTop)); break;
case "Awake": NavigationFrame.Navigate(typeof(OobeAwake)); break;
case "ColorPicker": NavigationFrame.Navigate(typeof(OobeColorPicker)); break;
case "FancyZones": NavigationFrame.Navigate(typeof(OobeFancyZones)); break;
case "Run": NavigationFrame.Navigate(typeof(OobeRun)); break;
case "ImageResizer": NavigationFrame.Navigate(typeof(OobeImageResizer)); break;
case "KBM": NavigationFrame.Navigate(typeof(OobeKBM)); break;
case "PowerRename": NavigationFrame.Navigate(typeof(OobePowerRename)); break;
case "FileExplorer": NavigationFrame.Navigate(typeof(OobeFileExplorer)); break;
case "ShortcutGuide": NavigationFrame.Navigate(typeof(OobeShortcutGuide)); break;
case "VideoConference": NavigationFrame.Navigate(typeof(OobeVideoConference)); break;
case "MouseUtils": NavigationFrame.Navigate(typeof(OobeMouseUtils)); break;
}
}
}

View File

@ -8,10 +8,9 @@
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls"
mc:Ignorable="d">
<controls:OOBEPageControl ModuleTitle="{x:Bind ViewModel.ModuleName}"
ModuleImageSource="{x:Bind ViewModel.PreviewImageSource}"
ModuleDescription="{x:Bind ViewModel.Description}">
<controls:OOBEPageControl.ModuleContent>
<controls:OOBEPageControl x:Uid="Oobe_ShortcutGuide"
HeroImage="ms-appx:///Assets/Modules/OOBE/OOBEShortcutGuide.png">
<controls:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock x:Uid="Oobe_HowToLaunch"
@ -22,12 +21,12 @@
<Button x:Uid="Launch_ShortcutGuide" Style="{StaticResource AccentButtonStyle}" Click="Start_ShortcutGuide_Click"/>
<Button x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click"/>
<HyperlinkButton NavigateUri="{x:Bind ViewModel.Link}" Style="{StaticResource TextButtonStyle}">
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_ShortcutGuide" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_ShortcutGuide"
TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>
</controls:OOBEPageControl.ModuleContent>
</controls:OOBEPageControl.PageContent>
</controls:OOBEPageControl>
</Page>

View File

@ -9,11 +9,10 @@
xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls"
mc:Ignorable="d">
<controls:OOBEPageControl ModuleTitle="{x:Bind ViewModel.ModuleName}"
ModuleImageSource="{x:Bind ViewModel.PreviewImageSource}"
ModuleDescription="{x:Bind ViewModel.Description}">
<controls:OOBEPageControl x:Uid="Oobe_VideoConference"
HeroImage="ms-appx:///Assets/Modules/OOBE/VideoConferenceMute.png">
<controls:OOBEPageControl.ModuleContent>
<controls:OOBEPageControl.PageContent>
<StackPanel Orientation="Vertical">
<TextBlock x:Uid="Oobe_HowToLaunch"
Style="{ThemeResource OobeSubtitleStyle}" />
@ -27,12 +26,12 @@
<StackPanel Orientation="Horizontal" Spacing="12" Margin="0,24,0,0">
<Button x:Uid="OOBE_Settings"
Click="SettingsLaunchButton_Click"/>
<HyperlinkButton NavigateUri="{x:Bind ViewModel.Link}" Style="{StaticResource TextButtonStyle}">
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_VideoConference" Style="{StaticResource TextButtonStyle}">
<TextBlock x:Uid="LearnMore_VCM"
TextWrapping="Wrap" />
</HyperlinkButton>
</StackPanel>
</StackPanel>
</controls:OOBEPageControl.ModuleContent>
</controls:OOBEPageControl.PageContent>
</controls:OOBEPageControl>
</Page>

View File

@ -9,17 +9,17 @@
xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls"
mc:Ignorable="d"
Loaded="Page_Loaded">
<ScrollViewer
VerticalScrollBarVisibility="Auto"
Padding="32,24,32,24">
<StackPanel
Orientation="Vertical"
VerticalAlignment="Top">
<Grid Margin="0,24,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Margin="32,0,0,0" Orientation="Vertical" VerticalAlignment="Top">
<TextBlock
x:Name="TitleTxt"
Text=""
x:Uid="Oobe_WhatsNew"
AutomationProperties.HeadingLevel="Level1"
Style="{StaticResource TitleTextBlockStyle}" />
<HyperlinkButton
@ -30,23 +30,41 @@
x:Uid="Oobe_WhatsNew_DetailedReleaseNotesLink"
TextWrapping="Wrap" />
</HyperlinkButton>
<muxc:ProgressRing
</StackPanel>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<Grid Margin="32,24,32,24">
<muxc:ProgressRing Grid.Row="1"
x:Name="LoadingProgressRing"
IsIndeterminate="True"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Visibility="Visible"/>
<muxc:InfoBar
<muxc:InfoBar
Severity="Error"
x:Name="ErrorInfoBar"
Grid.Row="1"
x:Uid="Oobe_WhatsNew_LoadingError"
Visibility="Collapsed"
VerticalAlignment="Top"
IsClosable="False"
IsOpen="True"
IsTabStop="True" />
<toolkitcontrols:MarkdownTextBlock
x:Name="ReleaseNotesMarkdown"
Visibility="Collapsed"
Background="Transparent"
LinkClicked="ReleaseNotesMarkdown_LinkClicked"/>
</StackPanel>
</ScrollViewer>
<toolkitcontrols:MarkdownTextBlock x:Name="ReleaseNotesMarkdown"
Visibility="Collapsed"
Grid.Row="1"
Header1FontSize="20"
Header2FontSize="17"
Header2FontWeight="SemiBold"
Header4FontSize="14"
Header4FontWeight="SemiBold"
Header1Margin="0,16,0,0"
HorizontalRuleMargin="24"
VerticalAlignment="Top"
Background="Transparent"
ParagraphMargin="0,0,0,0"
TableMargin="24"
LinkClicked="ReleaseNotesMarkdown_LinkClicked"/>
</Grid>
</ScrollViewer>
</Grid>
</Page>

View File

@ -74,6 +74,7 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Views
{
releaseNotesHtmlBuilder.AppendLine("# " + release.Name);
releaseNotesHtmlBuilder.AppendLine(removeHashRegex.Replace(release.ReleaseNotes, string.Empty));
releaseNotesHtmlBuilder.AppendLine("&nbsp;");
}
return releaseNotesHtmlBuilder.ToString();
@ -81,8 +82,6 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Views
private async void Page_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
ResourceLoader loader = ResourceLoader.GetForViewIndependentUse();
TitleTxt.Text = loader.GetString("Oobe_WhatsNew");
try
{
string releaseNotesMarkdown = await GetReleaseNotesMarkdown();

View File

@ -1285,48 +1285,45 @@ Made with 💗 by Microsoft and the PowerToys community.</value>
<data name="Oobe_LearnMore.Text" xml:space="preserve">
<value>Learn more about</value>
</data>
<data name="Oobe_ColorPicker_Description" xml:space="preserve">
<data name="Oobe_ColorPicker.Description" xml:space="preserve">
<value>Color Picker is a system-wide color selection tool for Windows that enables you to pick colors from any currently running application and automatically copies it in a configurable format to your clipboard.</value>
</data>
<data name="Oobe_FancyZones_Description" xml:space="preserve">
<data name="Oobe_FancyZones.Description" xml:space="preserve">
<value>FancyZones is a window manager that makes it easy to create complex window layouts and quickly position windows into those layouts.</value>
</data>
<data name="Oobe_FileExplorer_Description" xml:space="preserve">
<data name="Oobe_FileExplorer.Description" xml:space="preserve">
<value>PowerToys introduces add-ons to the Windows File Explorer that will enable files like Markdown files (.md), PDF files (.pdf), SVG icons (.svg), STL files (.stl), Gcode files (.gcode) and developer files to be viewed in the preview pane. It introduces file explorer thumbnail support for a number of these file types as well.</value>
</data>
<data name="Oobe_ImageResizer_Description" xml:space="preserve">
<data name="Oobe_ImageResizer.Description" xml:space="preserve">
<value>Image Resizer is a Windows shell extension for simple bulk image-resizing.</value>
</data>
<data name="Oobe_KBM_Description" xml:space="preserve">
<data name="Oobe_KBM.Description" xml:space="preserve">
<value>Keyboard Manager allows you to customize the keyboard to be more productive by remapping keys and creating your own keyboard shortcuts.</value>
</data>
<data name="Oobe_PowerRename_Description" xml:space="preserve">
<data name="Oobe_PowerRename.Description" xml:space="preserve">
<value>PowerRename enables you to perform simple bulk renaming, searching and replacing file names.</value>
</data>
<data name="Oobe_PowerRun_Description" xml:space="preserve">
<data name="Oobe_Run.Description" xml:space="preserve">
<value>PowerToys Run is a quick launcher for power users that contains some additional features without sacrificing performance.</value>
</data>
<data name="Oobe_ShortcutGuide_Description" xml:space="preserve">
<data name="Oobe_ShortcutGuide.Description" xml:space="preserve">
<value>Shortcut Guide presents the user with a listing of available shortcuts for the current state of the desktop.</value>
</data>
<data name="Oobe_VideoConference_Description" xml:space="preserve">
<data name="Oobe_VideoConference.Description" xml:space="preserve">
<value>Video Conference Mute allows users to quickly mute the microphone and turn off the camera while on a conference call with a single keystroke, regardless of what application has focus on your computer.</value>
</data>
<data name="Oobe_MouseUtils_Description" xml:space="preserve">
<data name="Oobe_MouseUtils.Description" xml:space="preserve">
<value>A collection of utilities to enhance your mouse.</value>
<comment>Mouse as in the hardware peripheral</comment>
</data>
<data name="Oobe_Overview_Description.Text" xml:space="preserve">
<data name="Oobe_Overview.Description" xml:space="preserve">
<value>Microsoft PowerToys is a set of utilities for power users to tune and streamline their Windows experience for greater productivity.
Take a moment to preview the various utilities listed or view our comprehensive documentation.</value>
</data>
</data>
<data name="Oobe_Overview_DescriptionLinkText.Text" xml:space="preserve">
<value>Documentation on Microsoft Docs</value>
</data>
<data name="Oobe_Overview_LatestVersionLink.Text" xml:space="preserve">
<value>Release notes</value>
</data>
<data name="ReleaseNotes.Content" xml:space="preserve">
<value>Release notes</value>
</data>
@ -1400,52 +1397,52 @@ From there, simply click on one of the supported files in the File Explorer and
<data name="Oobe_VideoConference_ToggleVid.Text" xml:space="preserve">
<value>to toggle your video</value>
</data>
<data name="Oobe_ColorPicker" xml:space="preserve">
<data name="Oobe_ColorPicker.Title" xml:space="preserve">
<value>Color Picker</value>
<comment>Do not localize this string</comment>
</data>
<data name="Oobe_FancyZones" xml:space="preserve">
<data name="Oobe_FancyZones.Title" xml:space="preserve">
<value>FancyZones</value>
<comment>Do not localize this string</comment>
</data>
<data name="Oobe_ImageResizer" xml:space="preserve">
<data name="Oobe_ImageResizer.Title" xml:space="preserve">
<value>Image Resizer</value>
<comment>Do not localize this string</comment>
</data>
<data name="Oobe_KBM" xml:space="preserve">
<data name="Oobe_KBM.Title" xml:space="preserve">
<value>Keyboard Manager</value>
<comment>Do not localize this string</comment>
</data>
<data name="Oobe_Overview" xml:space="preserve">
<value>Overview</value>
</data>
<data name="Oobe_PowerRename" xml:space="preserve">
<data name="Oobe_PowerRename.Title" xml:space="preserve">
<value>PowerRename</value>
<comment>Do not localize this string</comment>
</data>
<data name="Oobe_Run" xml:space="preserve">
<data name="Oobe_Run.Title" xml:space="preserve">
<value>PowerToys Run</value>
<comment>Do not localize this string</comment>
</data>
<data name="Oobe_ShortcutGuide" xml:space="preserve">
<data name="Oobe_ShortcutGuide.Title" xml:space="preserve">
<value>Shortcut Guide</value>
<comment>Do not localize this string</comment>
</data>
<data name="Oobe_VideoConference" xml:space="preserve">
<data name="Oobe_VideoConference.Title" xml:space="preserve">
<value>Video Conference Mute</value>
<comment>Do not localize this string</comment>
</data>
<data name="Oobe_Welcome" xml:space="preserve">
<data name="Oobe_Overview.Title" xml:space="preserve">
<value>Welcome</value>
</data>
<data name="Oobe_WhatsNew" xml:space="preserve">
<value>What's new?</value>
<data name="Oobe_WhatsNew.Text" xml:space="preserve">
<value>What's new</value>
</data>
<data name="Oobe_WhatsNew_LoadingError.Title" xml:space="preserve">
<value>Couldn't load the release notes. Please check your internet connection.</value>
<value>Couldn't load the release notes.</value>
</data>
<data name="Oobe_WhatsNew_LoadingError.Message" xml:space="preserve">
<value>Please check your internet connection.</value>
</data>
<data name="Oobe_WhatsNew_DetailedReleaseNotesLink.Text" xml:space="preserve">
<value>See more detailed release notes on the GitHub repository</value>
<value>See more detailed release notes on GitHub</value>
<comment>Don't loc "GitHub", it's the name of a product</comment>
</data>
<data name="OOBE_Settings.Content" xml:space="preserve">
@ -1498,11 +1495,11 @@ From there, simply click on one of the supported files in the File Explorer and
<data name="Awake_TemporaryKeepAwake_Minutes.Header" xml:space="preserve">
<value>Minutes</value>
</data>
<data name="Oobe_Awake" xml:space="preserve">
<data name="Oobe_Awake.Title" xml:space="preserve">
<value>Awake</value>
<comment>Module name, do not loc</comment>
</data>
<data name="Oobe_Awake_Description" xml:space="preserve">
<data name="Oobe_Awake.Description" xml:space="preserve">
<value>Awake is a Windows tool designed to keep your PC awake on-demand without having to manage its power settings. This behavior can be helpful when running time-consuming tasks while ensuring that your PC does not go to sleep or turn off its screens.</value>
</data>
<data name="Oobe_Awake_HowToUse.Text" xml:space="preserve">
@ -1645,11 +1642,11 @@ From there, simply click on one of the supported files in the File Explorer and
<value>Learn more about Video Conference Mute</value>
<comment>Video Conference Mute is a product name, do not loc</comment>
</data>
<data name="Oobe_FileExplorer" xml:space="preserve">
<data name="Oobe_FileExplorer.Title" xml:space="preserve">
<value>File Explorer add-ons</value>
<comment>Do not localize this string</comment>
</data>
<data name="Oobe_MouseUtils" xml:space="preserve">
<data name="Oobe_MouseUtils.Title" xml:space="preserve">
<value>Mouse utilities</value>
<comment>Mouse as in the hardware peripheral</comment>
</data>
@ -2029,11 +2026,11 @@ From there, simply click on one of the supported files in the File Explorer and
<value>Customize the shortcut to pin or unpin an app window</value>
<comment>"Always On Top" is the name of the utility</comment>
</data>
<data name="Oobe_AlwaysOnTop" xml:space="preserve">
<data name="Oobe_AlwaysOnTop.Title" xml:space="preserve">
<value>Always On Top</value>
<comment>"Always On Top" is the name of the utility</comment>
</data>
<data name="Oobe_AlwaysOnTop_Description" xml:space="preserve">
<data name="Oobe_AlwaysOnTop.Description" xml:space="preserve">
<value>Always On Top improves your multitasking workflow by pinning an application window so it's always in front - even when focus changes to another window after that.</value>
<comment>"Always On Top" is the name of the utility</comment>
</data>
@ -2065,4 +2062,7 @@ From there, simply click on one of the supported files in the File Explorer and
<data name="FancyZones_AllowChildWindowSnap.Content" xml:space="preserve">
<value>Allow child windows snapping</value>
</data>
</root>
<data name="Shell_WhatsNew.Content" xml:space="preserve">
<value>What's new</value>
</data>
</root>