mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 12:18:50 +02:00
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:
@@ -7,8 +7,10 @@
|
||||
xmlns:Controls="clr-namespace:Microsoft.Toolkit.Wpf.UI.Controls;assembly=Microsoft.Toolkit.Wpf.UI.Controls"
|
||||
xmlns:xaml="clr-namespace:Microsoft.Toolkit.Wpf.UI.XamlHost;assembly=Microsoft.Toolkit.Wpf.UI.XamlHost"
|
||||
mc:Ignorable="d"
|
||||
Title="PowerToys Settings" Height="800" Width="1000">
|
||||
<Grid>
|
||||
Title="PowerToys Settings" Height="800" Width="800">
|
||||
|
||||
<Grid >
|
||||
<!--<xaml:WindowsXamlHost InitialTypeName="Microsoft.PowerToys.Settings.UI.Controls.DummyUserControl" ChildChanged="WindowsXamlHost_ChildChanged" />-->
|
||||
<xaml:WindowsXamlHost InitialTypeName="Microsoft.PowerToys.Settings.UI.Views.ShellPage" ChildChanged="WindowsXamlHost_ChildChanged" />
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user