2021-03-03 01:56:37 +08:00
|
|
|
// Copyright (c) Microsoft Corporation
|
|
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
using System.Diagnostics.CodeAnalysis;
|
2021-08-24 01:48:52 +08:00
|
|
|
using Microsoft.PowerToys.Settings.UI.Library;
|
2021-03-03 01:56:37 +08:00
|
|
|
using Microsoft.PowerToys.Settings.UI.OOBE.Enums;
|
|
|
|
using Microsoft.PowerToys.Settings.UI.OOBE.ViewModel;
|
2022-04-20 04:00:28 +08:00
|
|
|
using Microsoft.UI.Xaml;
|
|
|
|
using Microsoft.UI.Xaml.Controls;
|
2021-03-03 01:56:37 +08:00
|
|
|
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.OOBE.Views
|
|
|
|
{
|
|
|
|
public sealed partial class OobeShellPage : UserControl
|
|
|
|
{
|
|
|
|
public static Func<string> RunSharedEventCallback { get; set; }
|
|
|
|
|
|
|
|
public static void SetRunSharedEventCallback(Func<string> implementation)
|
|
|
|
{
|
|
|
|
RunSharedEventCallback = implementation;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static Func<string> ColorPickerSharedEventCallback { get; set; }
|
|
|
|
|
|
|
|
public static void SetColorPickerSharedEventCallback(Func<string> implementation)
|
|
|
|
{
|
|
|
|
ColorPickerSharedEventCallback = implementation;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static Action<Type> OpenMainWindowCallback { get; set; }
|
|
|
|
|
|
|
|
public static void SetOpenMainWindowCallback(Action<Type> implementation)
|
|
|
|
{
|
|
|
|
OpenMainWindowCallback = implementation;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets view model.
|
|
|
|
/// </summary>
|
|
|
|
public OobeShellViewModel ViewModel { get; } = new OobeShellViewModel();
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets a shell handler to be used to update contents of the shell dynamically from page within the frame.
|
|
|
|
/// </summary>
|
|
|
|
public static OobeShellPage OobeShellHandler { get; set; }
|
|
|
|
|
|
|
|
public ObservableCollection<OobePowerToysModule> Modules { get; }
|
|
|
|
|
|
|
|
public OobeShellPage()
|
|
|
|
{
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
DataContext = ViewModel;
|
|
|
|
OobeShellHandler = this;
|
2021-08-24 01:48:52 +08:00
|
|
|
UpdateUITheme();
|
2021-03-03 01:56:37 +08:00
|
|
|
Modules = new ObservableCollection<OobePowerToysModule>();
|
|
|
|
|
2022-04-20 04:00:28 +08:00
|
|
|
Modules.Insert((int)PowerToysModules.Overview, new OobePowerToysModule()
|
2021-03-03 01:56:37 +08:00
|
|
|
{
|
2022-03-08 23:27:17 +08:00
|
|
|
ModuleName = "Overview",
|
2021-03-03 01:56:37 +08:00
|
|
|
IsNew = false,
|
2022-02-22 19:02:08 +08:00
|
|
|
});
|
2022-04-20 04:00:28 +08:00
|
|
|
Modules.Insert((int)PowerToysModules.AlwaysOnTop, new OobePowerToysModule()
|
2021-12-30 01:33:20 +08:00
|
|
|
{
|
2022-03-08 23:27:17 +08:00
|
|
|
ModuleName = "AlwaysOnTop",
|
2021-12-30 01:33:20 +08:00
|
|
|
IsNew = true,
|
|
|
|
});
|
2022-04-20 04:00:28 +08:00
|
|
|
Modules.Insert((int)PowerToysModules.Awake, new OobePowerToysModule()
|
Espresso (#11303)
* Update README.md
* Espresso (#11245)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Update Product.wxs
* Update Shortcut.cpp
* Update with more logging (#11332)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
* Adding some extra logging
* Update Shortcut.cpp
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Fix minor issue in the module branch (#11340)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
* Adding some extra logging
* Update Shortcut.cpp
* Fix log location coming from the runner
* More chatty logging for console allocation
* Installer config to add the missing assets
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Update Product.wxs
* Update Program.cs
* fixing typo
* removing a unneeded removal
* [Espresso] More minor tweaks to logging (#11341)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
* Adding some extra logging
* Update Shortcut.cpp
* Fix log location coming from the runner
* More chatty logging for console allocation
* Installer config to add the missing assets
* Remove unused handle codes
* Update log file name for the Espresso C++ code.
* Update the project configuration to fix build issue
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Update patterns.txt
* Fix binding issues (#11368)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
* Adding some extra logging
* Update Shortcut.cpp
* Fix log location coming from the runner
* More chatty logging for console allocation
* Installer config to add the missing assets
* Remove unused handle codes
* Update log file name for the Espresso C++ code.
* Update the project configuration to fix build issue
* Fix binding issue with the time settings
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Introduce the off mode and fix binding issues (#11385)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
* Adding some extra logging
* Update Shortcut.cpp
* Fix log location coming from the runner
* More chatty logging for console allocation
* Installer config to add the missing assets
* Remove unused handle codes
* Update log file name for the Espresso C++ code.
* Update the project configuration to fix build issue
* Fix binding issue with the time settings
* Proper Espresso behavior for binding
* Fix settings UI
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Update with missing strings. (#11386)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
* Adding some extra logging
* Update Shortcut.cpp
* Fix log location coming from the runner
* More chatty logging for console allocation
* Installer config to add the missing assets
* Remove unused handle codes
* Update log file name for the Espresso C++ code.
* Update the project configuration to fix build issue
* Fix binding issue with the time settings
* Proper Espresso behavior for binding
* Fix settings UI
* Re-add missing strings
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Fix whitespace issue (#11387)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
* Adding some extra logging
* Update Shortcut.cpp
* Fix log location coming from the runner
* More chatty logging for console allocation
* Installer config to add the missing assets
* Remove unused handle codes
* Update log file name for the Espresso C++ code.
* Update the project configuration to fix build issue
* Fix binding issue with the time settings
* Proper Espresso behavior for binding
* Fix settings UI
* Re-add missing strings
* Fix whitespace issue
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Fix default (#11388)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
* Adding some extra logging
* Update Shortcut.cpp
* Fix log location coming from the runner
* More chatty logging for console allocation
* Installer config to add the missing assets
* Remove unused handle codes
* Update log file name for the Espresso C++ code.
* Update the project configuration to fix build issue
* Fix binding issue with the time settings
* Proper Espresso behavior for binding
* Fix settings UI
* Re-add missing strings
* Fix whitespace issue
* Fix the default mode of operation
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Update Microsoft.PowerToys.Settings.UI.csproj
* Localization improvements
* Replaced a computer with your pc
* Updated Espresso imagery
* Fixed inconsistent string
* Margin fix and updated images
* Removed unused code
Co-authored-by: Den Delimarsky <1389609+dend@users.noreply.github.com>
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
Co-authored-by: Enrico Giordani <enrico.giordani@gmail.com>
2021-05-26 01:13:04 +08:00
|
|
|
{
|
2022-03-08 23:27:17 +08:00
|
|
|
ModuleName = "Awake",
|
Espresso (#11303)
* Update README.md
* Espresso (#11245)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Update Product.wxs
* Update Shortcut.cpp
* Update with more logging (#11332)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
* Adding some extra logging
* Update Shortcut.cpp
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Fix minor issue in the module branch (#11340)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
* Adding some extra logging
* Update Shortcut.cpp
* Fix log location coming from the runner
* More chatty logging for console allocation
* Installer config to add the missing assets
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Update Product.wxs
* Update Program.cs
* fixing typo
* removing a unneeded removal
* [Espresso] More minor tweaks to logging (#11341)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
* Adding some extra logging
* Update Shortcut.cpp
* Fix log location coming from the runner
* More chatty logging for console allocation
* Installer config to add the missing assets
* Remove unused handle codes
* Update log file name for the Espresso C++ code.
* Update the project configuration to fix build issue
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Update patterns.txt
* Fix binding issues (#11368)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
* Adding some extra logging
* Update Shortcut.cpp
* Fix log location coming from the runner
* More chatty logging for console allocation
* Installer config to add the missing assets
* Remove unused handle codes
* Update log file name for the Espresso C++ code.
* Update the project configuration to fix build issue
* Fix binding issue with the time settings
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Introduce the off mode and fix binding issues (#11385)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
* Adding some extra logging
* Update Shortcut.cpp
* Fix log location coming from the runner
* More chatty logging for console allocation
* Installer config to add the missing assets
* Remove unused handle codes
* Update log file name for the Espresso C++ code.
* Update the project configuration to fix build issue
* Fix binding issue with the time settings
* Proper Espresso behavior for binding
* Fix settings UI
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Update with missing strings. (#11386)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
* Adding some extra logging
* Update Shortcut.cpp
* Fix log location coming from the runner
* More chatty logging for console allocation
* Installer config to add the missing assets
* Remove unused handle codes
* Update log file name for the Espresso C++ code.
* Update the project configuration to fix build issue
* Fix binding issue with the time settings
* Proper Espresso behavior for binding
* Fix settings UI
* Re-add missing strings
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Fix whitespace issue (#11387)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
* Adding some extra logging
* Update Shortcut.cpp
* Fix log location coming from the runner
* More chatty logging for console allocation
* Installer config to add the missing assets
* Remove unused handle codes
* Update log file name for the Espresso C++ code.
* Update the project configuration to fix build issue
* Fix binding issue with the time settings
* Proper Espresso behavior for binding
* Fix settings UI
* Re-add missing strings
* Fix whitespace issue
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Fix default (#11388)
* Revert "Merge branch 'microsoft:master' into master"
This reverts commit b080908712557fce0e93a98e8d3bcb58fbd111fc, reversing
changes made to 8463c95a43a737532ae21dfa9aee1894a3a37dde.
* Fix conversion of settings in the UX
* Update terminology
* Updating logging configuration
* Set up how tray and setting configuration works
* Adding hero images
* Fix how binding works
* Update OOBE string
* Fix spelling error
* fixing dep to include espresso, adding in yml
* Update API components and fix display keep-awake bug
* Adding words that the spell check is yelling about
* tweak wsx
* Change default setting for Espresso
* Adding some extra logging
* Update Shortcut.cpp
* Fix log location coming from the runner
* More chatty logging for console allocation
* Installer config to add the missing assets
* Remove unused handle codes
* Update log file name for the Espresso C++ code.
* Update the project configuration to fix build issue
* Fix binding issue with the time settings
* Proper Espresso behavior for binding
* Fix settings UI
* Re-add missing strings
* Fix whitespace issue
* Fix the default mode of operation
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
* Update Microsoft.PowerToys.Settings.UI.csproj
* Localization improvements
* Replaced a computer with your pc
* Updated Espresso imagery
* Fixed inconsistent string
* Margin fix and updated images
* Removed unused code
Co-authored-by: Den Delimarsky <1389609+dend@users.noreply.github.com>
Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: crutkas <crutkas@microsoft.com>
Co-authored-by: Enrico Giordani <enrico.giordani@gmail.com>
2021-05-26 01:13:04 +08:00
|
|
|
IsNew = false,
|
|
|
|
});
|
2022-04-20 04:00:28 +08:00
|
|
|
Modules.Insert((int)PowerToysModules.ColorPicker, new OobePowerToysModule()
|
2021-06-15 01:34:32 +08:00
|
|
|
{
|
2022-03-08 23:27:17 +08:00
|
|
|
ModuleName = "ColorPicker",
|
2021-06-15 01:34:32 +08:00
|
|
|
IsNew = false,
|
|
|
|
});
|
2022-04-20 04:00:28 +08:00
|
|
|
Modules.Insert((int)PowerToysModules.FancyZones, new OobePowerToysModule()
|
2021-03-03 01:56:37 +08:00
|
|
|
{
|
2022-03-08 23:27:17 +08:00
|
|
|
ModuleName = "FancyZones",
|
2021-03-03 01:56:37 +08:00
|
|
|
IsNew = false,
|
|
|
|
});
|
2022-04-20 04:00:28 +08:00
|
|
|
Modules.Insert((int)PowerToysModules.FileExplorer, new OobePowerToysModule()
|
2021-03-04 20:33:50 +08:00
|
|
|
{
|
2022-03-08 23:27:17 +08:00
|
|
|
ModuleName = "FileExplorer",
|
2021-03-04 20:33:50 +08:00
|
|
|
IsNew = false,
|
|
|
|
});
|
2022-04-20 04:00:28 +08:00
|
|
|
Modules.Insert((int)PowerToysModules.ImageResizer, new OobePowerToysModule()
|
2021-03-03 01:56:37 +08:00
|
|
|
{
|
2022-03-08 23:27:17 +08:00
|
|
|
ModuleName = "ImageResizer",
|
2021-03-03 01:56:37 +08:00
|
|
|
IsNew = false,
|
|
|
|
});
|
2022-04-20 04:00:28 +08:00
|
|
|
Modules.Insert((int)PowerToysModules.KBM, new OobePowerToysModule()
|
2021-03-03 01:56:37 +08:00
|
|
|
{
|
2022-03-08 23:27:17 +08:00
|
|
|
ModuleName = "KBM",
|
2021-03-03 01:56:37 +08:00
|
|
|
IsNew = false,
|
|
|
|
});
|
2022-04-20 04:00:28 +08:00
|
|
|
Modules.Insert((int)PowerToysModules.MouseUtils, new OobePowerToysModule()
|
2021-10-22 20:30:18 +08:00
|
|
|
{
|
2022-03-08 23:27:17 +08:00
|
|
|
ModuleName = "MouseUtils",
|
2021-10-22 20:30:18 +08:00
|
|
|
IsNew = true,
|
|
|
|
});
|
2022-08-25 18:25:52 +08:00
|
|
|
Modules.Insert((int)PowerToysModules.PowerOCR, new OobePowerToysModule()
|
|
|
|
{
|
|
|
|
ModuleName = "PowerOCR",
|
|
|
|
IsNew = true,
|
|
|
|
});
|
2022-04-20 04:00:28 +08:00
|
|
|
Modules.Insert((int)PowerToysModules.PowerRename, new OobePowerToysModule()
|
2021-03-03 01:56:37 +08:00
|
|
|
{
|
2022-03-08 23:27:17 +08:00
|
|
|
ModuleName = "PowerRename",
|
2021-03-03 01:56:37 +08:00
|
|
|
IsNew = false,
|
|
|
|
});
|
2022-04-20 04:00:28 +08:00
|
|
|
Modules.Insert((int)PowerToysModules.Run, new OobePowerToysModule()
|
2021-04-05 17:15:08 +08:00
|
|
|
{
|
2022-03-08 23:27:17 +08:00
|
|
|
ModuleName = "Run",
|
2021-04-05 17:15:08 +08:00
|
|
|
IsNew = false,
|
|
|
|
});
|
2022-04-20 04:00:28 +08:00
|
|
|
Modules.Insert((int)PowerToysModules.ShortcutGuide, new OobePowerToysModule()
|
2021-03-03 01:56:37 +08:00
|
|
|
{
|
2022-03-08 23:27:17 +08:00
|
|
|
ModuleName = "ShortcutGuide",
|
2021-03-03 01:56:37 +08:00
|
|
|
IsNew = false,
|
|
|
|
});
|
2021-08-24 01:48:52 +08:00
|
|
|
|
2022-04-20 04:00:28 +08:00
|
|
|
Modules.Insert((int)PowerToysModules.VideoConference, new OobePowerToysModule()
|
2021-03-03 01:56:37 +08:00
|
|
|
{
|
2022-03-08 23:27:17 +08:00
|
|
|
ModuleName = "VideoConference",
|
2021-03-03 01:56:37 +08:00
|
|
|
IsNew = true,
|
2022-03-08 23:27:17 +08:00
|
|
|
});
|
2022-04-20 04:00:28 +08:00
|
|
|
Modules.Insert((int)PowerToysModules.WhatsNew, new OobePowerToysModule()
|
2022-03-08 23:27:17 +08:00
|
|
|
{
|
|
|
|
ModuleName = "WhatsNew",
|
|
|
|
IsNew = false,
|
2021-10-07 21:48:45 +08:00
|
|
|
});
|
2021-03-03 01:56:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public void OnClosing()
|
|
|
|
{
|
2022-04-20 04:00:28 +08:00
|
|
|
Microsoft.UI.Xaml.Controls.NavigationViewItem selectedItem = this.NavigationView.SelectedItem as Microsoft.UI.Xaml.Controls.NavigationViewItem;
|
2022-03-08 23:27:17 +08:00
|
|
|
if (selectedItem != null)
|
2021-03-03 01:56:37 +08:00
|
|
|
{
|
2022-04-20 04:00:28 +08:00
|
|
|
Modules[(int)(PowerToysModules)Enum.Parse(typeof(PowerToysModules), (string)selectedItem.Tag, true)].LogClosingModuleEvent();
|
2021-03-03 01:56:37 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-20 04:00:28 +08:00
|
|
|
public void NavigateToModule(PowerToysModules selectedModule)
|
2021-03-03 01:56:37 +08:00
|
|
|
{
|
2022-04-20 04:00:28 +08:00
|
|
|
if (selectedModule == PowerToysModules.WhatsNew)
|
2022-03-08 23:27:17 +08:00
|
|
|
{
|
|
|
|
NavigationView.SelectedItem = NavigationView.FooterMenuItems[0];
|
|
|
|
}
|
|
|
|
else
|
2021-03-03 01:56:37 +08:00
|
|
|
{
|
2022-03-08 23:27:17 +08:00
|
|
|
NavigationView.SelectedItem = NavigationView.MenuItems[(int)selectedModule];
|
2021-03-03 01:56:37 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[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)
|
|
|
|
{
|
2022-03-08 23:27:17 +08:00
|
|
|
Microsoft.UI.Xaml.Controls.NavigationViewItem selectedItem = args.SelectedItem as Microsoft.UI.Xaml.Controls.NavigationViewItem;
|
|
|
|
|
|
|
|
if (selectedItem != null)
|
|
|
|
{
|
|
|
|
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;
|
2022-08-25 18:25:52 +08:00
|
|
|
case "PowerOCR": NavigationFrame.Navigate(typeof(OobePowerOCR)); break;
|
2022-03-08 23:27:17 +08:00
|
|
|
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;
|
|
|
|
}
|
2021-03-03 01:56:37 +08:00
|
|
|
}
|
|
|
|
}
|
2021-08-24 01:48:52 +08:00
|
|
|
|
|
|
|
public void UpdateUITheme()
|
|
|
|
{
|
2021-09-07 02:21:18 +08:00
|
|
|
switch (SettingsRepository<GeneralSettings>.GetInstance(new SettingsUtils()).SettingsConfig.Theme.ToUpperInvariant())
|
2021-08-24 01:48:52 +08:00
|
|
|
{
|
|
|
|
case "LIGHT":
|
|
|
|
this.RequestedTheme = ElementTheme.Light;
|
|
|
|
break;
|
|
|
|
case "DARK":
|
|
|
|
this.RequestedTheme = ElementTheme.Dark;
|
|
|
|
break;
|
|
|
|
case "SYSTEM":
|
|
|
|
this.RequestedTheme = ElementTheme.Default;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2021-03-03 01:56:37 +08:00
|
|
|
}
|
|
|
|
}
|