mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 20:27:36 +02:00
[OOBE] Out of box experience window (#9973)
This commit is contained in:
@@ -187,6 +187,10 @@
|
||||
RelativePanel.Below="AboutImage"
|
||||
Orientation="Vertical" >
|
||||
|
||||
<HyperlinkButton Click="OobeButton_Click">
|
||||
<TextBlock x:Uid="Oobe_Button"/>
|
||||
</HyperlinkButton>
|
||||
|
||||
<HyperlinkButton x:Uid="GeneralPage_ImageHyperlinkToDocs">
|
||||
<TextBlock x:Uid="General_Repository"/>
|
||||
</HyperlinkButton>
|
||||
|
||||
@@ -122,5 +122,10 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
{
|
||||
Helpers.StartProcessHelper.Start(Helpers.StartProcessHelper.ColorsSettings);
|
||||
}
|
||||
|
||||
private void OobeButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShellPage.OpenOobeWindowCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
</ic:EventTriggerBehavior>
|
||||
</i:Interaction.Behaviors>
|
||||
<ScrollViewer x:Name="scrollViewer"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
Grid.Column="0">
|
||||
<Grid Margin="{StaticResource MediumLeftRightBottomMargin}">
|
||||
<Frame x:Name="shellFrame" />
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
// 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.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Microsoft.PowerToys.Settings.UI.Services;
|
||||
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
||||
using Windows.Data.Json;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
@@ -21,6 +23,11 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
/// <param name="msg">message.</param>
|
||||
public delegate void IPCMessageCallback(string msg);
|
||||
|
||||
/// <summary>
|
||||
/// Declaration for the opening oobe window callback function.
|
||||
/// </summary>
|
||||
public delegate void OobeOpeningCallback();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a shell handler to be used to update contents of the shell dynamically from page within the frame.
|
||||
/// </summary>
|
||||
@@ -41,6 +48,11 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
/// </summary>
|
||||
public static IPCMessageCallback CheckForUpdatesMsgCallback { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets callback function for opening oobe window
|
||||
/// </summary>
|
||||
public static OobeOpeningCallback OpenOobeWindowCallback { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets view model.
|
||||
/// </summary>
|
||||
@@ -114,6 +126,15 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
CheckForUpdatesMsgCallback = implementation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set oobe opening callback function
|
||||
/// </summary>
|
||||
/// <param name="implementation">delegate function implementation.</param>
|
||||
public static void SetOpenOobeCallback(OobeOpeningCallback implementation)
|
||||
{
|
||||
OpenOobeWindowCallback = implementation;
|
||||
}
|
||||
|
||||
public static void SetElevationStatus(bool isElevated)
|
||||
{
|
||||
IsElevated = isElevated;
|
||||
@@ -124,6 +145,11 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
IsUserAnAdmin = isAdmin;
|
||||
}
|
||||
|
||||
public static void Navigate(Type type)
|
||||
{
|
||||
NavigationService.Navigate(type);
|
||||
}
|
||||
|
||||
public void Refresh()
|
||||
{
|
||||
shellFrame.Navigate(typeof(GeneralPage));
|
||||
|
||||
Reference in New Issue
Block a user