Added functionality for General Settings Page (#1664)

* archive

* formmated code

* reverted changes to test class file.

* reverted changes to test file: reverted name

* added class models and updated link

* removed test console project
This commit is contained in:
Lavius Motileng
2020-03-24 19:55:02 -07:00
parent 2a0e92e4e2
commit 4243feaf37
32 changed files with 442 additions and 307 deletions

View File

@@ -5,7 +5,7 @@
using System;
using System.Windows;
using Microsoft.PowerToys.Settings.UI.Views;
using Microsoft.Toolkit.Wpf.UI.XamlHost;
using System.Threading;
namespace Microsoft.PowerToys.Settings.UI.Runner
{
@@ -23,6 +23,35 @@ namespace Microsoft.PowerToys.Settings.UI.Runner
WindowsXamlHost windowsXamlHost = sender as WindowsXamlHost;
ShellPage shellPage = windowsXamlHost.GetUwpInternalObject() as ShellPage;
if (shellPage != null)
{
shellPage.SetRestartElevatedCallback(delegate(string msg)
{
MessageBox.Show(
msg,
"Restart Elevated",
MessageBoxButton.OK);
Program.ipcmanager.SendMessage(msg);
int milliseconds = 2000;
Thread.Sleep(milliseconds);
System.Windows.Application.Current.Shutdown();
});
shellPage.SetRunOnStartUpCallback(delegate (string msg)
{
MessageBox.Show(
msg,
"Run On Start Up",
MessageBoxButton.OK);
Program.ipcmanager.SendMessage(msg);
});
}
}
if (shellPage != null)
{
}