Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to WinUI 2.7 #976

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 36 additions & 28 deletions src/Notepads/App.xaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<Application
x:Class="Notepads.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.UI.Xaml.Controls">

<Application.Resources>
<ResourceDictionary>

<!--<ResourceDictionary.ThemeDictionaries>

<controls:XamlControlsResources>
<controls:XamlControlsResources.MergedDictionaries>
<ResourceDictionary>

<!--<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">

</ResourceDictionary>
Expand All @@ -18,30 +23,33 @@
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>-->

<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Notepads.Controls/Themes/Generic.xaml" />
<ResourceDictionary Source="Controls/TextEditor/TextEditorCore.xaml" />
<ResourceDictionary Source="Controls/FindAndReplace/FindAndReplacePlaceholder.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/DismissButtonStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/TransparentTextBoxStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/CustomSplitViewStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/InAppNotificationNoDismissButton.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/CustomSliderStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/CustomRadioButtonStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/CustomToggleSwitchStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/CustomNavigationViewItemStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/CustomAppBarButtonStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/CustomCheckBoxStyle.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>

<Style x:Key="CompactSubtitleTextBlockStyle" TargetType="TextBlock" BasedOn="{StaticResource SubtitleTextBlockStyle}">
<Setter Property="FontSize" Value="18"/>
</Style>

<Style x:Key="DescriptionTextBlockStyle" TargetType="TextBlock" BasedOn="{StaticResource CaptionTextBlockStyle}">
<Setter Property="Foreground" Value="{ThemeResource SystemBaseMediumHighColor}"/>
</Style>

</ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Notepads.Controls/Themes/Generic.xaml" />
<ResourceDictionary Source="Controls/TextEditor/TextEditorCore.xaml" />
<ResourceDictionary Source="Controls/FindAndReplace/FindAndReplacePlaceholder.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/DismissButtonStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/TransparentTextBoxStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/CustomSplitViewStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/InAppNotificationNoDismissButton.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/CustomSliderStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/CustomRadioButtonStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/CustomToggleSwitchStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/CustomNavigationViewItemStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/CustomAppBarButtonStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/CustomCheckBoxStyle.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>

<Style x:Key="CompactSubtitleTextBlockStyle" TargetType="TextBlock" BasedOn="{StaticResource SubtitleTextBlockStyle}">
<Setter Property="FontSize" Value="18"/>
</Style>

<Style x:Key="DescriptionTextBlockStyle" TargetType="TextBlock" BasedOn="{StaticResource CaptionTextBlockStyle}">
<Setter Property="Foreground" Value="{ThemeResource SystemBaseMediumHighColor}"/>
</Style>

</ResourceDictionary>
</controls:XamlControlsResources.MergedDictionaries>
</controls:XamlControlsResources>

</Application.Resources>
</Application>
3 changes: 3 additions & 0 deletions src/Notepads/Notepads.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,9 @@
<PackageReference Include="Microsoft.Toolkit.Uwp.UI">
<Version>6.1.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.UI.Xaml">
<Version>2.8.0-prerelease.210927001</Version>
</PackageReference>
<PackageReference Include="Microsoft.Win32.Registry">
<Version>5.0.0</Version>
</PackageReference>
Expand Down
2 changes: 2 additions & 0 deletions src/Notepads/Views/MainPage/NotepadsMainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions"
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d"
NavigationCacheMode="Required"

Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

<Grid x:Name="RootGrid" Background="Transparent">
Expand Down
41 changes: 21 additions & 20 deletions src/Notepads/Views/Settings/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:settings="using:Notepads.Views.Settings"
mc:Ignorable="d"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
Background="{ThemeResource SystemControlForegroundTransparentBrush}">

<NavigationView x:Name="SettingsNavigationView"
<muxc:NavigationView x:Name="SettingsNavigationView"
IsPaneOpen="False"
IsSettingsVisible="False"
IsBackEnabled="False"
Expand All @@ -17,42 +18,42 @@
OpenPaneLength="200"
ItemInvoked="SettingsPanel_OnItemInvoked">

<NavigationView.MenuItems>
<NavigationViewItem Style="{StaticResource CustomNavigationViewItemStyle}"
<muxc:NavigationView.MenuItems>
<muxc:NavigationViewItem
x:Uid="/Settings/TextAndEditorPage_Title"
Tag="TextAndEditor"
IsSelected="True">
<NavigationViewItem.Icon>
<muxc:NavigationViewItem.Icon>
<FontIcon FontFamily="Segoe MDL2 Assets"
Glyph="&#xF17F;" />
</NavigationViewItem.Icon>
</NavigationViewItem>
<NavigationViewItem Style="{StaticResource CustomNavigationViewItemStyle}"
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
<muxc:NavigationViewItem
x:Uid="/Settings/PersonalizationPage_Title"
Tag="Personalization" >
<NavigationViewItem.Icon>
<muxc:NavigationViewItem.Icon>
<FontIcon FontFamily="Segoe MDL2 Assets"
Glyph="&#xE771;" />
</NavigationViewItem.Icon>
</NavigationViewItem>
<NavigationViewItem Style="{StaticResource CustomNavigationViewItemStyle}"
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
<muxc:NavigationViewItem
x:Uid="/Settings/AdvancedPage_Title"
Tag="Advanced" >
<NavigationViewItem.Icon>
<muxc:NavigationViewItem.Icon>
<FontIcon FontFamily="Segoe MDL2 Assets"
Glyph="&#xE9E9;" />
</NavigationViewItem.Icon>
</NavigationViewItem>
<NavigationViewItem Style="{StaticResource CustomNavigationViewItemStyle}"
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
<muxc:NavigationViewItem
x:Uid="/Settings/AboutPage_Title"
Tag="About" >
<NavigationViewItem.Icon>
<muxc:NavigationViewItem.Icon>
<FontIcon FontFamily="Segoe MDL2 Assets"
Glyph="&#xE946;" />
</NavigationViewItem.Icon>
</NavigationViewItem>
</NavigationView.MenuItems>
</muxc:NavigationViewItem.Icon>
</muxc:NavigationViewItem>
</muxc:NavigationView.MenuItems>
<settings:SettingsPanel x:Name="SettingsPanel"/>
</NavigationView>
</muxc:NavigationView>

</Page>
15 changes: 13 additions & 2 deletions src/Notepads/Views/Settings/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
using System.Linq;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using muxc = Microsoft.UI.Xaml;
using Windows.UI.Xaml.Navigation;
using Microsoft.UI.Xaml.Controls;

public sealed partial class SettingsPage : Page
public sealed partial class SettingsPage : Windows.UI.Xaml.Controls.Page
{
public SettingsPage()
{
Expand All @@ -32,6 +33,16 @@ private void SettingsPage_Loaded(object sender, RoutedEventArgs e)
((NavigationViewItem)SettingsNavigationView.MenuItems.First()).IsSelected = true;
}

/*private void SettingsPage_Loaded(object sender, RoutedEventArgs e)
{
if (App.IsGameBarWidget)
{
ThemeSettingsService.OnThemeChanged += ThemeSettingsService_OnThemeChanged;
ThemeSettingsService.OnAccentColorChanged += ThemeSettingsService_OnAccentColorChanged;
}
SettingsNavigationView.SelectedItem = SettingsNavigationView.MenuItems[0];
}*/

private void SettingsPage_Unloaded(object sender, RoutedEventArgs e)
{
if (App.IsGameBarWidget)
Expand Down