Added a General tab page with XAML layout and controls according to spec (#1546)

This commit is contained in:
Niels Laute 2020-03-12 07:25:24 +01:00 committed by Lavius Motileng
parent 69e7a581fd
commit b351e60d52
6 changed files with 105 additions and 1 deletions

View File

@ -133,11 +133,15 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<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>
@ -212,6 +216,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\GeneralPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\MainPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

View File

@ -141,4 +141,8 @@
<value>Test3</value>
<comment>Navigation view item name for Test3</comment>
</data>
<data name="Shell_General.Content" xml:space="preserve">
<value>General</value>
<comment>Navigation view item name for General</comment>
</data>
</root>

View File

@ -0,0 +1,13 @@
using System;
using Microsoft.PowerToys.Settings.UI.Helpers;
namespace Microsoft.PowerToys.Settings.UI.ViewModels
{
public class GeneralViewModel : Observable
{
public GeneralViewModel()
{
}
}
}

View File

@ -0,0 +1,45 @@
<Page
x:Class="Microsoft.PowerToys.Settings.UI.Views.GeneralPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<ScrollViewer>
<StackPanel Orientation="Vertical" Margin="14,0,14,48">
<ToggleSwitch Header="Start at startup" IsOn="True" Margin="0,14,0,0" />
<muxc:RadioButtons Header="Theme" Margin="0, 28,0,0">
<RadioButton Content="Dark"/>
<RadioButton Content="Light"/>
<RadioButton Content="System default" IsChecked="True"/>
</muxc:RadioButtons>
<ToggleSwitch Header="Disable telemetry" IsOn="True" Margin="0,14,0,0" />
<TextBlock Text="PowerToys currently respects the Windows data &amp; feedback setting" Opacity="0.8" Margin="0,0,0,0" />
<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>
</ComboBox>
<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 -->
<HyperlinkButton Content="Report a bug" Margin="0,14,0,0" />
<HyperlinkButton Content="Request a feature" />
<HyperlinkButton Content="Privacy statement" />
</StackPanel>
</ScrollViewer>
</Grid>
</Page>

View File

@ -0,0 +1,29 @@
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;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class GeneralPage : Page
{
public GeneralViewModel ViewModel { get; } = new GeneralViewModel();
public GeneralPage()
{
this.InitializeComponent();
}
}
}

View File

@ -47,6 +47,11 @@
Or to use an IconElement instead of a Symbol see https://github.com/Microsoft/WindowsTemplateStudio/blob/master/docs/projectTypes/navigationpane.md
Edit String/en-US/Resources.resw: Add a menu item title for each page
-->
<winui:NavigationViewItem x:Uid="Shell_General" helpers:NavHelper.NavigateTo="views:GeneralPage">
<winui:NavigationViewItem.Icon>
<FontIcon Glyph="&#xE713;"/>
</winui:NavigationViewItem.Icon>
</winui:NavigationViewItem>
<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" />