mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +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:
@@ -134,29 +134,13 @@
|
||||
<Compile Include="Services\ActivationService.cs" />
|
||||
<Compile Include="Services\NavigationService.cs" />
|
||||
<Compile Include="ViewModels\GeneralViewModel.cs" />
|
||||
<Compile Include="ViewModels\MainViewModel.cs" />
|
||||
<Compile Include="ViewModels\ShellViewModel.cs" />
|
||||
<Compile Include="ViewModels\Test1ViewModel.cs" />
|
||||
<Compile Include="ViewModels\Test2ViewModel.cs" />
|
||||
<Compile Include="ViewModels\Test3ViewModel.cs" />
|
||||
<Compile Include="Views\GeneralPage.xaml.cs">
|
||||
<DependentUpon>GeneralPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\MainPage.xaml.cs">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ShellPage.xaml.cs">
|
||||
<DependentUpon>ShellPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Test1Page.xaml.cs">
|
||||
<DependentUpon>Test1Page.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Test2Page.xaml.cs">
|
||||
<DependentUpon>Test2Page.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Test3Page.xaml.cs">
|
||||
<DependentUpon>Test3Page.xaml</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest">
|
||||
@@ -187,6 +171,9 @@
|
||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed">
|
||||
<Version>2.0.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Newtonsoft.Json">
|
||||
<Version>12.0.3</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PRIResource Include="Strings\en-us\Resources.resw" />
|
||||
@@ -220,26 +207,16 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\MainPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Views\ShellPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Views\Test1Page.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Views\Test2Page.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Views\Test3Page.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Microsoft.PowerToys.Settings.UI.Lib\Microsoft.PowerToys.Settings.UI.Lib.csproj">
|
||||
<Project>{b1bcc8c6-46b5-4bfa-8f22-20f32d99ec6a}</Project>
|
||||
<Name>Microsoft.PowerToys.Settings.UI.Lib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
|
||||
<VisualStudioVersion>14.0</VisualStudioVersion>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using System;
|
||||
|
||||
using System.IO;
|
||||
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
{
|
||||
public class MainViewModel : Observable
|
||||
{
|
||||
public MainViewModel()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||
using Microsoft.PowerToys.Settings.UI.Services;
|
||||
|
||||
using Windows.System;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
|
||||
using WinUI = Microsoft.UI.Xaml.Controls;
|
||||
// <copyright file="ShellViewModel.cs" company="Microsoft Corp">
|
||||
// Copyright (c) Microsoft Corp. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||
using Microsoft.PowerToys.Settings.UI.Services;
|
||||
using Windows.System;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using WinUI = Microsoft.UI.Xaml.Controls;
|
||||
|
||||
public class ShellViewModel : Observable
|
||||
{
|
||||
private readonly KeyboardAccelerator _altLeftKeyboardAccelerator = BuildKeyboardAccelerator(VirtualKey.Left, VirtualKeyModifiers.Menu);
|
||||
|
||||
private readonly KeyboardAccelerator _backKeyboardAccelerator = BuildKeyboardAccelerator(VirtualKey.GoBack);
|
||||
|
||||
private bool _isBackEnabled;
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
{
|
||||
public class Test1ViewModel : Observable
|
||||
{
|
||||
public Test1ViewModel()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
{
|
||||
public class Test2ViewModel : Observable
|
||||
{
|
||||
public Test2ViewModel()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
{
|
||||
public class Test3ViewModel : Observable
|
||||
{
|
||||
public Test3ViewModel()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,17 +13,22 @@
|
||||
<ScrollViewer>
|
||||
<StackPanel Orientation="Vertical" Margin="14,0,14,48">
|
||||
|
||||
<ToggleSwitch Header="Start at startup" IsOn="True" Margin="0,14,0,0" />
|
||||
<ToggleSwitch Header="Run at startup" x:Name="ToggleSwitch_RunAtStartUp" Margin="0,14,0,0" Toggled="ToggleSwitch_RunAtStartUp_Toggled" />
|
||||
|
||||
<muxc:RadioButtons Header="Theme" Margin="0, 28,0,0">
|
||||
<RadioButton Content="Dark"/>
|
||||
<RadioButton Content="Light"/>
|
||||
<RadioButton Content="System default" IsChecked="True"/>
|
||||
<RadioButton x:Name="Rodio_Theme_Dark" Content="Dark" Tag="Dark" Checked="Theme_Changed"/>
|
||||
<RadioButton x:Name="Rodio_Theme_Light" Content="Light" Tag="Light" Checked="Theme_Changed"/>
|
||||
<RadioButton x:Name="Rodio_Theme_Default" Content="System default" Tag="System" Checked="Theme_Changed"/>
|
||||
</muxc:RadioButtons>
|
||||
|
||||
<!--
|
||||
<ToggleSwitch Header="Disable telemetry" IsOn="True" Margin="0,14,0,0" />
|
||||
<TextBlock Text="PowerToys currently respects the Windows data & feedback setting" Opacity="0.8" Margin="0,0,0,0" />
|
||||
-->
|
||||
|
||||
<Button Background="{ThemeResource SystemAccentColor}" Content="Restart as admin" Margin="0,10,0,0" Foreground="White" Click="Restart_Elevated" />
|
||||
|
||||
<!--
|
||||
<TextBlock Text="Default apps" Style="{StaticResource SubtitleTextBlockStyle}" Margin="0,34,0,8"/>
|
||||
<ComboBox Header="Shell" SelectedIndex="0" MinWidth="240" Margin="0,14,0,0">
|
||||
<ComboBoxItem>PowerShell</ComboBoxItem>
|
||||
@@ -31,14 +36,16 @@
|
||||
<ComboBox Header="Terminal" SelectedIndex="0" MinWidth="240" Margin="0,14,0,0">
|
||||
<ComboBoxItem>Windows Console</ComboBoxItem>
|
||||
</ComboBox>
|
||||
-->
|
||||
|
||||
<TextBlock Text="About PowerToys" Style="{StaticResource SubtitleTextBlockStyle}" Margin="0,34,0,8"/>
|
||||
<TextBlock FontWeight="Bold" Text="Version 0.15.1.0" Margin="0,14,0,0" />
|
||||
<Button Background="{ThemeResource SystemAccentColor}" Content="Check for updates" Margin="0,10,0,0" Foreground="White"/>
|
||||
<!-- TO DO: The styling of this button should be improved so the hover/pressed states are representing the SystemAccentColor -->
|
||||
<!--<Button Background="{ThemeResource SystemAccentColor}" Content="Check for updates" Margin="0,10,0,0" Foreground="White" />
|
||||
TO DO: The styling of this button should be improved so the hover/pressed states are representing the SystemAccentColor -->
|
||||
|
||||
<HyperlinkButton Content="Report a bug" Margin="0,14,0,0" />
|
||||
<HyperlinkButton Content="Request a feature" />
|
||||
<HyperlinkButton Content="Privacy statement" />
|
||||
<HyperlinkButton Content="Report a bug" Margin="0,14,0,0" NavigateUri="https://github.com/microsoft/PowerToys/issues" />
|
||||
<HyperlinkButton Content="Request a feature" NavigateUri="https://github.com/microsoft/PowerToys/issues"/>
|
||||
<HyperlinkButton Content="Privacy statement" NavigateUri=" http://go.microsoft.com/fwlink/?LinkId=521839" />
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
|
||||
@@ -1,29 +1,128 @@
|
||||
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Controls.Primitives;
|
||||
using Windows.UI.Xaml.Data;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
|
||||
// <copyright file="GeneralPage.xaml.cs" company="Microsoft Corp">
|
||||
// Copyright (c) Microsoft Corp. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.PowerToys.Settings.UI.Lib;
|
||||
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
||||
using Windows.UI.Popups;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
|
||||
/// <summary>
|
||||
/// General Settings Page.
|
||||
/// </summary>
|
||||
public sealed partial class GeneralPage : Page
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets view model.
|
||||
/// </summary>
|
||||
public GeneralViewModel ViewModel { get; } = new GeneralViewModel();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GeneralPage"/> class.
|
||||
/// General Settings page constructor.
|
||||
/// </summary>
|
||||
public GeneralPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
GeneralSettings settings = SettingsUtils.GetSettings<GeneralSettings>(string.Empty);
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
// load and apply theme settings
|
||||
this.ReLoadTheme(settings.theme);
|
||||
|
||||
// load run on start up ui settings value and update the ui state.
|
||||
this.ToggleSwitch_RunAtStartUp.IsOn = settings.startup;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update and save theme settings to json file.
|
||||
/// </summary>
|
||||
/// <param name="themeName">theme name.</param>
|
||||
private void ReLoadTheme(string themeName)
|
||||
{
|
||||
switch (themeName.ToLower())
|
||||
{
|
||||
case "light":
|
||||
ShellPage.ShellHandler.RequestedTheme = ElementTheme.Light;
|
||||
this.Rodio_Theme_Light.IsChecked = true;
|
||||
break;
|
||||
case "dark":
|
||||
ShellPage.ShellHandler.RequestedTheme = ElementTheme.Dark;
|
||||
this.Rodio_Theme_Dark.IsChecked = true;
|
||||
break;
|
||||
case "system":
|
||||
ShellPage.ShellHandler.RequestedTheme = ElementTheme.Default;
|
||||
this.Rodio_Theme_Default.IsChecked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleSwitch_RunAtStartUp_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ToggleSwitch swt = sender as ToggleSwitch;
|
||||
|
||||
if (swt != null)
|
||||
{
|
||||
GeneralSettings settings = SettingsUtils.GetSettings<GeneralSettings>(string.Empty);
|
||||
|
||||
string startup = swt.IsOn.ToString().ToLower();
|
||||
switch (startup)
|
||||
{
|
||||
case "true":
|
||||
settings.startup = true;
|
||||
break;
|
||||
case "false":
|
||||
settings.startup = false;
|
||||
break;
|
||||
}
|
||||
|
||||
SettingsUtils.SaveSettings<GeneralSettings>(settings, string.Empty);
|
||||
OutGoingGeneralSettings outsettings = new OutGoingGeneralSettings(settings);
|
||||
|
||||
if (ShellPage.Run_OnStartUp_Callback != null)
|
||||
{
|
||||
ShellPage.Run_OnStartUp_Callback(outsettings.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Restart_Elevated(object sender, RoutedEventArgs e)
|
||||
{
|
||||
GeneralSettings settings = SettingsUtils.GetSettings<GeneralSettings>(string.Empty);
|
||||
settings.run_elevated = true;
|
||||
OutGoingGeneralSettings outsettings = new OutGoingGeneralSettings(settings);
|
||||
|
||||
if (ShellPage.Restart_Elevated_Callback != null)
|
||||
{
|
||||
ShellPage.Restart_Elevated_Callback(outsettings.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void Theme_Changed(object sender, RoutedEventArgs e)
|
||||
{
|
||||
RadioButton rb = sender as RadioButton;
|
||||
|
||||
if (rb != null)
|
||||
{
|
||||
string themeName = rb.Tag.ToString();
|
||||
this.ReLoadTheme(themeName);
|
||||
|
||||
// update and save settings to file.
|
||||
GeneralSettings settings = SettingsUtils.GetSettings<GeneralSettings>(string.Empty);
|
||||
settings.theme = themeName;
|
||||
SettingsUtils.SaveSettings<GeneralSettings>(settings,string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<Page
|
||||
x:Class="Microsoft.PowerToys.Settings.UI.Views.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Style="{StaticResource PageStyle}"
|
||||
mc:Ignorable="d">
|
||||
<Grid x:Name="ContentArea" Margin="{StaticResource MediumLeftRightMargin}">
|
||||
<Grid
|
||||
Background="{ThemeResource SystemControlPageBackgroundChromeLowBrush}">
|
||||
<!--
|
||||
The SystemControlPageBackgroundChromeLowBrush background represents where you should place your content.
|
||||
Place your content here.
|
||||
-->
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
||||
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
{
|
||||
public sealed partial class MainPage : Page
|
||||
{
|
||||
public MainViewModel ViewModel { get; } = new MainViewModel();
|
||||
|
||||
public MainPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,10 +52,10 @@
|
||||
<FontIcon Glyph=""/>
|
||||
</winui:NavigationViewItem.Icon>
|
||||
</winui:NavigationViewItem>
|
||||
<winui:NavigationViewItem x:Uid="Shell_Main" Icon="Home" helpers:NavHelper.NavigateTo="views:MainPage" />
|
||||
<!--<winui:NavigationViewItem x:Uid="Shell_Main" Icon="Home" helpers:NavHelper.NavigateTo="views:MainPage" />
|
||||
<winui:NavigationViewItem x:Uid="Shell_Test1" Icon="Play" helpers:NavHelper.NavigateTo="views:Test1Page" />
|
||||
<winui:NavigationViewItem x:Uid="Shell_Test2" Icon="Refresh" helpers:NavHelper.NavigateTo="views:Test2Page" />
|
||||
<winui:NavigationViewItem x:Uid="Shell_Test3" Icon="Save" helpers:NavHelper.NavigateTo="views:Test3Page" />
|
||||
<winui:NavigationViewItem x:Uid="Shell_Test3" Icon="Save" helpers:NavHelper.NavigateTo="views:Test3Page" />-->
|
||||
</winui:NavigationView.MenuItems>
|
||||
<i:Interaction.Behaviors>
|
||||
<behaviors:NavigationViewHeaderBehavior
|
||||
|
||||
@@ -1,25 +1,79 @@
|
||||
using System;
|
||||
using Microsoft.PowerToys.Settings.UI.Activation;
|
||||
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||
using Microsoft.PowerToys.Settings.UI.Services;
|
||||
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
||||
|
||||
using Windows.UI.Xaml.Controls;
|
||||
// <copyright file="ShellPage.xaml.cs" company="Microsoft Corp">
|
||||
// Copyright (c) Microsoft Corp. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
{
|
||||
// TODO WTS: Change the icons and titles for all NavigationViewItems in ShellPage.xaml.
|
||||
using System;
|
||||
using Microsoft.PowerToys.Settings.UI.Activation;
|
||||
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||
using Microsoft.PowerToys.Settings.UI.Services;
|
||||
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Root page.
|
||||
/// </summary>
|
||||
public sealed partial class ShellPage : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Delcaration for the ipc callback function.
|
||||
/// </summary>
|
||||
/// <param name="msg">message.</param>
|
||||
public delegate void IPCMessageCallback(string msg);
|
||||
|
||||
/// <summary>
|
||||
/// Gets view model.
|
||||
/// </summary>
|
||||
public ShellViewModel ViewModel { get; } = new ShellViewModel();
|
||||
|
||||
/// <summary>
|
||||
/// A shell handler to be used to update contents of the shell dynamically from page within the frame.
|
||||
/// </summary>
|
||||
public static Microsoft.UI.Xaml.Controls.NavigationView ShellHandler = null;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// IPC callback function for restart elevated.
|
||||
/// </summary>
|
||||
public static IPCMessageCallback Restart_Elevated_Callback = null;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// IPC callback function for run on start up.
|
||||
/// </summary>
|
||||
public static IPCMessageCallback Run_OnStartUp_Callback = null;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ShellPage"/> class.
|
||||
/// Shell page constructor.
|
||||
/// </summary>
|
||||
public ShellPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
DataContext = ViewModel;
|
||||
ViewModel.Initialize(shellFrame, navigationView, KeyboardAccelerators);
|
||||
NavigationService.Navigate(typeof(MainPage));
|
||||
this.InitializeComponent();
|
||||
|
||||
this.DataContext = this.ViewModel;
|
||||
ShellHandler = this.navigationView;
|
||||
this.ViewModel.Initialize(this.shellFrame, this.navigationView, this.KeyboardAccelerators);
|
||||
this.shellFrame.Navigate(typeof(GeneralPage));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restart elevated callback function initialization.
|
||||
/// </summary>
|
||||
/// <param name="implmentation">delegate function implementation.</param>
|
||||
public void SetRestartElevatedCallback(IPCMessageCallback implmentation)
|
||||
{
|
||||
Restart_Elevated_Callback = implmentation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run on start up callback function elevated initialization.
|
||||
/// </summary>
|
||||
/// <param name="implmentation">delegate function implementation.</param>
|
||||
public void SetRunOnStartUpCallback(IPCMessageCallback implmentation)
|
||||
{
|
||||
Run_OnStartUp_Callback = implmentation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<Page
|
||||
x:Class="Microsoft.PowerToys.Settings.UI.Views.Test1Page"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Style="{StaticResource PageStyle}"
|
||||
mc:Ignorable="d">
|
||||
<Grid x:Name="ContentArea" Margin="{StaticResource MediumLeftRightMargin}">
|
||||
<Grid
|
||||
Background="{ThemeResource SystemControlPageBackgroundChromeLowBrush}">
|
||||
<!--
|
||||
The SystemControlPageBackgroundChromeLowBrush background represents where you should place your content.
|
||||
Place your content here.
|
||||
-->
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
||||
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
{
|
||||
public sealed partial class Test1Page : Page
|
||||
{
|
||||
public Test1ViewModel ViewModel { get; } = new Test1ViewModel();
|
||||
|
||||
public Test1Page()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
<Page
|
||||
x:Class="Microsoft.PowerToys.Settings.UI.Views.Test2Page"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Style="{StaticResource PageStyle}"
|
||||
mc:Ignorable="d">
|
||||
<Grid x:Name="ContentArea" Margin="{StaticResource MediumLeftRightMargin}">
|
||||
<Grid
|
||||
Background="{ThemeResource SystemControlPageBackgroundChromeLowBrush}">
|
||||
<!--
|
||||
The SystemControlPageBackgroundChromeLowBrush background represents where you should place your content.
|
||||
Place your content here.
|
||||
-->
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
||||
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
{
|
||||
public sealed partial class Test2Page : Page
|
||||
{
|
||||
public Test2ViewModel ViewModel { get; } = new Test2ViewModel();
|
||||
|
||||
public Test2Page()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
<Page
|
||||
x:Class="Microsoft.PowerToys.Settings.UI.Views.Test3Page"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Style="{StaticResource PageStyle}"
|
||||
mc:Ignorable="d">
|
||||
<Grid x:Name="ContentArea" Margin="{StaticResource MediumLeftRightMargin}">
|
||||
<Grid
|
||||
Background="{ThemeResource SystemControlPageBackgroundChromeLowBrush}">
|
||||
<!--
|
||||
The SystemControlPageBackgroundChromeLowBrush background represents where you should place your content.
|
||||
Place your content here.
|
||||
-->
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
||||
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
{
|
||||
public sealed partial class Test3Page : Page
|
||||
{
|
||||
public Test3ViewModel ViewModel { get; } = new Test3ViewModel();
|
||||
|
||||
public Test3Page()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user