From 680cf082819c67c89210cefbd7972d38cc97f1cd Mon Sep 17 00:00:00 2001 From: Soumya Ranjan Mahunt <devsoumyamahunt@gmail.com> Date: Wed, 17 Mar 2021 10:22:05 +0530 Subject: [PATCH 01/15] Move to WinUI 2. --- .../Markdown/Inlines/MarkdownLinkInline.cs | 2 +- .../Markdown/Render/MarkdownRenderer.cs | 4 ++-- src/Notepads.Controls/Notepads.Controls.csproj | 7 +++++-- src/Notepads.Controls/SetsView/SetsView.cs | 10 +++++----- src/Notepads.Controls/SetsView/SetsView.xaml | 6 +++--- src/Notepads/App.xaml | 1 + src/Notepads/App.xaml.cs | 14 +++++++------- .../Controls/TextEditor/TextEditorCore.cs | 2 +- src/Notepads/Notepads.csproj | 9 ++++++--- src/Notepads/Services/FileExtensionProvider.cs | 2 +- .../Views/MainPage/NotepadsMainPage.xaml | 18 +++++++++--------- 11 files changed, 41 insertions(+), 34 deletions(-) diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/MarkdownLinkInline.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/MarkdownLinkInline.cs index dffa7770d..c706325a0 100644 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/MarkdownLinkInline.cs +++ b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/MarkdownLinkInline.cs @@ -5,9 +5,9 @@ namespace Notepads.Controls.Markdown { + using Microsoft.Toolkit; using System; using System.Collections.Generic; - using Microsoft.Toolkit.Extensions; /// <summary> /// Represents a type of hyperlink where the text can be different from the target URL. diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.cs index c7f28c75f..2c6ce900c 100644 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.cs +++ b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.cs @@ -6,7 +6,7 @@ namespace Notepads.Controls.Markdown { using System; - using Microsoft.Toolkit.Uwp.UI.Extensions; + using Microsoft.Toolkit.Uwp.UI; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Documents; @@ -210,7 +210,7 @@ private void Preventative_PointerWheelChanged(object sender, Windows.UI.Xaml.Inp return; } - var rootViewer = VisualTree.FindAscendant<ScrollViewer>(RootElement); + var rootViewer = RootElement.FindAscendant<ScrollViewer>(); if (rootViewer != null) { pointerWheelChanged?.Invoke(rootViewer, new object[] { e }); diff --git a/src/Notepads.Controls/Notepads.Controls.csproj b/src/Notepads.Controls/Notepads.Controls.csproj index faaf943e8..518ca755b 100644 --- a/src/Notepads.Controls/Notepads.Controls.csproj +++ b/src/Notepads.Controls/Notepads.Controls.csproj @@ -284,10 +284,13 @@ <Version>2.0.6</Version> </PackageReference> <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> - <Version>6.2.11</Version> + <Version>6.2.12</Version> </PackageReference> <PackageReference Include="Microsoft.Toolkit.Uwp.UI"> - <Version>6.1.1</Version> + <Version>7.0.0</Version> + </PackageReference> + <PackageReference Include="Microsoft.UI.Xaml"> + <Version>2.5.0</Version> </PackageReference> <PackageReference Include="Win2D.uwp"> <Version>1.25.0</Version> diff --git a/src/Notepads.Controls/SetsView/SetsView.cs b/src/Notepads.Controls/SetsView/SetsView.cs index c5e400f1f..b9f6433fa 100644 --- a/src/Notepads.Controls/SetsView/SetsView.cs +++ b/src/Notepads.Controls/SetsView/SetsView.cs @@ -6,7 +6,7 @@ namespace Notepads.Controls { using System; using System.Linq; - using Microsoft.Toolkit.Uwp.UI.Extensions; + using Microsoft.Toolkit.Uwp.UI; using Windows.ApplicationModel.DataTransfer; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; @@ -158,10 +158,10 @@ private void SetsScrollViewer_Loaded(object sender, RoutedEventArgs e) _setsScrollForwardButton.Click -= ScrollSetForwardButton_Click; } - _setsScrollBackButton = _setsScroller.FindDescendantByName(SetsScrollBackButtonName) as ButtonBase; - _setsScrollForwardButton = _setsScroller.FindDescendantByName(SetsScrollForwardButtonName) as ButtonBase; - _setsItemsScrollViewerLeftSideShadow = _setsScroller.FindDescendantByName(SetsItemsScrollViewerLeftSideShadowName) as DropShadowPanel; - _setsItemsScrollViewerRightSideShadow = _setsScroller.FindDescendantByName(SetsItemsScrollViewerRightSideShadowName) as DropShadowPanel; + _setsScrollBackButton = _setsScroller.FindDescendant(SetsScrollBackButtonName) as ButtonBase; + _setsScrollForwardButton = _setsScroller.FindDescendant(SetsScrollForwardButtonName) as ButtonBase; + _setsItemsScrollViewerLeftSideShadow = _setsScroller.FindDescendant(SetsItemsScrollViewerLeftSideShadowName) as DropShadowPanel; + _setsItemsScrollViewerRightSideShadow = _setsScroller.FindDescendant(SetsItemsScrollViewerRightSideShadowName) as DropShadowPanel; if (_setsScrollBackButton != null) { diff --git a/src/Notepads.Controls/SetsView/SetsView.xaml b/src/Notepads.Controls/SetsView/SetsView.xaml index aec7dccde..1c4397a8a 100644 --- a/src/Notepads.Controls/SetsView/SetsView.xaml +++ b/src/Notepads.Controls/SetsView/SetsView.xaml @@ -1,7 +1,7 @@ <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters" - xmlns:ex="using:Microsoft.Toolkit.Uwp.UI.Extensions" + xmlns:ui="using:Microsoft.Toolkit.Uwp.UI" xmlns:controls="using:Notepads.Controls"> <ResourceDictionary.ThemeDictionaries> @@ -342,7 +342,7 @@ <ControlTemplate x:Key="SetsViewItemHeaderTemplate" TargetType="controls:SetsViewItem"> <Grid x:Name="LayoutRoot" - ex:FrameworkElementExtensions.AncestorType="controls:SetsView" + ui:FrameworkElementExtensions.AncestorType="controls:SetsView" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" @@ -445,7 +445,7 @@ <!-- Use grid to toggle visibility based on IsClosable property and inner border for hover animations. --> <Border x:Name="CloseButtonContainer" Grid.Column="2" - Width="{Binding (ex:FrameworkElementExtensions.Ancestor).IsCloseButtonOverlay, Converter={StaticResource CloseCollapsingSizeConverter}, ElementName=LayoutRoot}" + Width="{Binding (ui:FrameworkElementExtensions.Ancestor).IsCloseButtonOverlay, Converter={StaticResource CloseCollapsingSizeConverter}, ElementName=LayoutRoot}" HorizontalAlignment="Center" Visibility="{Binding IsClosable, Converter={StaticResource BoolToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}"> <Border x:Name="CloseButtonBorder" diff --git a/src/Notepads/App.xaml b/src/Notepads/App.xaml index af23eda27..18673427c 100644 --- a/src/Notepads/App.xaml +++ b/src/Notepads/App.xaml @@ -19,6 +19,7 @@ </ResourceDictionary.ThemeDictionaries>--> <ResourceDictionary.MergedDictionaries> + <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" /> <ResourceDictionary Source="Notepads.Controls/Themes/Generic.xaml" /> <ResourceDictionary Source="Controls/TextEditor/TextEditorCore.xaml" /> <ResourceDictionary Source="Controls/FindAndReplace/FindAndReplacePlaceholder.xaml"></ResourceDictionary> diff --git a/src/Notepads/App.xaml.cs b/src/Notepads/App.xaml.cs index 11e2edf97..9ea2d251d 100644 --- a/src/Notepads/App.xaml.cs +++ b/src/Notepads/App.xaml.cs @@ -105,8 +105,8 @@ private async Task ActivateAsync(IActivatedEventArgs e) var appLaunchSettings = new Dictionary<string, string>() { - { "OSArchitecture", SystemInformation.OperatingSystemArchitecture.ToString() }, - { "OSVersion", $"{SystemInformation.OperatingSystemVersion.Major}.{SystemInformation.OperatingSystemVersion.Minor}.{SystemInformation.OperatingSystemVersion.Build}" }, + { "OSArchitecture", SystemInformation.Instance.OperatingSystemArchitecture.ToString() }, + { "OSVersion", $"{SystemInformation.Instance.OperatingSystemVersion.Major}.{SystemInformation.Instance.OperatingSystemVersion.Minor}.{SystemInformation.Instance.OperatingSystemVersion.Build}" }, { "UseWindowsTheme", ThemeSettingsService.UseWindowsTheme.ToString() }, { "ThemeMode", ThemeSettingsService.ThemeMode.ToString() }, { "UseWindowsAccentColor", ThemeSettingsService.UseWindowsAccentColor.ToString() }, @@ -228,11 +228,11 @@ private static void OnUnhandledException(object sender, Windows.UI.Xaml.Unhandle { { "Message", e.Message }, { "Exception", e.Exception?.ToString() }, - { "Culture", SystemInformation.Culture.EnglishName }, - { "AvailableMemory", SystemInformation.AvailableMemory.ToString("F0") }, - { "FirstUseTimeUTC", SystemInformation.FirstUseTime.ToUniversalTime().ToString("MM/dd/yyyy HH:mm:ss") }, - { "OSArchitecture", SystemInformation.OperatingSystemArchitecture.ToString() }, - { "OSVersion", SystemInformation.OperatingSystemVersion.ToString() }, + { "Culture", SystemInformation.Instance.Culture.EnglishName }, + { "AvailableMemory", SystemInformation.Instance.AvailableMemory.ToString("F0") }, + { "FirstUseTimeUTC", SystemInformation.Instance.FirstUseTime.ToUniversalTime().ToString("MM/dd/yyyy HH:mm:ss") }, + { "OSArchitecture", SystemInformation.Instance.OperatingSystemArchitecture.ToString() }, + { "OSVersion", SystemInformation.Instance.OperatingSystemVersion.ToString() }, { "IsShadowWindow", (!IsPrimaryInstance && !IsGameBarWidget).ToString() }, { "IsGameBarWidget", IsGameBarWidget.ToString() } }; diff --git a/src/Notepads/Controls/TextEditor/TextEditorCore.cs b/src/Notepads/Controls/TextEditor/TextEditorCore.cs index 9b606a806..5f33a5fc1 100644 --- a/src/Notepads/Controls/TextEditor/TextEditorCore.cs +++ b/src/Notepads/Controls/TextEditor/TextEditorCore.cs @@ -181,7 +181,7 @@ protected override void OnApplyTemplate() _lineNumberGrid.SizeChanged += OnLineNumberGridSizeChanged; _rootGrid.SizeChanged += OnRootGridSizeChanged; - Microsoft.Toolkit.Uwp.UI.Extensions.ScrollViewerExtensions.SetEnableMiddleClickScrolling(_contentScrollViewer, true); + Microsoft.Toolkit.Uwp.UI.ScrollViewerExtensions.SetEnableMiddleClickScrolling(_contentScrollViewer, true); } // Unhook events and clear state diff --git a/src/Notepads/Notepads.csproj b/src/Notepads/Notepads.csproj index 27bd0f089..2827c9ca4 100644 --- a/src/Notepads/Notepads.csproj +++ b/src/Notepads/Notepads.csproj @@ -407,7 +407,7 @@ </ItemGroup> <ItemGroup> <PackageReference Include="DiffPlex"> - <Version>1.6.3</Version> + <Version>1.7.0</Version> </PackageReference> <PackageReference Include="Microsoft.AppCenter.Analytics"> <Version>4.1.0</Version> @@ -416,10 +416,13 @@ <Version>4.1.0</Version> </PackageReference> <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> - <Version>6.2.11</Version> + <Version>6.2.12</Version> </PackageReference> <PackageReference Include="Microsoft.Toolkit.Uwp.UI"> - <Version>6.1.1</Version> + <Version>7.0.0</Version> + </PackageReference> + <PackageReference Include="Microsoft.UI.Xaml"> + <Version>2.5.0</Version> </PackageReference> <PackageReference Include="Microsoft.Win32.Registry"> <Version>5.0.0</Version> diff --git a/src/Notepads/Services/FileExtensionProvider.cs b/src/Notepads/Services/FileExtensionProvider.cs index dd983548a..f3ae1c067 100644 --- a/src/Notepads/Services/FileExtensionProvider.cs +++ b/src/Notepads/Services/FileExtensionProvider.cs @@ -200,7 +200,7 @@ public static bool IsFileExtensionSupported(string fileExtension) { // Windows 10 2004 (build 19041) enables support for handling any kind of file // https://github.com/microsoft/ProjectReunion/issues/27 - if (SystemInformation.OperatingSystemVersion.Build >= 19041) + if (SystemInformation.Instance.OperatingSystemVersion.Build >= 19041) { return true; } diff --git a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml index 4ea5550b2..294200a13 100644 --- a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml +++ b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml @@ -5,7 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:controls="using:Notepads.Controls" - xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions" + xmlns:ui="using:Microsoft.Toolkit.Uwp.UI" xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" xmlns:Core="using:Microsoft.Xaml.Interactions.Core" mc:Ignorable="d" @@ -294,7 +294,7 @@ <Grid x:Name="FileModificationStateIndicator" Padding="8,5,6,5" IsTapEnabled="True" - extensions:Mouse.Cursor="Hand" + ui:FrameworkElementExtensions.Cursor="Hand" Tapped="StatusBarComponent_OnTapped"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> @@ -339,7 +339,7 @@ </Grid> </Grid> <Grid Column="1" - extensions:Mouse.Cursor="Hand"> + ui:FrameworkElementExtensions.Cursor="Hand"> <TextBlock x:Name="PathIndicator" Style="{StaticResource StatusBarTextBlockStyle}" Padding ="4,4,8,4" IsTapEnabled="True" @@ -411,7 +411,7 @@ </TextBlock> </Grid> <Grid Column="2" - extensions:Mouse.Cursor="Hand"> + ui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> @@ -465,7 +465,7 @@ </TextBlock> </Grid> <Grid Column="3" x:Name="LineColumnIndicatorButton" - extensions:Mouse.Cursor="Hand"> + ui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> @@ -489,7 +489,7 @@ </TextBlock> </Grid> <Grid Column="4" - extensions:Mouse.Cursor="Hand"> + ui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> @@ -581,7 +581,7 @@ </TextBlock> </Grid> <Grid Column="5" - extensions:Mouse.Cursor="Hand"> + ui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> @@ -618,7 +618,7 @@ </TextBlock> </Grid> <Grid Column="6" - extensions:Mouse.Cursor="Hand"> + ui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> @@ -652,7 +652,7 @@ </TextBlock> </Grid> <Grid Column="7" - extensions:Mouse.Cursor="Hand"> + ui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> From 68fb237c895871004e56a0daac3b158650d3bab0 Mon Sep 17 00:00:00 2001 From: Soumya Ranjan Mahunt <devsoumyamahunt@gmail.com> Date: Fri, 19 Mar 2021 09:45:24 +0530 Subject: [PATCH 02/15] Update control styles. --- src/Notepads/App.xaml | 2 +- .../Controls/Dialog/FileRenameDialog.cs | 1 + .../Controls/Dialog/NotepadsDialog.cs | 15 +- .../FindAndReplace/FindAndReplaceControl.xaml | 2 + src/Notepads/Controls/GoTo/GoToControl.xaml | 1 + src/Notepads/Notepads.csproj | 8 +- .../Resource/CustomAppBarButtonStyle.xaml | 392 ++++++++++++------ .../Resource/CustomCheckBoxStyle.xaml | 330 --------------- .../Resource/CustomMenuFlyoutItemStyle.xaml | 344 +++++++++++++++ .../Resource/CustomRadioButtonStyle.xaml | 116 +++--- src/Notepads/Resource/CustomSliderStyle.xaml | 369 ++++++++++++----- .../Resource/CustomToggleSwitchStyle.xaml | 337 +++++++++++---- src/Notepads/Resource/DismissButtonStyle.xaml | 50 ++- .../Resource/TransparentTextBoxStyle.xaml | 1 - src/Notepads/Services/ThemeSettingsService.cs | 47 ++- .../Views/MainPage/NotepadsMainPage.xaml | 26 +- .../Settings/PersonalizationSettingsPage.xaml | 5 +- .../PersonalizationSettingsPage.xaml.cs | 5 +- .../Settings/TextAndEditorSettingsPage.xaml | 2 +- 19 files changed, 1291 insertions(+), 762 deletions(-) delete mode 100644 src/Notepads/Resource/CustomCheckBoxStyle.xaml create mode 100644 src/Notepads/Resource/CustomMenuFlyoutItemStyle.xaml diff --git a/src/Notepads/App.xaml b/src/Notepads/App.xaml index 18673427c..5665c7531 100644 --- a/src/Notepads/App.xaml +++ b/src/Notepads/App.xaml @@ -32,7 +32,7 @@ <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 Source="Resource/CustomMenuFlyoutItemStyle.xaml"></ResourceDictionary> </ResourceDictionary.MergedDictionaries> <Style x:Key="CompactSubtitleTextBlockStyle" TargetType="TextBlock" BasedOn="{StaticResource SubtitleTextBlockStyle}"> diff --git a/src/Notepads/Controls/Dialog/FileRenameDialog.cs b/src/Notepads/Controls/Dialog/FileRenameDialog.cs index 6c4764890..906ea0ad4 100644 --- a/src/Notepads/Controls/Dialog/FileRenameDialog.cs +++ b/src/Notepads/Controls/Dialog/FileRenameDialog.cs @@ -38,6 +38,7 @@ public FileRenameDialog(string filename, bool fileExists, Action<string> confirm SelectionStart = 0, SelectionLength = filename.Contains(".") ? filename.LastIndexOf(".", StringComparison.Ordinal) : filename.Length, Height = 35, + CornerRadius = (CornerRadius)Application.Current.Resources["ControlCornerRadius"] }; _errorMessageTextBlock = new TextBlock() diff --git a/src/Notepads/Controls/Dialog/NotepadsDialog.cs b/src/Notepads/Controls/Dialog/NotepadsDialog.cs index bb27e1b9c..d6d32e872 100644 --- a/src/Notepads/Controls/Dialog/NotepadsDialog.cs +++ b/src/Notepads/Controls/Dialog/NotepadsDialog.cs @@ -17,6 +17,11 @@ public class NotepadsDialog : ContentDialog public NotepadsDialog() { + CornerRadius = (CornerRadius)Application.Current.Resources["ControlCornerRadius"]; + PrimaryButtonStyle = GetButtonStyle(); + SecondaryButtonStyle = GetButtonStyle(); + CloseButtonStyle = GetButtonStyle(); + RequestedTheme = ThemeSettingsService.ThemeMode; Background = ThemeSettingsService.ThemeMode == ElementTheme.Dark ? _darkModeBackgroundBrush @@ -34,9 +39,17 @@ private void NotepadsDialog_ActualThemeChanged(FrameworkElement sender, object a internal readonly ResourceLoader ResourceLoader = ResourceLoader.GetForCurrentView(); + internal static Style GetButtonStyle() + { + var buttonStyle = new Style(typeof(Button)); + buttonStyle.Setters.Add(new Setter(Control.CornerRadiusProperty, + (CornerRadius)Application.Current.Resources["ControlCornerRadius"])); + return buttonStyle; + } + internal static Style GetButtonStyle(Color backgroundColor) { - var buttonStyle = new Windows.UI.Xaml.Style(typeof(Button)); + var buttonStyle = GetButtonStyle(); buttonStyle.Setters.Add(new Setter(Control.BackgroundProperty, backgroundColor)); buttonStyle.Setters.Add(new Setter(Control.ForegroundProperty, Colors.White)); return buttonStyle; diff --git a/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml b/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml index b4cc714b3..c910d6433 100644 --- a/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml +++ b/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml @@ -52,6 +52,7 @@ TextAlignment="Left" BorderThickness="0" FontSize="15" + CornerRadius="{ThemeResource ControlCornerRadius}" TextChanged="FindBar_OnTextChanged" KeyDown="FindBar_OnKeyDown" GotFocus="FindBar_GotFocus" @@ -106,6 +107,7 @@ TextAlignment="Left" BorderThickness="0" FontSize="15" + CornerRadius="{ThemeResource ControlCornerRadius}" TextChanged="ReplaceBar_OnTextChanged" KeyDown="ReplaceBar_OnKeyDown" GotFocus="ReplaceBar_GotFocus" diff --git a/src/Notepads/Controls/GoTo/GoToControl.xaml b/src/Notepads/Controls/GoTo/GoToControl.xaml index 296793793..7d598cf66 100644 --- a/src/Notepads/Controls/GoTo/GoToControl.xaml +++ b/src/Notepads/Controls/GoTo/GoToControl.xaml @@ -29,6 +29,7 @@ TextAlignment="Left" BorderThickness="0" FontSize="15" + CornerRadius="{ThemeResource ControlCornerRadius}" BeforeTextChanging="GoToBar_BeforeTextChanging" TextChanged="GoToBar_OnTextChanged" KeyDown="GoToBar_OnKeyDown" diff --git a/src/Notepads/Notepads.csproj b/src/Notepads/Notepads.csproj index 2827c9ca4..d8dd472f0 100644 --- a/src/Notepads/Notepads.csproj +++ b/src/Notepads/Notepads.csproj @@ -316,6 +316,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Resource\CustomMenuFlyoutItemStyle.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Views\Settings\AboutPage.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -368,10 +372,6 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> - <Page Include="Resource\CustomCheckBoxStyle.xaml"> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> <Page Include="Resource\CustomNavigationViewItemStyle.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> diff --git a/src/Notepads/Resource/CustomAppBarButtonStyle.xaml b/src/Notepads/Resource/CustomAppBarButtonStyle.xaml index 677014a99..fe88dccf8 100644 --- a/src/Notepads/Resource/CustomAppBarButtonStyle.xaml +++ b/src/Notepads/Resource/CustomAppBarButtonStyle.xaml @@ -3,256 +3,388 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Notepads"> <Style x:Key="CustomAppBarButtonLabelToRightStyle" TargetType="AppBarButton"> - <Setter Property="Background" Value="{ThemeResource AppBarButtonRevealBackground}"/> - <Setter Property="Foreground" Value="{ThemeResource AppBarButtonForeground}"/> - <Setter Property="BorderBrush" Value="{ThemeResource AppBarButtonRevealBorderBrush}"/> - <Setter Property="HorizontalAlignment" Value="Left"/> - <Setter Property="VerticalAlignment" Value="Top"/> - <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/> - <Setter Property="FontWeight" Value="Normal"/> - <Setter Property="Width" Value="Auto"/> - <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}"/> - <Setter Property="AllowFocusOnInteraction" Value="False"/> - <Setter Property="KeyboardAcceleratorPlacementMode" Value="Hidden"/> + <Setter Property="Background" Value="{ThemeResource AppBarButtonBackground}" /> + <Setter Property="Foreground" Value="{ThemeResource AppBarButtonForeground}" /> + <Setter Property="BorderBrush" Value="{ThemeResource AppBarButtonBorderBrush}" /> + <Setter Property="HorizontalAlignment" Value="Left" /> + <Setter Property="VerticalAlignment" Value="Top" /> + <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> + <Setter Property="FontWeight" Value="Normal" /> + <Setter Property="Width" Value="Auto" /> + <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> + <Setter Property="AllowFocusOnInteraction" Value="False" /> + <Setter Property="KeyboardAcceleratorPlacementMode" Value="Hidden" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="AppBarButton"> - <Grid x:Name="Root" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{TemplateBinding CornerRadius}" MinWidth="{TemplateBinding MinWidth}" MaxWidth="{TemplateBinding MaxWidth}"> + <Grid x:Name="Root" + MinWidth="{TemplateBinding MinWidth}" + MaxWidth="{TemplateBinding MaxWidth}" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{TemplateBinding CornerRadius}" > + <Grid.Resources> + <Style x:Name="LabelOnRightStyle" TargetType="AppBarButton"> + <Setter Property="Width" Value="NaN" /> + </Style> + </Grid.Resources> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="ApplicationViewStates"> - <VisualState x:Name="FullSize"/> + <VisualState x:Name="FullSize" /> <VisualState x:Name="Compact"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" + Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="LabelOnRight"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentViewbox" Storyboard.TargetProperty="Margin"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarButtonContentViewboxMargin}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentViewbox" + Storyboard.TargetProperty="Margin"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource AppBarButtonContentViewboxMargin}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="MinHeight"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarThemeCompactHeight}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" + Storyboard.TargetProperty="MinHeight"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource AppBarThemeCompactHeight}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="(Grid.Row)"> - <DiscreteObjectKeyFrame KeyTime="0" Value="0"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" + Storyboard.TargetProperty="(Grid.Row)"> + <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="(Grid.Column)"> - <DiscreteObjectKeyFrame KeyTime="0" Value="1"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" + Storyboard.TargetProperty="(Grid.Column)"> + <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="TextAlignment"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Left"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" + Storyboard.TargetProperty="TextAlignment"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Left" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Margin"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarButtonTextLabelOnRightMargin}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" + Storyboard.TargetProperty="Margin"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{StaticResource AppBarButtonTextLabelOnRightMargin}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="LabelCollapsed"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="MinHeight"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarThemeCompactHeight}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" + Storyboard.TargetProperty="MinHeight"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource AppBarThemeCompactHeight}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" + Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Overflow"> <VisualState.Setters> - <Setter Target="ContentRoot.MinHeight" Value="0"/> - <Setter Target="ContentViewbox.Visibility" Value="Collapsed"/> - <Setter Target="TextLabel.Visibility" Value="Collapsed"/> - <Setter Target="OverflowTextLabel.Visibility" Value="Visible"/> + <Setter Target="ContentRoot.MinHeight" Value="0" /> + <Setter Target="ContentViewbox.Visibility" Value="Collapsed" /> + <Setter Target="TextLabel.Visibility" Value="Collapsed" /> + <Setter Target="OverflowTextLabel.Visibility" Value="Visible" /> </VisualState.Setters> </VisualState> <VisualState x:Name="OverflowWithToggleButtons"> <VisualState.Setters> - <Setter Target="ContentRoot.MinHeight" Value="0"/> - <Setter Target="ContentViewbox.Visibility" Value="Collapsed"/> - <Setter Target="TextLabel.Visibility" Value="Collapsed"/> - <Setter Target="OverflowTextLabel.Visibility" Value="Visible"/> - <Setter Target="OverflowTextLabel.Margin" Value="38,0,12,0"/> + <Setter Target="ContentRoot.MinHeight" Value="0" /> + <Setter Target="ContentViewbox.Visibility" Value="Collapsed" /> + <Setter Target="TextLabel.Visibility" Value="Collapsed" /> + <Setter Target="OverflowTextLabel.Visibility" Value="Visible" /> + <Setter Target="OverflowTextLabel.Margin" Value="38,0,12,0" /> </VisualState.Setters> </VisualState> <VisualState x:Name="OverflowWithMenuIcons"> <VisualState.Setters> - <Setter Target="ContentRoot.MinHeight" Value="0"/> - <Setter Target="ContentViewbox.HorizontalAlignment" Value="Left"/> - <Setter Target="ContentViewbox.VerticalAlignment" Value="Center"/> - <Setter Target="ContentViewbox.Width" Value="16"/> - <Setter Target="ContentViewbox.Height" Value="16"/> - <Setter Target="ContentViewbox.Margin" Value="12,0,12,0"/> - <Setter Target="TextLabel.Visibility" Value="Collapsed"/> - <Setter Target="OverflowTextLabel.Visibility" Value="Visible"/> - <Setter Target="OverflowTextLabel.Margin" Value="38,0,12,0"/> + <Setter Target="ContentRoot.MinHeight" Value="0" /> + <Setter Target="ContentViewbox.HorizontalAlignment" Value="Left" /> + <Setter Target="ContentViewbox.VerticalAlignment" Value="Center" /> + <Setter Target="ContentViewbox.Width" Value="16" /> + <Setter Target="ContentViewbox.Height" Value="16" /> + <Setter Target="ContentViewbox.Margin" Value="12,0,12,0" /> + <Setter Target="TextLabel.Visibility" Value="Collapsed" /> + <Setter Target="OverflowTextLabel.Visibility" Value="Visible" /> + <Setter Target="OverflowTextLabel.Margin" Value="38,0,12,0" /> </VisualState.Setters> </VisualState> <VisualState x:Name="OverflowWithToggleButtonsAndMenuIcons"> <VisualState.Setters> - <Setter Target="ContentRoot.MinHeight" Value="0"/> - <Setter Target="ContentViewbox.HorizontalAlignment" Value="Left"/> - <Setter Target="ContentViewbox.VerticalAlignment" Value="Center"/> - <Setter Target="ContentViewbox.Width" Value="16"/> - <Setter Target="ContentViewbox.Height" Value="16"/> - <Setter Target="ContentViewbox.Margin" Value="38,0,12,0"/> - <Setter Target="TextLabel.Visibility" Value="Collapsed"/> - <Setter Target="OverflowTextLabel.Visibility" Value="Visible"/> - <Setter Target="OverflowTextLabel.Margin" Value="76,0,12,0"/> + <Setter Target="ContentRoot.MinHeight" Value="0" /> + <Setter Target="ContentViewbox.HorizontalAlignment" Value="Left" /> + <Setter Target="ContentViewbox.VerticalAlignment" Value="Center" /> + <Setter Target="ContentViewbox.Width" Value="16" /> + <Setter Target="ContentViewbox.Height" Value="16" /> + <Setter Target="ContentViewbox.Margin" Value="38,0,12,0" /> + <Setter Target="TextLabel.Visibility" Value="Collapsed" /> + <Setter Target="OverflowTextLabel.Visibility" Value="Visible" /> + <Setter Target="OverflowTextLabel.Margin" Value="76,0,12,0" /> </VisualState.Setters> </VisualState> </VisualStateGroup> + <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal"> <Storyboard> - <PointerUpThemeAnimation Storyboard.TargetName="OverflowTextLabel"/> + <PointerUpThemeAnimation Storyboard.TargetName="OverflowTextLabel" /> </Storyboard> </VisualState> <VisualState x:Name="PointerOver"> <VisualState.Setters> - <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundPointerOver}"/> - <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushPointerOver}"/> - <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushPointerOver}"/> - <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}"/> - <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}"/> - <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}"/> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPointerOver}"/> + <Setter Target="Root.Background" + Value="{ThemeResource AppBarButtonBackgroundPointerOver}" /> + <Setter Target="Root.BorderBrush" + Value="{ThemeResource AppBarButtonBorderBrushPointerOver}" /> + <Setter Target="AppBarButtonInnerBorder.Stroke" + Value="{ThemeResource AppBarButtonBorderBrushPointerOver}" /> + <Setter Target="Content.Foreground" + Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> + <Setter Target="TextLabel.Foreground" + Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> + <Setter Target="OverflowTextLabel.Foreground" + Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> + <Setter Target="KeyboardAcceleratorTextLabel.Foreground" + Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPointerOver}" /> </VisualState.Setters> + <Storyboard> - <PointerUpThemeAnimation Storyboard.TargetName="OverflowTextLabel"/> + <PointerUpThemeAnimation Storyboard.TargetName="OverflowTextLabel" /> </Storyboard> </VisualState> <VisualState x:Name="Pressed"> <VisualState.Setters> - <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundPressed}"/> - <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushPressed}"/> - <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushPressed}"/> - <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}"/> - <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}"/> - <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}"/> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPressed}"/> + <Setter Target="Root.Background" + Value="{ThemeResource AppBarButtonBackgroundPressed}" /> + <Setter Target="Root.BorderBrush" + Value="{ThemeResource AppBarButtonBorderBrushPressed}" /> + <Setter Target="AppBarButtonInnerBorder.Stroke" + Value="{ThemeResource AppBarButtonBorderBrushPressed}" /> + <Setter Target="Content.Foreground" + Value="{ThemeResource AppBarButtonForegroundPressed}" /> + <Setter Target="TextLabel.Foreground" + Value="{ThemeResource AppBarButtonForegroundPressed}" /> + <Setter Target="OverflowTextLabel.Foreground" + Value="{ThemeResource AppBarButtonForegroundPressed}" /> + <Setter Target="KeyboardAcceleratorTextLabel.Foreground" + Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPressed}" /> </VisualState.Setters> + <Storyboard> - <PointerDownThemeAnimation Storyboard.TargetName="OverflowTextLabel"/> + <PointerDownThemeAnimation Storyboard.TargetName="OverflowTextLabel" /> </Storyboard> </VisualState> <VisualState x:Name="Disabled"> <VisualState.Setters> - <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundDisabled}"/> - <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushDisabled}"/> - <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushDisabled}"/> - <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundDisabled}"/> - <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundDisabled}"/> - <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundDisabled}"/> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundDisabled}"/> + <Setter Target="Root.Background" + Value="{ThemeResource AppBarButtonBackgroundDisabled}" /> + <Setter Target="Root.BorderBrush" + Value="{ThemeResource AppBarButtonBorderBrushDisabled}" /> + <Setter Target="AppBarButtonInnerBorder.Stroke" + Value="{ThemeResource AppBarButtonBorderBrushDisabled}" /> + <Setter Target="Content.Foreground" + Value="{ThemeResource AppBarButtonForegroundDisabled}" /> + <Setter Target="TextLabel.Foreground" + Value="{ThemeResource AppBarButtonForegroundDisabled}" /> + <Setter Target="OverflowTextLabel.Foreground" + Value="{ThemeResource AppBarButtonForegroundDisabled}" /> + <Setter Target="KeyboardAcceleratorTextLabel.Foreground" + Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundDisabled}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="OverflowNormal"> + <Storyboard> - <PointerUpThemeAnimation Storyboard.TargetName="ContentRoot"/> + <PointerUpThemeAnimation Storyboard.TargetName="ContentRoot" /> </Storyboard> </VisualState> <VisualState x:Name="OverflowPointerOver"> <VisualState.Setters> - <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundPointerOver}"/> - <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushPointerOver}"/> - <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushPointerOver}"/> - <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}"/> - <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}"/> - <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}"/> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPointerOver}"/> - <Setter Target="SubItemChevron.Foreground" Value="{ThemeResource AppBarButtonSubItemChevronForegroundPointerOver}"/> + <Setter Target="Root.Background" + Value="{ThemeResource AppBarButtonBackgroundPointerOver}" /> + <Setter Target="Root.BorderBrush" + Value="{ThemeResource AppBarButtonBorderBrushPointerOver}" /> + <Setter Target="AppBarButtonInnerBorder.Stroke" + Value="{ThemeResource AppBarButtonBorderBrushPointerOver}" /> + <Setter Target="Content.Foreground" + Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> + <Setter Target="TextLabel.Foreground" + Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> + <Setter Target="OverflowTextLabel.Foreground" + Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> + <Setter Target="KeyboardAcceleratorTextLabel.Foreground" + Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPointerOver}" /> + <Setter Target="SubItemChevron.Foreground" + Value="{ThemeResource AppBarButtonSubItemChevronForegroundPointerOver}" /> </VisualState.Setters> + <Storyboard> - <PointerUpThemeAnimation Storyboard.TargetName="ContentRoot"/> + <PointerUpThemeAnimation Storyboard.TargetName="ContentRoot" /> </Storyboard> </VisualState> <VisualState x:Name="OverflowPressed"> <VisualState.Setters> - <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundPressed}"/> - <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushPressed}"/> - <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushPressed}"/> - <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}"/> - <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}"/> - <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}"/> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPressed}"/> - <Setter Target="SubItemChevron.Foreground" Value="{ThemeResource AppBarButtonSubItemChevronForegroundPressed}"/> + <Setter Target="Root.Background" + Value="{ThemeResource AppBarButtonBackgroundPressed}" /> + <Setter Target="Root.BorderBrush" + Value="{ThemeResource AppBarButtonBorderBrushPressed}" /> + <Setter Target="AppBarButtonInnerBorder.Stroke" + Value="{ThemeResource AppBarButtonBorderBrushPressed}" /> + <Setter Target="Content.Foreground" + Value="{ThemeResource AppBarButtonForegroundPressed}" /> + <Setter Target="TextLabel.Foreground" + Value="{ThemeResource AppBarButtonForegroundPressed}" /> + <Setter Target="OverflowTextLabel.Foreground" + Value="{ThemeResource AppBarButtonForegroundPressed}" /> + <Setter Target="KeyboardAcceleratorTextLabel.Foreground" + Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPressed}" /> + <Setter Target="SubItemChevron.Foreground" + Value="{ThemeResource AppBarButtonSubItemChevronForegroundPressed}" /> </VisualState.Setters> + <Storyboard> - <PointerDownThemeAnimation Storyboard.TargetName="ContentRoot"/> + <PointerDownThemeAnimation Storyboard.TargetName="ContentRoot" /> </Storyboard> </VisualState> <VisualState x:Name="OverflowSubMenuOpened"> <VisualState.Setters> - <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundSubMenuOpened}"/> - <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushSubMenuOpened}"/> - <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushSubMenuOpened}"/> - <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundSubMenuOpened}"/> - <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundSubMenuOpened}"/> - <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundSubMenuOpened}"/> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundSubMenuOpened}"/> - <Setter Target="SubItemChevron.Foreground" Value="{ThemeResource AppBarButtonSubItemChevronForegroundSubMenuOpened}"/> + <Setter Target="Root.Background" + Value="{ThemeResource AppBarButtonBackgroundSubMenuOpened}" /> + <Setter Target="Root.BorderBrush" + Value="{ThemeResource AppBarButtonBorderBrushSubMenuOpened}" /> + <Setter Target="AppBarButtonInnerBorder.Stroke" + Value="{ThemeResource AppBarButtonBorderBrushSubMenuOpened}" /> + <Setter Target="Content.Foreground" + Value="{ThemeResource AppBarButtonForegroundSubMenuOpened}" /> + <Setter Target="TextLabel.Foreground" + Value="{ThemeResource AppBarButtonForegroundSubMenuOpened}" /> + <Setter Target="OverflowTextLabel.Foreground" + Value="{ThemeResource AppBarButtonForegroundSubMenuOpened}" /> + <Setter Target="KeyboardAcceleratorTextLabel.Foreground" + Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundSubMenuOpened}" /> + <Setter Target="SubItemChevron.Foreground" + Value="{ThemeResource AppBarButtonSubItemChevronForegroundSubMenuOpened}" /> </VisualState.Setters> + <Storyboard> - <PointerUpThemeAnimation Storyboard.TargetName="ContentRoot"/> + <PointerUpThemeAnimation Storyboard.TargetName="ContentRoot" /> </Storyboard> </VisualState> </VisualStateGroup> + <VisualStateGroup x:Name="InputModeStates"> - <VisualState x:Name="InputModeDefault"/> + <VisualState x:Name="InputModeDefault" /> <VisualState x:Name="TouchInputMode"> <VisualState.Setters> - <Setter Target="OverflowTextLabel.Padding" Value="{ThemeResource AppBarButtonOverflowTextTouchMargin}"/> + <Setter Target="OverflowTextLabel.Padding" + Value="{ThemeResource AppBarButtonOverflowTextTouchMargin}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="GameControllerInputMode"> <VisualState.Setters> - <Setter Target="OverflowTextLabel.Padding" Value="{ThemeResource AppBarButtonOverflowTextTouchMargin}"/> + <Setter Target="OverflowTextLabel.Padding" + Value="{ThemeResource AppBarButtonOverflowTextTouchMargin}" /> </VisualState.Setters> </VisualState> </VisualStateGroup> + <VisualStateGroup x:Name="KeyboardAcceleratorTextVisibility"> - <VisualState x:Name="KeyboardAcceleratorTextCollapsed"/> + <VisualState x:Name="KeyboardAcceleratorTextCollapsed" /> <VisualState x:Name="KeyboardAcceleratorTextVisible"> <VisualState.Setters> - <Setter Target="KeyboardAcceleratorTextLabel.Visibility" Value="Visible"/> + <Setter Target="KeyboardAcceleratorTextLabel.Visibility" Value="Visible" /> </VisualState.Setters> </VisualState> </VisualStateGroup> + <VisualStateGroup x:Name="FlyoutStates"> - <VisualState x:Name="NoFlyout"/> + <VisualState x:Name="NoFlyout" /> <VisualState x:Name="HasFlyout"> <VisualState.Setters> - <Setter Target="SubItemChevron.Visibility" Value="Visible"/> + <Setter Target="SubItemChevron.Visibility" Value="Visible" /> </VisualState.Setters> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> - <Rectangle x:Name="AppBarButtonInnerBorder" StrokeThickness="1" Stroke="{TemplateBinding BorderBrush}"/> + + <Rectangle x:Name="AppBarButtonInnerBorder" + StrokeThickness="1" + Stroke="{TemplateBinding BorderBrush}"/> <Grid x:Name="ContentRoot" MinHeight="{ThemeResource AppBarThemeCompactHeight}"> <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="*"/> - <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> - <RowDefinition Height="Auto"/> - <RowDefinition Height="Auto"/> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> </Grid.RowDefinitions> - <Viewbox x:Name="ContentViewbox" AutomationProperties.AccessibilityView="Raw" HorizontalAlignment="Left" Margin="{ThemeResource AppBarButtonContentViewboxMargin}"> - <ContentPresenter x:Name="Content" Content="{TemplateBinding Icon}" Foreground="{TemplateBinding Foreground}"/> + + <Viewbox x:Name="ContentViewbox" + Margin="{ThemeResource AppBarButtonContentViewboxMargin}" + HorizontalAlignment="Left" + AutomationProperties.AccessibilityView="Raw" > + <ContentPresenter x:Name="Content" + Content="{TemplateBinding Icon}" + Foreground="{TemplateBinding Foreground}"/> </Viewbox> - <TextBlock x:Name="TextLabel" AutomationProperties.AccessibilityView="Raw" FontFamily="{TemplateBinding FontFamily}" Foreground="{TemplateBinding Foreground}" FontSize="12" Text="{TemplateBinding Label}" TextWrapping="Wrap" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="{StaticResource AppBarButtonTextLabelOnRightMargin}"/> - <TextBlock x:Name="OverflowTextLabel" AutomationProperties.AccessibilityView="Raw" FontFamily="{TemplateBinding FontFamily}" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="Stretch" Margin="12,0,12,0" Padding="{ThemeResource AppBarButtonOverflowTextLabelPadding}" Text="{TemplateBinding Label}" TextTrimming="Clip" TextWrapping="NoWrap" TextAlignment="Left" VerticalAlignment="Center" Visibility="Collapsed"/> - <TextBlock x:Name="KeyboardAcceleratorTextLabel" AutomationProperties.AccessibilityView="Raw" Grid.Column="2" Foreground="{ThemeResource AppBarButtonKeyboardAcceleratorTextForeground}" HorizontalAlignment="Right" Margin="0,0,10,5" MinWidth="{Binding TemplateSettings.KeyboardAcceleratorTextMinWidth, RelativeSource={RelativeSource Mode=TemplatedParent}}" Style="{ThemeResource CaptionTextBlockStyle}" Text="{TemplateBinding KeyboardAcceleratorTextOverride}" VerticalAlignment="Center" Visibility="Visible"/> - <FontIcon x:Name="SubItemChevron" AutomationProperties.AccessibilityView="Raw" Grid.Column="2" FontFamily="{ThemeResource SymbolThemeFontFamily}" Foreground="{ThemeResource MenuFlyoutSubItemChevron}" FontSize="12" Glyph="" MirroredWhenRightToLeft="True" Margin="12,0,12,0" Visibility="Collapsed"/> + <TextBlock x:Name="TextLabel" + Grid.Column="1" + Text="{TemplateBinding Label}" + Foreground="{TemplateBinding Foreground}" + FontSize="12" + FontFamily="{TemplateBinding FontFamily}" + TextAlignment="Center" + TextWrapping="Wrap" + VerticalAlignment="Center" + HorizontalAlignment="Left" + Margin="{StaticResource AppBarButtonTextLabelOnRightMargin}" + AutomationProperties.AccessibilityView="Raw" /> + <TextBlock x:Name="OverflowTextLabel" + Text="{TemplateBinding Label}" + Foreground="{TemplateBinding Foreground}" + FontSize="{ThemeResource ControlContentThemeFontSize}" + FontFamily="{TemplateBinding FontFamily}" + TextAlignment="Left" + TextTrimming="Clip" + TextWrapping="NoWrap" + HorizontalAlignment="Stretch" + VerticalAlignment="Center" + Margin="12,0,12,0" + Padding="{ThemeResource AppBarButtonOverflowTextLabelPadding}" + Visibility="Collapsed" + AutomationProperties.AccessibilityView="Raw" /> + <TextBlock x:Name="KeyboardAcceleratorTextLabel" + Grid.Column="2" + Style="{ThemeResource CaptionTextBlockStyle}" + Text="{TemplateBinding KeyboardAcceleratorTextOverride}" + MinWidth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KeyboardAcceleratorTextMinWidth}" + Margin="0,0,10,5" + Foreground="{ThemeResource AppBarButtonKeyboardAcceleratorTextForeground}" + HorizontalAlignment="Right" + VerticalAlignment="Center" + Visibility="Visible" + AutomationProperties.AccessibilityView="Raw" /> + <FontIcon x:Name="SubItemChevron" + Grid.Column="2" + Glyph="" + FontFamily="{ThemeResource SymbolThemeFontFamily}" + FontSize="12" + AutomationProperties.AccessibilityView="Raw" + Foreground="{ThemeResource MenuFlyoutSubItemChevron}" + Margin="12,0,12,0" + MirroredWhenRightToLeft="True" + Visibility="Collapsed" /> </Grid> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> - </ResourceDictionary> diff --git a/src/Notepads/Resource/CustomCheckBoxStyle.xaml b/src/Notepads/Resource/CustomCheckBoxStyle.xaml deleted file mode 100644 index 32f2867b2..000000000 --- a/src/Notepads/Resource/CustomCheckBoxStyle.xaml +++ /dev/null @@ -1,330 +0,0 @@ -<ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:Notepads"> - - <Style x:Key="CustomCheckBoxContentToLeftStyle" TargetType="CheckBox"> - <Setter Property="Background" Value="{ThemeResource CheckBoxBackgroundUnchecked}"/> - <Setter Property="Foreground" Value="{ThemeResource CheckBoxForegroundUnchecked}"/> - <Setter Property="BorderBrush" Value="{ThemeResource CheckBoxBorderBrushUnchecked}"/> - <Setter Property="Padding" Value="0,0,0,0"/> - <Setter Property="HorizontalAlignment" Value="Stretch"/> - <Setter Property="VerticalAlignment" Value="Center"/> - <Setter Property="HorizontalContentAlignment" Value="Stretch"/> - <Setter Property="VerticalContentAlignment" Value="Center"/> - <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/> - <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/> - <Setter Property="MinWidth" Value="120"/> - <Setter Property="MinHeight" Value="32"/> - <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}"/> - <Setter Property="FocusVisualMargin" Value="-7,-3,-7,-3"/> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="CheckBox"> - <Grid x:Name="RootGrid" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{TemplateBinding CornerRadius}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Margin="{TemplateBinding Margin}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="*"/> - <ColumnDefinition Width="20"/> - </Grid.ColumnDefinitions> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CombinedStates"> - <VisualState x:Name="UncheckedNormal"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxForegroundUnchecked}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBackgroundUnchecked}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBorderBrushUnchecked}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundStrokeUnchecked}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundFillUnchecked}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckGlyphForegroundUnchecked}"/> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="UncheckedPointerOver"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxForegroundUncheckedPointerOver}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBackgroundUncheckedPointerOver}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBorderBrushUncheckedPointerOver}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundStrokeUncheckedPointerOver}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundFillUncheckedPointerOver}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckGlyphForegroundUncheckedPointerOver}"/> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="UncheckedPressed"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxForegroundUncheckedPressed}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBackgroundUncheckedPressed}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBorderBrushUncheckedPressed}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundStrokeUncheckedPressed}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundFillUncheckedPressed}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckGlyphForegroundUncheckedPressed}"/> - </ObjectAnimationUsingKeyFrames> - <DoubleAnimation Duration="0" Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="StrokeThickness" To="{ThemeResource CheckBoxCheckedStrokeThickness}"/> - </Storyboard> - </VisualState> - <VisualState x:Name="UncheckedDisabled"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxForegroundUncheckedDisabled}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBackgroundUncheckedDisabled}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBorderBrushUncheckedDisabled}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundStrokeUncheckedDisabled}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundFillUncheckedDisabled}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckGlyphForegroundUncheckedDisabled}"/> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="CheckedNormal"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxForegroundChecked}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBackgroundChecked}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBorderBrushChecked}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundStrokeChecked}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundFillChecked}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckGlyphForegroundChecked}"/> - </ObjectAnimationUsingKeyFrames> - <DoubleAnimation Duration="0" Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="StrokeThickness" To="{ThemeResource CheckBoxCheckedStrokeThickness}"/> - <DoubleAnimation Duration="0" Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Opacity" To="1"/> - </Storyboard> - </VisualState> - <VisualState x:Name="CheckedPointerOver"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxForegroundCheckedPointerOver}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBackgroundCheckedPointerOver}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBorderBrushCheckedPointerOver}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundStrokeCheckedPointerOver}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundFillCheckedPointerOver}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckGlyphForegroundCheckedPointerOver}"/> - </ObjectAnimationUsingKeyFrames> - <DoubleAnimation Duration="0" Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Opacity" To="1"/> - </Storyboard> - </VisualState> - <VisualState x:Name="CheckedPressed"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxForegroundCheckedPressed}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBackgroundCheckedPressed}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBorderBrushCheckedPressed}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundStrokeCheckedPressed}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundFillCheckedPressed}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckGlyphForegroundCheckedPressed}"/> - </ObjectAnimationUsingKeyFrames> - <DoubleAnimation Duration="0" Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="StrokeThickness" To="{ThemeResource CheckBoxCheckedStrokeThickness}"/> - <DoubleAnimation Duration="0" Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Opacity" To="1"/> - </Storyboard> - </VisualState> - <VisualState x:Name="CheckedDisabled"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxForegroundCheckedDisabled}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBackgroundCheckedDisabled}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBorderBrushCheckedDisabled}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundStrokeCheckedDisabled}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundFillCheckedDisabled}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckGlyphForegroundCheckedDisabled}"/> - </ObjectAnimationUsingKeyFrames> - <DoubleAnimation Duration="0" Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Opacity" To="1"/> - </Storyboard> - </VisualState> - <VisualState x:Name="IndeterminateNormal"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxForegroundIndeterminate}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBackgroundIndeterminate}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBorderBrushIndeterminate}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundStrokeIndeterminate}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundFillIndeterminate}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckGlyphForegroundIndeterminate}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Glyph"> - <DiscreteObjectKeyFrame KeyTime="0" Value=""/> - </ObjectAnimationUsingKeyFrames> - <DoubleAnimation Duration="0" Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Opacity" To="1"/> - </Storyboard> - </VisualState> - <VisualState x:Name="IndeterminatePointerOver"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxForegroundIndeterminatePointerOver}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBackgroundIndeterminatePointerOver}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBorderBrushIndeterminatePointerOver}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundStrokeIndeterminatePointerOver}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundFillIndeterminatePointerOver}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckGlyphForegroundIndeterminatePointerOver}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Glyph"> - <DiscreteObjectKeyFrame KeyTime="0" Value=""/> - </ObjectAnimationUsingKeyFrames> - <DoubleAnimation Duration="0" Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Opacity" To="1"/> - </Storyboard> - </VisualState> - <VisualState x:Name="IndeterminatePressed"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxForegroundIndeterminatePressed}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBackgroundIndeterminatePressed}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBorderBrushIndeterminatePressed}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundStrokeIndeterminatePressed}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundFillIndeterminatePressed}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckGlyphForegroundIndeterminatePressed}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Glyph"> - <DiscreteObjectKeyFrame KeyTime="0" Value=""/> - </ObjectAnimationUsingKeyFrames> - <DoubleAnimation Duration="0" Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Opacity" To="1"/> - </Storyboard> - </VisualState> - <VisualState x:Name="IndeterminateDisabled"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxForegroundIndeterminateDisabled}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBackgroundIndeterminateDisabled}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxBorderBrushIndeterminateDisabled}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundStrokeIndeterminateDisabled}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckBackgroundFillIndeterminateDisabled}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CheckBoxCheckGlyphForegroundIndeterminateDisabled}"/> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Glyph"> - <DiscreteObjectKeyFrame KeyTime="0" Value=""/> - </ObjectAnimationUsingKeyFrames> - <DoubleAnimation Duration="0" Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Opacity" To="1"/> - </Storyboard> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - <Grid Height="32" VerticalAlignment="Center" Grid.Column="1" Margin="{TemplateBinding Padding}" HorizontalAlignment="Right"> - <Rectangle x:Name="NormalRectangle" Fill="{ThemeResource CheckBoxCheckBackgroundFillUnchecked}" Height="20" StrokeThickness="{ThemeResource CheckBoxBorderThemeThickness}" Stroke="{ThemeResource CheckBoxCheckBackgroundStrokeUnchecked}" UseLayoutRounding="False" Width="20"/> - <FontIcon x:Name="CheckGlyph" FontFamily="{ThemeResource SymbolThemeFontFamily}" Foreground="{ThemeResource CheckBoxCheckGlyphForegroundUnchecked}" FontSize="20" Glyph="" Opacity="0"/> - </Grid> - <ContentPresenter x:Name="ContentPresenter" AutomationProperties.AccessibilityView="Raw" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentTransitions="{TemplateBinding ContentTransitions}" TextWrapping="Wrap" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> -</ResourceDictionary> diff --git a/src/Notepads/Resource/CustomMenuFlyoutItemStyle.xaml b/src/Notepads/Resource/CustomMenuFlyoutItemStyle.xaml new file mode 100644 index 000000000..ba7c35cb4 --- /dev/null +++ b/src/Notepads/Resource/CustomMenuFlyoutItemStyle.xaml @@ -0,0 +1,344 @@ +<ResourceDictionary + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:media="using:Microsoft.UI.Xaml.Media" + xmlns:local="using:Notepads"> + <Style TargetType="MenuFlyoutItem" BasedOn="{StaticResource CustomMenuFlyoutItemStyle}" /> + <Style TargetType="MenuFlyoutSubItem" BasedOn="{StaticResource CustomMenuFlyoutSubItemStyle}" /> + + <Style TargetType="MenuFlyoutItem" x:Key="CustomMenuFlyoutItemStyle"> + <Setter Property="Background" Value="{ThemeResource MenuFlyoutItemRevealBackground}" /> + <Setter Property="BorderBrush" Value="{ThemeResource MenuFlyoutItemRevealBorderBrush}" /> + <Setter Property="BorderThickness" Value="{ThemeResource MenuFlyoutItemRevealBorderThickness}" /> + <Setter Property="Foreground" Value="{ThemeResource MenuFlyoutItemForeground}" /> + <Setter Property="Padding" Value="{ThemeResource MenuFlyoutItemThemePadding}" /> + <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> + <Setter Property="VerticalContentAlignment" Value="Center" /> + <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> + <Setter Property="KeyboardAcceleratorPlacementMode" Value="Hidden" /> + <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="MenuFlyoutItem"> + <Grid x:Name="LayoutRoot" + Padding="{TemplateBinding Padding}" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{TemplateBinding CornerRadius}" > + + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="CommonStates"> + <VisualState x:Name="Normal"> + <Storyboard> + <PointerUpThemeAnimation Storyboard.TargetName="LayoutRoot" /> + </Storyboard> + </VisualState> + <VisualState x:Name="PointerOver"> + <VisualState.Setters> + <Setter Target="LayoutRoot.(media:RevealBrush.State)" + Value="PointerOver" /> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource MenuFlyoutItemRevealBackgroundPointerOver}" /> + <Setter Target="LayoutRoot.BorderBrush" + Value="{ThemeResource MenuFlyoutItemRevealBorderBrushPointerOver}" /> + <Setter Target="IconContent.Foreground" + Value="{ThemeResource MenuFlyoutItemForegroundPointerOver}" /> + <Setter Target="TextBlock.Foreground" + Value="{ThemeResource MenuFlyoutItemForegroundPointerOver}" /> + <Setter Target="KeyboardAcceleratorTextBlock.Foreground" + Value="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForegroundPointerOver}" /> + </VisualState.Setters> + <Storyboard> + <PointerUpThemeAnimation Storyboard.TargetName="LayoutRoot" /> + </Storyboard> + </VisualState> + <VisualState x:Name="Pressed"> + <VisualState.Setters> + <Setter Target="LayoutRoot.(media:RevealBrush.State)" + Value="Pressed" /> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource MenuFlyoutItemRevealBackgroundPressed}" /> + <Setter Target="LayoutRoot.BorderBrush" + Value="{ThemeResource MenuFlyoutItemRevealBorderBrushPressed}" /> + <Setter Target="IconContent.Foreground" + Value="{ThemeResource MenuFlyoutItemForegroundPressed}" /> + <Setter Target="TextBlock.Foreground" + Value="{ThemeResource MenuFlyoutItemForegroundPressed}" /> + <Setter Target="KeyboardAcceleratorTextBlock.Foreground" + Value="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForegroundPressed}" /> + </VisualState.Setters> + <Storyboard> + <PointerDownThemeAnimation Storyboard.TargetName="LayoutRoot" /> + </Storyboard> + </VisualState> + <VisualState x:Name="Disabled"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource MenuFlyoutItemRevealBackgroundDisabled}" /> + <Setter Target="LayoutRoot.BorderBrush" + Value="{ThemeResource MenuFlyoutItemRevealBorderBrushDisabled}" /> + <Setter Target="IconContent.Foreground" + Value="{ThemeResource MenuFlyoutItemForegroundDisabled}" /> + <Setter Target="TextBlock.Foreground" + Value="{ThemeResource MenuFlyoutItemForegroundDisabled}" /> + <Setter Target="KeyboardAcceleratorTextBlock.Foreground" + Value="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForegroundDisabled}" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="CheckPlaceholderStates"> + <VisualState x:Name="NoPlaceholder" /> + <VisualState x:Name="CheckPlaceholder"> + <VisualState.Setters> + <Setter Target="TextBlock.Margin" + Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="IconPlaceholder"> + <VisualState.Setters> + <Setter Target="TextBlock.Margin" + Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> + <Setter Target="IconRoot.Visibility" + Value="Visible" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="CheckAndIconPlaceholder"> + <VisualState.Setters> + <Setter Target="TextBlock.Margin" + Value="{ThemeResource MenuFlyoutItemDoublePlaceholderThemeThickness}" /> + <Setter Target="IconRoot.Margin" + Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> + <Setter Target="IconRoot.Visibility" + Value="Visible" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + <VisualStateGroup x:Name="PaddingSizeStates"> + <VisualState x:Name="DefaultPadding" /> + <VisualState x:Name="NarrowPadding"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" + Storyboard.TargetProperty="Padding"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource MenuFlyoutItemThemePaddingNarrow}" /> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + </VisualStateGroup> + <VisualStateGroup x:Name="KeyboardAcceleratorTextVisibility"> + <VisualState x:Name="KeyboardAcceleratorTextCollapsed" /> + <VisualState x:Name="KeyboardAcceleratorTextVisible"> + <VisualState.Setters> + <Setter Target="KeyboardAcceleratorTextBlock.Visibility" Value="Visible" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + + <Viewbox x:Name="IconRoot" + HorizontalAlignment="Left" + VerticalAlignment="Center" + Width="16" + Height="16" + Visibility="Collapsed"> + <ContentPresenter x:Name="IconContent" + Content="{TemplateBinding Icon}"/> + </Viewbox> + <TextBlock x:Name="TextBlock" + Text="{TemplateBinding Text}" + TextTrimming="Clip" + Foreground="{TemplateBinding Foreground}" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> + <TextBlock x:Name="KeyboardAcceleratorTextBlock" + Grid.Column="1" + Style="{ThemeResource CaptionTextBlockStyle}" + Text="{TemplateBinding KeyboardAcceleratorTextOverride}" + MinWidth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KeyboardAcceleratorTextMinWidth}" + Margin="24,0,0,0" + Foreground="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForeground}" + HorizontalAlignment="Right" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + Visibility="Collapsed" + AutomationProperties.AccessibilityView="Raw" /> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="MenuFlyoutSubItem" x:Key="CustomMenuFlyoutSubItemStyle"> + <Setter Property="Background" Value="{ThemeResource MenuFlyoutSubItemRevealBackground}" /> + <Setter Property="BorderBrush" Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrush}" /> + <Setter Property="BorderThickness" Value="{ThemeResource MenuFlyoutSubItemRevealBorderThickness}" /> + <Setter Property="Foreground" Value="{ThemeResource MenuFlyoutSubItemForeground}" /> + <Setter Property="Padding" Value="{ThemeResource MenuFlyoutItemThemePadding}" /> + <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> + <Setter Property="VerticalContentAlignment" Value="Center" /> + <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> + <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="MenuFlyoutSubItem"> + <Grid x:Name="LayoutRoot" + Padding="{TemplateBinding Padding}" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{TemplateBinding CornerRadius}" > + + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="CommonStates"> + <VisualState x:Name="Normal" /> + <VisualState x:Name="PointerOver"> + <VisualState.Setters> + <Setter Target="LayoutRoot.(media:RevealBrush.State)" + Value="PointerOver" /> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource MenuFlyoutSubItemRevealBackgroundPointerOver}" /> + <Setter Target="LayoutRoot.BorderBrush" + Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrushPointerOver}" /> + <Setter Target="IconContent.Foreground" + Value="{ThemeResource MenuFlyoutSubItemForegroundPointerOver}" /> + <Setter Target="TextBlock.Foreground" + Value="{ThemeResource MenuFlyoutSubItemForegroundPointerOver}" /> + <Setter Target="SubItemChevron.Foreground" + Value="{ThemeResource MenuFlyoutSubItemChevronPointerOver}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="Pressed"> + <VisualState.Setters> + <Setter Target="LayoutRoot.(media:RevealBrush.State)" + Value="Pressed" /> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource MenuFlyoutSubItemRevealBackgroundPressed}" /> + <Setter Target="LayoutRoot.BorderBrush" + Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrushPressed}" /> + <Setter Target="IconContent.Foreground" + Value="{ThemeResource MenuFlyoutSubItemForegroundPressed}" /> + <Setter Target="TextBlock.Foreground" + Value="{ThemeResource MenuFlyoutSubItemForegroundPressed}" /> + <Setter Target="SubItemChevron.Foreground" + Value="{ThemeResource MenuFlyoutSubItemChevronPressed}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="SubMenuOpened"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource MenuFlyoutSubItemRevealBackgroundSubMenuOpened}" /> + <Setter Target="LayoutRoot.BorderBrush" + Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrushSubMenuOpened}" /> + <Setter Target="IconContent.Foreground" + Value="{ThemeResource MenuFlyoutSubItemForegroundSubMenuOpened}" /> + <Setter Target="TextBlock.Foreground" + Value="{ThemeResource MenuFlyoutSubItemForegroundSubMenuOpened}" /> + <Setter Target="SubItemChevron.Foreground" + Value="{ThemeResource MenuFlyoutSubItemChevronSubMenuOpened}" /> + </VisualState.Setters> + </VisualState> + + <VisualState x:Name="Disabled"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource MenuFlyoutSubItemRevealBackgroundDisabled}" /> + <Setter Target="LayoutRoot.BorderBrush" + Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrushDisabled}" /> + <Setter Target="IconContent.Foreground" + Value="{ThemeResource MenuFlyoutSubItemForegroundDisabled}" /> + <Setter Target="TextBlock.Foreground" + Value="{ThemeResource MenuFlyoutSubItemForegroundDisabled}" /> + <Setter Target="SubItemChevron.Foreground" + Value="{ThemeResource MenuFlyoutSubItemChevronDisabled}" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="CheckPlaceholderStates"> + <VisualState x:Name="NoPlaceholder" /> + <VisualState x:Name="CheckPlaceholder"> + <VisualState.Setters> + <Setter Target="TextBlock.Margin" + Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="IconPlaceholder"> + <VisualState.Setters> + <Setter Target="TextBlock.Margin" + Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> + <Setter Target="IconRoot.Visibility" + Value="Visible" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="CheckAndIconPlaceholder"> + <VisualState.Setters> + <Setter Target="TextBlock.Margin" + Value="{ThemeResource MenuFlyoutItemDoublePlaceholderThemeThickness}" /> + <Setter Target="IconRoot.Margin" + Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> + <Setter Target="IconRoot.Visibility" + Value="Visible" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + <VisualStateGroup x:Name="PaddingSizeStates"> + <VisualState x:Name="DefaultPadding" /> + <VisualState x:Name="NarrowPadding"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" + Storyboard.TargetProperty="Padding"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource MenuFlyoutItemThemePaddingNarrow}" /> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + + <Viewbox x:Name="IconRoot" + Grid.Column="0" + HorizontalAlignment="Left" + VerticalAlignment="Center" + Width="16" + Height="16" + Visibility="Collapsed"> + <ContentPresenter x:Name="IconContent" + Content="{TemplateBinding Icon}"/> + </Viewbox> + <TextBlock x:Name="TextBlock" + Grid.Column="0" + Foreground="{TemplateBinding Foreground}" + Text="{TemplateBinding Text}" + TextTrimming="Clip" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> + <FontIcon x:Name="SubItemChevron" + Grid.Column="1" + Glyph="" + FontFamily="{ThemeResource SymbolThemeFontFamily}" + FontSize="12" + AutomationProperties.AccessibilityView="Raw" + Foreground="{ThemeResource MenuFlyoutSubItemChevron}" + Margin="{ThemeResource MenuFlyoutItemChevronMargin}" + MirroredWhenRightToLeft="True" /> + </Grid> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> +</ResourceDictionary> \ No newline at end of file diff --git a/src/Notepads/Resource/CustomRadioButtonStyle.xaml b/src/Notepads/Resource/CustomRadioButtonStyle.xaml index 40d26852f..532f01471 100644 --- a/src/Notepads/Resource/CustomRadioButtonStyle.xaml +++ b/src/Notepads/Resource/CustomRadioButtonStyle.xaml @@ -2,122 +2,117 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Notepads"> - <Style x:Key="CustomRadioButtonStyle" TargetType="RadioButton"> - <Setter Property="Background" Value="{ThemeResource RadioButtonBackground}"/> - <Setter Property="Foreground" Value="{ThemeResource RadioButtonForeground}"/> - <Setter Property="BorderBrush" Value="{ThemeResource RadioButtonBorderBrush}"/> - <Setter Property="Padding" Value="8,6,0,0"/> - <Setter Property="HorizontalAlignment" Value="Left"/> - <Setter Property="VerticalAlignment" Value="Center"/> - <Setter Property="HorizontalContentAlignment" Value="Left"/> - <Setter Property="VerticalContentAlignment" Value="Top"/> - <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/> - <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/> - <Setter Property="MinWidth" Value="120"/> - <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}"/> - <Setter Property="FocusVisualMargin" Value="-7,-3,-7,-3"/> + <Setter Property="Background" Value="{ThemeResource RadioButtonBackground}" /> + <Setter Property="Foreground" Value="{ThemeResource RadioButtonForeground}" /> + <Setter Property="BorderBrush" Value="{ThemeResource RadioButtonBorderBrush}" /> + <Setter Property="Padding" Value="8,6,0,0" /> + <Setter Property="HorizontalAlignment" Value="Left" /> + <Setter Property="VerticalAlignment" Value="Center" /> + <Setter Property="HorizontalContentAlignment" Value="Left" /> + <Setter Property="VerticalContentAlignment" Value="Top" /> + <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> + <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> + <Setter Property="MinWidth" Value="120" /> + <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> + <Setter Property="FocusVisualMargin" Value="-7,-3,-7,-3" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="RadioButton"> - <Grid x:Name="RootGrid" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{TemplateBinding CornerRadius}"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="20"/> - <ColumnDefinition Width="*"/> - </Grid.ColumnDefinitions> + <Grid x:Name="RootGrid" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal"/> + <VisualState x:Name="Normal" /> <VisualState x:Name="PointerOver"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonForegroundPointerOver}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonForegroundPointerOver}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBackgroundPointerOver}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBackgroundPointerOver}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBorderBrushPointerOver}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBorderBrushPointerOver}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterEllipse" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseStrokePointerOver}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseStrokePointerOver}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterEllipse" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseFillPointerOver}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseFillPointerOver}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckOuterEllipse" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SystemControlBackgroundAccentBrush}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseCheckedStrokePointerOver}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckOuterEllipse" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseCheckedFillPointerOver}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseCheckedFillPointerOver}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphFillPointerOver}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphFillPointerOver}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphStrokePointerOver}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphStrokePointerOver}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Pressed"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonForegroundPressed}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonForegroundPressed}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBackgroundPressed}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBackgroundPressed}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBorderBrushPressed}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBorderBrushPressed}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterEllipse" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseStrokePressed}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseStrokePressed}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterEllipse" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseFillPressed}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseFillPressed}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckOuterEllipse" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseCheckedStrokePressed}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseCheckedStrokePressed}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckOuterEllipse" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseCheckedFillPressed}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseCheckedFillPressed}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphFillPressed}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphFillPressed}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphStrokePressed}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphStrokePressed}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Disabled"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonForegroundDisabled}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonForegroundDisabled}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBackgroundDisabled}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBackgroundDisabled}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBorderBrushDisabled}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBorderBrushDisabled}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterEllipse" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseStrokeDisabled}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseStrokeDisabled}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterEllipse" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseFillDisabled}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseFillDisabled}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckOuterEllipse" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseCheckedStrokeDisabled}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseCheckedStrokeDisabled}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckOuterEllipse" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseCheckedFillDisabled}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseCheckedFillDisabled}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphFillDisabled}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphFillDisabled}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphStrokeDisabled}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphStrokeDisabled}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> @@ -125,25 +120,30 @@ <VisualStateGroup x:Name="CheckStates"> <VisualState x:Name="Checked"> <Storyboard> - <DoubleAnimation Duration="0" Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Opacity" To="1"/> - <DoubleAnimation Duration="0" Storyboard.TargetName="OuterEllipse" Storyboard.TargetProperty="Opacity" To="0"/> - <DoubleAnimation Duration="0" Storyboard.TargetName="CheckOuterEllipse" Storyboard.TargetProperty="Opacity" To="1"/> + <DoubleAnimation Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Opacity" To="1" Duration="0" /> + <DoubleAnimation Storyboard.TargetName="OuterEllipse" Storyboard.TargetProperty="Opacity" To="0" Duration="0" /> + <DoubleAnimation Storyboard.TargetName="CheckOuterEllipse" Storyboard.TargetProperty="Opacity" To="1" Duration="0" /> </Storyboard> </VisualState> - <VisualState x:Name="Unchecked"/> - <VisualState x:Name="Indeterminate"/> + <VisualState x:Name="Unchecked" /> + <VisualState x:Name="Indeterminate" /> </VisualStateGroup> </VisualStateManager.VisualStateGroups> - <Grid Height="32" VerticalAlignment="Top"> - <Ellipse x:Name="OuterEllipse" Fill="{StaticResource RadioButtonOuterEllipseFill}" Height="20" StrokeThickness="{ThemeResource RadioButtonBorderThemeThickness}" Stroke="{ThemeResource RadioButtonOuterEllipseStroke}" UseLayoutRounding="False" Width="20"/> - <Ellipse x:Name="CheckOuterEllipse" Fill="{ThemeResource RadioButtonOuterEllipseCheckedFill}" Height="20" Opacity="0" StrokeThickness="{ThemeResource RadioButtonBorderThemeThickness}" Stroke="{StaticResource SystemControlBackgroundAccentBrush}" UseLayoutRounding="False" Width="20"/> - <Ellipse x:Name="CheckGlyph" Fill="{ThemeResource RadioButtonCheckGlyphFill}" Height="10" Opacity="0" Stroke="{ThemeResource RadioButtonCheckGlyphStroke}" UseLayoutRounding="False" Width="10"/> + + <Grid.ColumnDefinitions> + <ColumnDefinition Width="20" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + + <Grid VerticalAlignment="Top" Height="32"> + <Ellipse x:Name="OuterEllipse" Width="20" Height="20" UseLayoutRounding="False" Stroke="{ThemeResource RadioButtonOuterEllipseStroke}" Fill="{StaticResource RadioButtonOuterEllipseFill}" StrokeThickness="{ThemeResource RadioButtonBorderThemeThickness}" /> + <Ellipse x:Name="CheckOuterEllipse" Width="20" Height="20" UseLayoutRounding="False" Stroke="{ThemeResource RadioButtonOuterEllipseCheckedStroke}" Fill="{ThemeResource RadioButtonOuterEllipseCheckedFill}" Opacity="0" StrokeThickness="{ThemeResource RadioButtonBorderThemeThickness}" /> + <Ellipse x:Name="CheckGlyph" Width="8" Height="8" UseLayoutRounding="False" Opacity="0" Fill="{ThemeResource RadioButtonCheckGlyphFill}" Stroke="{ThemeResource RadioButtonCheckGlyphStroke}" /> </Grid> - <ContentPresenter x:Name="ContentPresenter" AutomationProperties.AccessibilityView="Raw" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentTransitions="{TemplateBinding ContentTransitions}" Grid.Column="1" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" TextWrapping="Wrap" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> + <ContentPresenter x:Name="ContentPresenter" Content="{TemplateBinding Content}" ContentTransitions="{TemplateBinding ContentTransitions}" ContentTemplate="{TemplateBinding ContentTemplate}" Foreground="{TemplateBinding Foreground}" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="1" AutomationProperties.AccessibilityView="Raw" TextWrapping="Wrap" /> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> - </ResourceDictionary> diff --git a/src/Notepads/Resource/CustomSliderStyle.xaml b/src/Notepads/Resource/CustomSliderStyle.xaml index 271d98004..9d5928662 100644 --- a/src/Notepads/Resource/CustomSliderStyle.xaml +++ b/src/Notepads/Resource/CustomSliderStyle.xaml @@ -2,193 +2,345 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Notepads"> - <Style x:Key="CustomSliderStyle" TargetType="Slider"> - <Setter Property="Background" Value="{ThemeResource SliderTrackFill}"/> - <Setter Property="BorderThickness" Value="{ThemeResource SliderBorderThemeThickness}"/> - <Setter Property="Foreground" Value="{StaticResource SystemControlForegroundAccentBrush}"/> - <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/> - <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/> - <Setter Property="ManipulationMode" Value="None"/> - <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}"/> - <Setter Property="FocusVisualMargin" Value="-7,0,-7,0"/> - <Setter Property="IsFocusEngagementEnabled" Value="True"/> + <Setter Property="Background" Value="{ThemeResource SliderTrackFill}" /> + <Setter Property="BorderThickness" Value="{ThemeResource SliderBorderThemeThickness}" /> + <Setter Property="Foreground" Value="{ThemeResource SliderTrackValueFill}" /> + <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> + <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> + <Setter Property="ManipulationMode" Value="None" /> + <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> + <Setter Property="FocusVisualMargin" Value="-7,0,-7,0" /> + <Setter Property="IsFocusEngagementEnabled" Value="True" /> + <!--<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />--> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Slider"> <Grid Margin="{TemplateBinding Padding}"> <Grid.Resources> - <Style x:Key="SliderThumbStyle" TargetType="Thumb"> - <Setter Property="BorderThickness" Value="0"/> - <Setter Property="Background" Value="{StaticResource SystemControlForegroundAccentBrush}"/> + <Style TargetType="Thumb" x:Key="SliderThumbStyle"> + <Setter Property="BorderThickness" Value="0" /> + <Setter Property="Background" Value="{ThemeResource SliderThumbBackground}" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Thumb"> - <Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="4"/> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{ThemeResource SliderThumbCornerRadius}" /> </ControlTemplate> </Setter.Value> </Setter> </Style> </Grid.Resources> - <Grid.RowDefinitions> - <RowDefinition Height="Auto"/> - <RowDefinition Height="*"/> - </Grid.RowDefinitions> + <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal"/> + <VisualState x:Name="Normal" /> <VisualState x:Name="Pressed"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillPressed}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderTrackFillPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillPressed}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderTrackFillPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundPressed}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" + Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderThumbBackgroundPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundPressed}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" + Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderThumbBackgroundPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderContainerBackgroundPressed}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" + Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderContainerBackgroundPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SystemControlForegroundAccentBrush}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderTrackValueFillPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SystemControlForegroundAccentBrush}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderTrackValueFillPressed}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Disabled"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderHeaderForegroundDisabled}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" + Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderHeaderForegroundDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SystemControlForegroundAccentBrush}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderTrackValueFillDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillDisabled}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderTrackFillDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SystemControlForegroundAccentBrush}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderTrackValueFillDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillDisabled}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderTrackFillDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundDisabled}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" + Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderThumbBackgroundDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundDisabled}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" + Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderThumbBackgroundDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TopTickBar" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTickBarFillDisabled}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TopTickBar" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderTickBarFillDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BottomTickBar" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTickBarFillDisabled}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BottomTickBar" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderTickBarFillDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LeftTickBar" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTickBarFillDisabled}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LeftTickBar" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderTickBarFillDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RightTickBar" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTickBarFillDisabled}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RightTickBar" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderTickBarFillDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderContainerBackgroundDisabled}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" + Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderContainerBackgroundDisabled}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="PointerOver"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillPointerOver}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderTrackFillPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillPointerOver}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderTrackFillPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundPointerOver}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" + Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderThumbBackgroundPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundPointerOver}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" + Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderThumbBackgroundPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderContainerBackgroundPointerOver}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" + Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderContainerBackgroundPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SystemControlForegroundAccentBrush}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderTrackValueFillPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SystemControlForegroundAccentBrush}"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SliderTrackValueFillPointerOver}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> + <VisualStateGroup x:Name="FocusEngagementStates"> - <VisualState x:Name="FocusDisengaged"/> + <VisualState x:Name="FocusDisengaged" /> <VisualState x:Name="FocusEngagedHorizontal"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> - <DiscreteObjectKeyFrame KeyTime="0" Value="False"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" + Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> + <DiscreteObjectKeyFrame KeyTime="0" Value="False" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> - <DiscreteObjectKeyFrame KeyTime="0" Value="True"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" + Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> + <DiscreteObjectKeyFrame KeyTime="0" Value="True" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="FocusEngagedVertical"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> - <DiscreteObjectKeyFrame KeyTime="0" Value="False"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" + Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> + <DiscreteObjectKeyFrame KeyTime="0" Value="False" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> - <DiscreteObjectKeyFrame KeyTime="0" Value="True"/> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" + Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> + <DiscreteObjectKeyFrame KeyTime="0" Value="True" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> - <ContentPresenter x:Name="HeaderContentPresenter" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" FontWeight="{ThemeResource SliderHeaderThemeFontWeight}" Foreground="{ThemeResource SliderHeaderForeground}" Margin="{StaticResource SliderTopHeaderMargin}" Grid.Row="0" TextWrapping="Wrap" Visibility="Collapsed" x:DeferLoadStrategy="Lazy"/> - <Grid x:Name="SliderContainer" Background="{ThemeResource SliderContainerBackground}" Control.IsTemplateFocusTarget="True" Grid.Row="1"> + + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="*" /> + </Grid.RowDefinitions> + + <ContentPresenter x:Name="HeaderContentPresenter" + Grid.Row="0" + Content="{TemplateBinding Header}" + ContentTemplate="{TemplateBinding HeaderTemplate}" + FontWeight="{ThemeResource SliderHeaderThemeFontWeight}" + Foreground="{ThemeResource SliderHeaderForeground}" + Margin="{ThemeResource SliderTopHeaderMargin}" + TextWrapping="Wrap" + Visibility="Collapsed" + x:DeferLoadStrategy="Lazy"/> + <Grid x:Name="SliderContainer" + Grid.Row="1" + Background="{ThemeResource SliderContainerBackground}" + Control.IsTemplateFocusTarget="True"> <Grid x:Name="HorizontalTemplate" MinHeight="{ThemeResource SliderHorizontalHeight}"> <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="*"/> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> - <RowDefinition Height="{ThemeResource SliderPreContentMargin}"/> - <RowDefinition Height="Auto"/> - <RowDefinition Height="{ThemeResource SliderPostContentMargin}"/> + <RowDefinition Height="{ThemeResource SliderPreContentMargin}" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="{ThemeResource SliderPostContentMargin}" /> </Grid.RowDefinitions> - <Rectangle x:Name="HorizontalTrackRect" Grid.ColumnSpan="3" Fill="{TemplateBinding Background}" Height="{ThemeResource SliderTrackThemeHeight}" Grid.Row="1"/> - <Rectangle x:Name="HorizontalDecreaseRect" Fill="{TemplateBinding Foreground}" Grid.Row="1"/> - <TickBar x:Name="TopTickBar" Grid.ColumnSpan="3" Fill="{ThemeResource SliderTickBarFill}" Height="{ThemeResource SliderOutsideTickBarThemeHeight}" Margin="0,0,0,4" VerticalAlignment="Bottom" Visibility="Collapsed"/> - <TickBar x:Name="HorizontalInlineTickBar" Grid.ColumnSpan="3" Fill="{ThemeResource SliderInlineTickBarFill}" Height="{ThemeResource SliderTrackThemeHeight}" Grid.Row="1" Visibility="Collapsed"/> - <TickBar x:Name="BottomTickBar" Grid.ColumnSpan="3" Fill="{ThemeResource SliderTickBarFill}" Height="{ThemeResource SliderOutsideTickBarThemeHeight}" Margin="0,4,0,0" Grid.Row="2" VerticalAlignment="Top" Visibility="Collapsed"/> - <Thumb x:Name="HorizontalThumb" AutomationProperties.AccessibilityView="Raw" Grid.Column="1" DataContext="{TemplateBinding Value}" FocusVisualMargin="-14,-6,-14,-6" Height="24" Grid.RowSpan="3" Grid.Row="0" Style="{StaticResource SliderThumbStyle}" Width="8"/> + + <Rectangle x:Name="HorizontalTrackRect" + Fill="{TemplateBinding Background}" + Height="{ThemeResource SliderTrackThemeHeight}" + Grid.Row="1" + Grid.ColumnSpan="3" + RadiusX="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter}}" + RadiusY="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter}}" /> + <Rectangle x:Name="HorizontalDecreaseRect" + Fill="{TemplateBinding Foreground}" + Grid.Row="1" + RadiusX="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter}}" + RadiusY="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter}}" /> + <TickBar x:Name="TopTickBar" + Visibility="Collapsed" + Fill="{ThemeResource SliderTickBarFill}" + Height="{ThemeResource SliderOutsideTickBarThemeHeight}" + VerticalAlignment="Bottom" + Margin="0,0,0,4" + Grid.ColumnSpan="3" /> + <TickBar x:Name="HorizontalInlineTickBar" + Visibility="Collapsed" + Fill="{ThemeResource SliderInlineTickBarFill}" + Height="{ThemeResource SliderTrackThemeHeight}" + Grid.Row="1" + Grid.ColumnSpan="3" /> + <TickBar x:Name="BottomTickBar" + Visibility="Collapsed" + Fill="{ThemeResource SliderTickBarFill}" + Height="{ThemeResource SliderOutsideTickBarThemeHeight}" + VerticalAlignment="Top" + Margin="0,4,0,0" + Grid.Row="2" + Grid.ColumnSpan="3" /> + <Thumb x:Name="HorizontalThumb" + Style="{StaticResource SliderThumbStyle}" + DataContext="{TemplateBinding Value}" + Height="{ThemeResource SliderHorizontalThumbHeight}" + Width="{ThemeResource SliderHorizontalThumbWidth}" + Grid.Row="0" + Grid.RowSpan="3" + Grid.Column="1" + FocusVisualMargin="-14,-6,-14,-6" + AutomationProperties.AccessibilityView="Raw" /> </Grid> <Grid x:Name="VerticalTemplate" MinWidth="{ThemeResource SliderVerticalWidth}" Visibility="Collapsed"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="{ThemeResource SliderPreContentMargin}"/> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="{ThemeResource SliderPostContentMargin}"/> - </Grid.ColumnDefinitions> <Grid.RowDefinitions> - <RowDefinition Height="*"/> - <RowDefinition Height="Auto"/> - <RowDefinition Height="Auto"/> + <RowDefinition Height="*" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> </Grid.RowDefinitions> - <Rectangle x:Name="VerticalTrackRect" Grid.Column="1" Fill="{TemplateBinding Background}" Grid.RowSpan="3" Width="{ThemeResource SliderTrackThemeHeight}"/> - <Rectangle x:Name="VerticalDecreaseRect" Grid.Column="1" Fill="{TemplateBinding Foreground}" Grid.Row="2"/> - <TickBar x:Name="LeftTickBar" Fill="{ThemeResource SliderTickBarFill}" HorizontalAlignment="Right" Margin="0,0,4,0" Grid.RowSpan="3" Visibility="Collapsed" Width="{ThemeResource SliderOutsideTickBarThemeHeight}"/> - <TickBar x:Name="VerticalInlineTickBar" Grid.Column="1" Fill="{ThemeResource SliderInlineTickBarFill}" Grid.RowSpan="3" Visibility="Collapsed" Width="{ThemeResource SliderTrackThemeHeight}"/> - <TickBar x:Name="RightTickBar" Grid.Column="2" Fill="{ThemeResource SliderTickBarFill}" HorizontalAlignment="Left" Margin="4,0,0,0" Grid.RowSpan="3" Visibility="Collapsed" Width="{ThemeResource SliderOutsideTickBarThemeHeight}"/> - <Thumb x:Name="VerticalThumb" AutomationProperties.AccessibilityView="Raw" Grid.ColumnSpan="3" Grid.Column="0" DataContext="{TemplateBinding Value}" FocusVisualMargin="-6,-14,-6,-14" Height="8" Grid.Row="1" Style="{StaticResource SliderThumbStyle}" Width="24"/> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="{ThemeResource SliderPreContentMargin}" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="{ThemeResource SliderPostContentMargin}" /> + </Grid.ColumnDefinitions> + + <Rectangle x:Name="VerticalTrackRect" + Fill="{TemplateBinding Background}" + Width="{ThemeResource SliderTrackThemeHeight}" + Grid.Column="1" + Grid.RowSpan="3" + RadiusX="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter}}" + RadiusY="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter}}" /> + <Rectangle x:Name="VerticalDecreaseRect" + Fill="{TemplateBinding Foreground}" + Grid.Column="1" + Grid.Row="2" + RadiusX="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter}}" + RadiusY="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter}}" /> + <TickBar x:Name="LeftTickBar" + Visibility="Collapsed" + Fill="{ThemeResource SliderTickBarFill}" + Width="{ThemeResource SliderOutsideTickBarThemeHeight}" + HorizontalAlignment="Right" + Margin="0,0,4,0" + Grid.RowSpan="3" /> + <TickBar x:Name="VerticalInlineTickBar" + Visibility="Collapsed" + Fill="{ThemeResource SliderInlineTickBarFill}" + Width="{ThemeResource SliderTrackThemeHeight}" + Grid.Column="1" + Grid.RowSpan="3" /> + <TickBar x:Name="RightTickBar" + Visibility="Collapsed" + Fill="{ThemeResource SliderTickBarFill}" + Width="{ThemeResource SliderOutsideTickBarThemeHeight}" + HorizontalAlignment="Left" + Margin="4,0,0,0" + Grid.Column="2" + Grid.RowSpan="3" /> + <Thumb x:Name="VerticalThumb" + Style="{StaticResource SliderThumbStyle}" + DataContext="{TemplateBinding Value}" + Width="{ThemeResource SliderVerticalThumbWidth}" + Height="{ThemeResource SliderVerticalThumbHeight}" + Grid.Row="1" + Grid.Column="0" + Grid.ColumnSpan="3" + FocusVisualMargin="-6,-14,-6,-14" + AutomationProperties.AccessibilityView="Raw" /> </Grid> </Grid> </Grid> @@ -196,5 +348,4 @@ </Setter.Value> </Setter> </Style> - </ResourceDictionary> diff --git a/src/Notepads/Resource/CustomToggleSwitchStyle.xaml b/src/Notepads/Resource/CustomToggleSwitchStyle.xaml index 40ce69822..945e8bbdb 100644 --- a/src/Notepads/Resource/CustomToggleSwitchStyle.xaml +++ b/src/Notepads/Resource/CustomToggleSwitchStyle.xaml @@ -1,7 +1,6 @@ <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:local="using:Notepads" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> - <Style x:Key="CustomToggleSwitchStyle" TargetType="ToggleSwitch"> <Setter Property="Foreground" Value="{ThemeResource ToggleSwitchContentForeground}" /> <Setter Property="HorizontalAlignment" Value="Left" /> @@ -15,113 +14,183 @@ <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ToggleSwitch"> - <Grid Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}"> + <Grid Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{TemplateBinding CornerRadius}"> + <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal" /> <VisualState x:Name="PointerOver"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOffPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" + Storyboard.TargetProperty="Stroke"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchStrokeOffPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOffPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchFillOffPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOffPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchKnobFillOffPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOnPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchKnobFillOnPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOnPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchFillOnPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOnPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" + Storyboard.TargetProperty="Stroke"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchStrokeOnPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContainerBackgroundPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" + Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchContainerBackgroundPointerOver}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Pressed"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="StrokeThickness"> - <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOffPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" + Storyboard.TargetProperty="Stroke"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchStrokeOffPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOffPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchFillOffPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOnPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchFillOnPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOnPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" + Storyboard.TargetProperty="Stroke"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchStrokeOnPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOffPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchKnobFillOffPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOnPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchKnobFillOnPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContainerBackgroundPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" + Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchContainerBackgroundPressed}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Disabled"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchHeaderForegroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" + Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchHeaderForegroundDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OffContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContentForegroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OffContentPresenter" + Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchContentForegroundDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OnContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContentForegroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OnContentPresenter" + Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchContentForegroundDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOffDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" + Storyboard.TargetProperty="Stroke"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchStrokeOffDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOffDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchFillOffDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOnDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchFillOnDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOnDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" + Storyboard.TargetProperty="Stroke"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchStrokeOnDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOffDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchKnobFillOffDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOnDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" + Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchKnobFillOnDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContainerBackgroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" + Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource ToggleSwitchContainerBackgroundDisabled}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> + <VisualStateGroup x:Name="ToggleStates"> <VisualStateGroup.Transitions> <VisualTransition x:Name="DraggingToOnTransition" From="Dragging" To="On" GeneratedDuration="0"> <Storyboard> <RepositionThemeAnimation TargetName="SwitchKnob" FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobCurrentToOnOffset}" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" + Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" + Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" + Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" + Storyboard.TargetProperty="Opacity"> + <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualTransition> + <VisualTransition x:Name="OnToDraggingTransition" From="On" To="Dragging" GeneratedDuration="0"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" + Storyboard.TargetProperty="Opacity"> + <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" + Storyboard.TargetProperty="Opacity"> + <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" + Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> </Storyboard> @@ -129,6 +198,18 @@ <VisualTransition x:Name="DraggingToOffTransition" From="Dragging" To="Off" GeneratedDuration="0"> <Storyboard> <RepositionThemeAnimation TargetName="SwitchKnob" FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobCurrentToOffOffset}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" + Storyboard.TargetProperty="Opacity"> + <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" + Storyboard.TargetProperty="Opacity"> + <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" + Storyboard.TargetProperty="Opacity"> + <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> + </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualTransition> <VisualTransition x:Name="OnToOffTransition" From="On" To="Off" GeneratedDuration="0"> @@ -139,16 +220,20 @@ <VisualTransition x:Name="OffToOnTransition" From="Off" To="On" GeneratedDuration="0"> <Storyboard> <RepositionThemeAnimation TargetName="SwitchKnob" FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobOffToOnOffset}" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" + Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" + Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" + Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" + Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> </Storyboard> @@ -158,27 +243,39 @@ <VisualState x:Name="Off" /> <VisualState x:Name="On"> <Storyboard> - <DoubleAnimation Storyboard.TargetName="KnobTranslateTransform" Storyboard.TargetProperty="X" To="24" Duration="0" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Opacity"> + <DoubleAnimation Storyboard.TargetName="KnobTranslateTransform" + Storyboard.TargetProperty="X" + To="20" + Duration="0" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" + Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" + Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" + Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" + Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> + <VisualStateGroup x:Name="ContentStates"> <VisualState x:Name="OffContent"> <Storyboard> - <DoubleAnimation Storyboard.TargetName="OffContentPresenter" Storyboard.TargetProperty="Opacity" To="1" Duration="0" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" Storyboard.TargetName="OffContentPresenter"> + <DoubleAnimation Storyboard.TargetName="OffContentPresenter" + Storyboard.TargetProperty="Opacity" + To="1" + Duration="0" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" + Storyboard.TargetName="OffContentPresenter"> <DiscreteObjectKeyFrame KeyTime="0"> <DiscreteObjectKeyFrame.Value> <x:Boolean>True</x:Boolean> @@ -189,8 +286,12 @@ </VisualState> <VisualState x:Name="OnContent"> <Storyboard> - <DoubleAnimation Storyboard.TargetName="OnContentPresenter" Storyboard.TargetProperty="Opacity" To="1" Duration="0" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" Storyboard.TargetName="OnContentPresenter"> + <DoubleAnimation Storyboard.TargetName="OnContentPresenter" + Storyboard.TargetProperty="Opacity" + To="1" + Duration="0" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" + Storyboard.TargetName="OnContentPresenter"> <DiscreteObjectKeyFrame KeyTime="0"> <DiscreteObjectKeyFrame.Value> <x:Boolean>True</x:Boolean> @@ -201,12 +302,28 @@ </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> + <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> - <ContentPresenter x:Name="HeaderContentPresenter" x:DeferLoadStrategy="Lazy" Grid.Row="0" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" Foreground="{ThemeResource ToggleSwitchHeaderForeground}" IsHitTestVisible="False" Margin="{ThemeResource ToggleSwitchTopHeaderMargin}" TextWrapping="Wrap" VerticalAlignment="Top" Visibility="Collapsed" AutomationProperties.AccessibilityView="Raw" /> - <Grid Grid.Row="1" MinWidth="{StaticResource ToggleSwitchThemeMinWidth}" HorizontalAlignment="Left" VerticalAlignment="Top"> + + <ContentPresenter x:Name="HeaderContentPresenter" + x:DeferLoadStrategy="Lazy" + Grid.Row="0" + Content="{TemplateBinding Header}" + ContentTemplate="{TemplateBinding HeaderTemplate}" + Foreground="{ThemeResource ToggleSwitchHeaderForeground}" + IsHitTestVisible="False" + Margin="{ThemeResource ToggleSwitchTopHeaderMargin}" + TextWrapping="Wrap" + VerticalAlignment="Top" + Visibility="Collapsed" + AutomationProperties.AccessibilityView="Raw" /> + <Grid Grid.Row="1" + MinWidth="{StaticResource ToggleSwitchThemeMinWidth}" + HorizontalAlignment="Left" + VerticalAlignment="Top"> <Grid.RowDefinitions> <RowDefinition Height="{ThemeResource ToggleSwitchPreContentMargin}" /> <RowDefinition Height="Auto" /> @@ -217,19 +334,76 @@ <ColumnDefinition Width="12" MaxWidth="12" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> - <Grid x:Name="SwitchAreaGrid" Grid.RowSpan="3" Grid.ColumnSpan="3" Margin="0,5" Control.IsTemplateFocusTarget="True" Background="{ThemeResource ToggleSwitchContainerBackground}" /> - <ContentPresenter x:Name="OffContentPresenter" Grid.RowSpan="3" Grid.Column="2" Opacity="0" Foreground="{TemplateBinding Foreground}" IsHitTestVisible="False" Content="{TemplateBinding OffContent}" ContentTemplate="{TemplateBinding OffContentTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" AutomationProperties.AccessibilityView="Raw" /> - <ContentPresenter x:Name="OnContentPresenter" Grid.RowSpan="3" Grid.Column="2" Opacity="0" Foreground="{TemplateBinding Foreground}" IsHitTestVisible="False" Content="{TemplateBinding OnContent}" ContentTemplate="{TemplateBinding OnContentTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" AutomationProperties.AccessibilityView="Raw" /> - <Rectangle x:Name="OuterBorder" Grid.Row="1" Height="20" Width="44" RadiusX="10" RadiusY="10" Fill="{ThemeResource ToggleSwitchFillOff}" Stroke="{ThemeResource ToggleSwitchStrokeOff}" StrokeThickness="2" /> - <Rectangle x:Name="SwitchKnobBounds" Grid.Row="1" Height="20" Width="44" RadiusX="10" RadiusY="10" Fill="{StaticResource SystemControlForegroundAccentBrush}" Stroke="{StaticResource SystemControlForegroundAccentBrush}" StrokeThickness="{ThemeResource ToggleSwitchOnStrokeThickness}" Opacity="0" /> - <Grid x:Name="SwitchKnob" Grid.Row="1" HorizontalAlignment="Left" Width="20" Height="20"> - <Ellipse x:Name="SwitchKnobOn" Fill="{ThemeResource ToggleSwitchKnobFillOn}" Width="10" Height="10" Opacity="0" /> - <Ellipse x:Name="SwitchKnobOff" Fill="{ThemeResource ToggleSwitchKnobFillOff}" Width="10" Height="10" /> + + <Grid x:Name="SwitchAreaGrid" + Grid.RowSpan="3" + Grid.ColumnSpan="3" + Margin="0,5" + Control.IsTemplateFocusTarget="True" + Background="{ThemeResource ToggleSwitchContainerBackground}" /> + <ContentPresenter x:Name="OffContentPresenter" + Grid.RowSpan="3" + Grid.Column="2" + Opacity="0" + Foreground="{TemplateBinding Foreground}" + IsHitTestVisible="False" + Content="{TemplateBinding OffContent}" + ContentTemplate="{TemplateBinding OffContentTemplate}" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + AutomationProperties.AccessibilityView="Raw" /> + <ContentPresenter x:Name="OnContentPresenter" + Grid.RowSpan="3" + Grid.Column="2" + Opacity="0" + Foreground="{TemplateBinding Foreground}" + IsHitTestVisible="False" + Content="{TemplateBinding OnContent}" + ContentTemplate="{TemplateBinding OnContentTemplate}" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + AutomationProperties.AccessibilityView="Raw" /> + <Rectangle x:Name="OuterBorder" + Grid.Row="1" + Height="20" + Width="40" + RadiusX="10" + RadiusY="10" + Fill="{ThemeResource ToggleSwitchFillOff}" + Stroke="{ThemeResource ToggleSwitchStrokeOff}" + StrokeThickness="{ThemeResource ToggleSwitchOuterBorderStrokeThickness}" /> + <Rectangle x:Name="SwitchKnobBounds" + Grid.Row="1" + Height="20" + Width="40" + RadiusX="10" + RadiusY="10" + Fill="{ThemeResource ToggleSwitchFillOn}" + Stroke="{ThemeResource ToggleSwitchStrokeOn}" + StrokeThickness="{ThemeResource ToggleSwitchOnStrokeThickness}" + Opacity="0" /> + <Grid x:Name="SwitchKnob" + Grid.Row="1" + HorizontalAlignment="Left" + Width="20" + Height="20"> + <Ellipse x:Name="SwitchKnobOn" + Fill="{ThemeResource ToggleSwitchKnobFillOn}" + Width="10" + Height="10" + Opacity="0" /> + <Ellipse x:Name="SwitchKnobOff" + Fill="{ThemeResource ToggleSwitchKnobFillOff}" + Width="10" + Height="10" /> <Grid.RenderTransform> <TranslateTransform x:Name="KnobTranslateTransform" /> </Grid.RenderTransform> </Grid> - <Thumb x:Name="SwitchThumb" AutomationProperties.AccessibilityView="Raw" Grid.RowSpan="3" Grid.ColumnSpan="3"> + <Thumb x:Name="SwitchThumb" + AutomationProperties.AccessibilityView="Raw" + Grid.RowSpan="3" + Grid.ColumnSpan="3"> <Thumb.Template> <ControlTemplate TargetType="Thumb"> <Rectangle Fill="Transparent" /> @@ -242,5 +416,4 @@ </Setter.Value> </Setter> </Style> - </ResourceDictionary> \ No newline at end of file diff --git a/src/Notepads/Resource/DismissButtonStyle.xaml b/src/Notepads/Resource/DismissButtonStyle.xaml index eb87ae7a1..ab778008d 100644 --- a/src/Notepads/Resource/DismissButtonStyle.xaml +++ b/src/Notepads/Resource/DismissButtonStyle.xaml @@ -2,7 +2,6 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Notepads"> - <Style x:Key="DismissButtonStyle" TargetType="ButtonBase"> <Setter Property="Background" Value="{ThemeResource HyperlinkButtonBackground}" /> <Setter Property="Foreground" Value="{ThemeResource ApplicationForegroundThemeBrush}" /> @@ -16,43 +15,57 @@ <Grid x:Name="RootGrid" Margin="{TemplateBinding Padding}" Background="{TemplateBinding Background}"> <Border x:Name="TextBorder" BorderThickness="2" BorderBrush="Transparent"> <ContentPresenter x:Name="Text" - Content="{TemplateBinding Content}" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> + Content="{TemplateBinding Content}" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> </Border> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal" /> <VisualState x:Name="PointerOver"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemListMediumColor}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" + Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SystemListMediumColor}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" + Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="Transparent" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Pressed"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemListMediumColor}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" + Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource SystemListMediumColor}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" + Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="Transparent" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Disabled"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource HyperlinkButtonForegroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" + Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource HyperlinkButtonForegroundDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource HyperlinkButtonBackgroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" + Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource HyperlinkButtonBackgroundDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource HyperlinkButtonBorderBrushDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" + Storyboard.TargetProperty="BorderBrush"> + <DiscreteObjectKeyFrame KeyTime="0" + Value="{ThemeResource HyperlinkButtonBorderBrushDisabled}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> @@ -63,5 +76,4 @@ </Setter.Value> </Setter> </Style> - </ResourceDictionary> diff --git a/src/Notepads/Resource/TransparentTextBoxStyle.xaml b/src/Notepads/Resource/TransparentTextBoxStyle.xaml index 5ecb5ebf4..3c2f75716 100644 --- a/src/Notepads/Resource/TransparentTextBoxStyle.xaml +++ b/src/Notepads/Resource/TransparentTextBoxStyle.xaml @@ -120,5 +120,4 @@ </Setter.Value> </Setter> </Style> - </ResourceDictionary> diff --git a/src/Notepads/Services/ThemeSettingsService.cs b/src/Notepads/Services/ThemeSettingsService.cs index c1a438b81..3f5a6d2ab 100644 --- a/src/Notepads/Services/ThemeSettingsService.cs +++ b/src/Notepads/Services/ThemeSettingsService.cs @@ -4,8 +4,10 @@ using Microsoft.Toolkit.Uwp.Helpers; using Notepads.Brushes; using Notepads.Controls.Helpers; + using Notepads.Extensions; using Notepads.Settings; using Notepads.Utilities; + using Windows.ApplicationModel.Core; using Windows.UI; using Windows.UI.ViewManagement; using Windows.UI.Xaml; @@ -126,7 +128,7 @@ private static void InitializeAppAccentColor() UISettings.ColorValuesChanged += UiSettings_ColorValuesChanged; - _appAccentColor = UISettings.GetColorValue(Windows.UI.ViewManagement.UIColorType.Accent); + _appAccentColor = UISettings.GetColorValue(UIColorType.Accent); if (!UseWindowsAccentColor) { @@ -149,11 +151,20 @@ private static void InitializeCustomAccentColor() } } - private static void UiSettings_ColorValuesChanged(UISettings sender, object args) + private static async void UiSettings_ColorValuesChanged(UISettings sender, object args) { if (UseWindowsAccentColor) { AppAccentColor = sender.GetColorValue(UIColorType.Accent); + await CoreApplication.MainView.CoreWindow.Dispatcher.CallOnUIThreadAsync(() => + { + Application.Current.Resources["SystemAccentColorLight1"] = sender.GetColorValue(UIColorType.AccentLight1); + Application.Current.Resources["SystemAccentColorLight2"] = sender.GetColorValue(UIColorType.AccentLight2); + Application.Current.Resources["SystemAccentColorLight3"] = sender.GetColorValue(UIColorType.AccentLight3); + Application.Current.Resources["SystemAccentColorDark1"] = sender.GetColorValue(UIColorType.AccentDark1); + Application.Current.Resources["SystemAccentColorDark2"] = sender.GetColorValue(UIColorType.AccentDark2); + Application.Current.Resources["SystemAccentColorDark3"] = sender.GetColorValue(UIColorType.AccentDark3); + }); } } @@ -294,36 +305,36 @@ public static void ApplyThemeForTitleBarButtons(ApplicationViewTitleBar titleBar if (theme == ElementTheme.Dark) { // Set active window colors - titleBar.ButtonForegroundColor = Windows.UI.Colors.White; - titleBar.ButtonBackgroundColor = Windows.UI.Colors.Transparent; - titleBar.ButtonHoverForegroundColor = Windows.UI.Colors.White; + titleBar.ButtonForegroundColor = Colors.White; + titleBar.ButtonBackgroundColor = Colors.Transparent; + titleBar.ButtonHoverForegroundColor = Colors.White; titleBar.ButtonHoverBackgroundColor = Color.FromArgb(255, 90, 90, 90); - titleBar.ButtonPressedForegroundColor = Windows.UI.Colors.White; + titleBar.ButtonPressedForegroundColor = Colors.White; titleBar.ButtonPressedBackgroundColor = Color.FromArgb(255, 120, 120, 120); // Set inactive window colors - titleBar.InactiveForegroundColor = Windows.UI.Colors.Gray; - titleBar.InactiveBackgroundColor = Windows.UI.Colors.Transparent; - titleBar.ButtonInactiveForegroundColor = Windows.UI.Colors.Gray; - titleBar.ButtonInactiveBackgroundColor = Windows.UI.Colors.Transparent; + titleBar.InactiveForegroundColor = Colors.Gray; + titleBar.InactiveBackgroundColor = Colors.Transparent; + titleBar.ButtonInactiveForegroundColor = Colors.Gray; + titleBar.ButtonInactiveBackgroundColor = Colors.Transparent; titleBar.BackgroundColor = Color.FromArgb(255, 45, 45, 45); } else if (theme == ElementTheme.Light) { // Set active window colors - titleBar.ButtonForegroundColor = Windows.UI.Colors.Black; - titleBar.ButtonBackgroundColor = Windows.UI.Colors.Transparent; - titleBar.ButtonHoverForegroundColor = Windows.UI.Colors.Black; + titleBar.ButtonForegroundColor = Colors.Black; + titleBar.ButtonBackgroundColor = Colors.Transparent; + titleBar.ButtonHoverForegroundColor = Colors.Black; titleBar.ButtonHoverBackgroundColor = Color.FromArgb(255, 180, 180, 180); - titleBar.ButtonPressedForegroundColor = Windows.UI.Colors.Black; + titleBar.ButtonPressedForegroundColor = Colors.Black; titleBar.ButtonPressedBackgroundColor = Color.FromArgb(255, 150, 150, 150); // Set inactive window colors - titleBar.InactiveForegroundColor = Windows.UI.Colors.DimGray; - titleBar.InactiveBackgroundColor = Windows.UI.Colors.Transparent; - titleBar.ButtonInactiveForegroundColor = Windows.UI.Colors.DimGray; - titleBar.ButtonInactiveBackgroundColor = Windows.UI.Colors.Transparent; + titleBar.InactiveForegroundColor = Colors.DimGray; + titleBar.InactiveBackgroundColor = Colors.Transparent; + titleBar.ButtonInactiveForegroundColor = Colors.DimGray; + titleBar.ButtonInactiveBackgroundColor = Colors.Transparent; titleBar.BackgroundColor = Color.FromArgb(255, 210, 210, 210); } diff --git a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml index 294200a13..b79477cbf 100644 --- a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml +++ b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml @@ -5,6 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:controls="using:Notepads.Controls" + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" xmlns:ui="using:Microsoft.Toolkit.Uwp.UI" xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" xmlns:Core="using:Microsoft.Xaml.Interactions.Core" @@ -290,7 +291,8 @@ <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> - <Grid Column="0"> + <Grid Column="0" + CornerRadius="{ThemeResource ControlCornerRadius}"> <Grid x:Name="FileModificationStateIndicator" Padding="8,5,6,5" IsTapEnabled="True" @@ -339,6 +341,7 @@ </Grid> </Grid> <Grid Column="1" + CornerRadius="{ThemeResource ControlCornerRadius}" ui:FrameworkElementExtensions.Cursor="Hand"> <TextBlock x:Name="PathIndicator" Style="{StaticResource StatusBarTextBlockStyle}" Padding ="4,4,8,4" @@ -411,6 +414,7 @@ </TextBlock> </Grid> <Grid Column="2" + CornerRadius="{ThemeResource ControlCornerRadius}" ui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> @@ -464,7 +468,9 @@ </TextBlock.ContextFlyout> </TextBlock> </Grid> - <Grid Column="3" x:Name="LineColumnIndicatorButton" + <Grid Column="3" + x:Name="LineColumnIndicatorButton" + CornerRadius="{ThemeResource ControlCornerRadius}" ui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> @@ -489,6 +495,7 @@ </TextBlock> </Grid> <Grid Column="4" + CornerRadius="{ThemeResource ControlCornerRadius}" ui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> @@ -520,6 +527,7 @@ LabelPosition="Collapsed" VerticalAlignment="Center" BorderBrush="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}" + CornerRadius="{ThemeResource ControlCornerRadius}" Width="40" KeyboardAcceleratorTextOverride="Ctrl+Minus" Click="FontZoomIndicatorFlyoutSelection_OnClick"> @@ -530,7 +538,7 @@ <KeyboardAccelerator Key="Subtract" Modifiers="Control" IsEnabled="False"/> </AppBarButton.KeyboardAccelerators> </AppBarButton> - <Slider x:Name="FontZoomSlider" + <Slider x:Name="FontZoomSlider" Style="{StaticResource CustomSliderStyle}" Minimum="10" Maximum="500" Value="100" VerticalAlignment="Center" Width="150" @@ -541,6 +549,7 @@ LabelPosition="Collapsed" VerticalAlignment="Center" BorderBrush="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}" + CornerRadius="{ThemeResource ControlCornerRadius}" Width="40" KeyboardAcceleratorTextOverride="Ctrl+Plus" Click="FontZoomIndicatorFlyoutSelection_OnClick"> @@ -563,7 +572,10 @@ <AppBarButton x:Name="RestoreDefaultZoom" x:Uid="TextEditor_FontZoomIndicator_FlyoutItem_RestoreDefaultZoom" Style="{StaticResource CustomAppBarButtonLabelToRightStyle}" - HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="-10,5,-10,-5" + CornerRadius="{ThemeResource ControlCornerRadius}" + HorizontalAlignment="Stretch" + VerticalAlignment="Center" + Margin="-10,5,-10,-5" Icon="Undo" Click="FontZoomIndicatorFlyoutSelection_OnClick"> <AppBarButton.KeyboardAccelerators> @@ -581,6 +593,7 @@ </TextBlock> </Grid> <Grid Column="5" + CornerRadius="{ThemeResource ControlCornerRadius}" ui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> @@ -618,6 +631,7 @@ </TextBlock> </Grid> <Grid Column="6" + CornerRadius="{ThemeResource ControlCornerRadius}" ui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> @@ -652,6 +666,7 @@ </TextBlock> </Grid> <Grid Column="7" + CornerRadius="{ThemeResource ControlCornerRadius}" ui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> @@ -670,8 +685,9 @@ </Core:ChangePropertyAction> </Core:EventTriggerBehavior> </Interactivity:Interaction.Behaviors> - + <Grid x:Name="ShadowWindowIndicator" + CornerRadius="{ThemeResource ControlCornerRadius}" Visibility="Collapsed" Padding="6,6,6,6" IsTapEnabled="True" diff --git a/src/Notepads/Views/Settings/PersonalizationSettingsPage.xaml b/src/Notepads/Views/Settings/PersonalizationSettingsPage.xaml index 1d82d4ceb..cb1549d32 100644 --- a/src/Notepads/Views/Settings/PersonalizationSettingsPage.xaml +++ b/src/Notepads/Views/Settings/PersonalizationSettingsPage.xaml @@ -4,6 +4,7 @@ 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" + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" mc:Ignorable="d" Background="{ThemeResource SystemControlForegroundTransparentBrush}"> @@ -67,7 +68,7 @@ <StackPanel Margin="0,10,0,0"> <ToggleSwitch x:Uid="/Settings/PersonalizationPage_AccentColorSettings_UseWindowsAccentColorToggleSwitch" Style="{StaticResource CustomToggleSwitchStyle}" x:Name="AccentColorToggle" Margin="0,0,0,8"/> <Viewbox MaxWidth="300" Stretch="Fill"> - <ColorPicker + <muxc:ColorPicker x:Name="AccentColorPicker" ColorSpectrumShape="Ring" IsColorSliderVisible="True" @@ -76,7 +77,7 @@ IsAlphaEnabled="False" IsAlphaSliderVisible="True" IsAlphaTextInputVisible="True"> - </ColorPicker> + </muxc:ColorPicker> </Viewbox> </StackPanel> diff --git a/src/Notepads/Views/Settings/PersonalizationSettingsPage.xaml.cs b/src/Notepads/Views/Settings/PersonalizationSettingsPage.xaml.cs index 4ec25a495..ad552ebbb 100644 --- a/src/Notepads/Views/Settings/PersonalizationSettingsPage.xaml.cs +++ b/src/Notepads/Views/Settings/PersonalizationSettingsPage.xaml.cs @@ -138,11 +138,14 @@ private void ThemeRadioButton_OnChecked(object sender, RoutedEventArgs e) } } - private void AccentColorPicker_OnColorChanged(ColorPicker sender, ColorChangedEventArgs args) + private void AccentColorPicker_OnColorChanged( + Microsoft.UI.Xaml.Controls.ColorPicker sender, + Microsoft.UI.Xaml.Controls.ColorChangedEventArgs args) { if (AccentColorPicker.IsEnabled) { ThemeSettingsService.AppAccentColor = args.NewColor; + if (!AccentColorToggle.IsOn) ThemeSettingsService.CustomAccentColor = args.NewColor; } } diff --git a/src/Notepads/Views/Settings/TextAndEditorSettingsPage.xaml b/src/Notepads/Views/Settings/TextAndEditorSettingsPage.xaml index 810ed7f07..6d42561ac 100644 --- a/src/Notepads/Views/Settings/TextAndEditorSettingsPage.xaml +++ b/src/Notepads/Views/Settings/TextAndEditorSettingsPage.xaml @@ -215,7 +215,7 @@ </StackPanel> </RadioButton> <StackPanel Margin="28,5,0,10"> - <TextBox Style="{StaticResource TransparentTextBoxStyle}" BorderThickness="0" x:Name="CustomSearchUrl" PlaceholderText="https://www.example.com/search?q={0}" IsSpellCheckEnabled="False" TextChanged="CustomSearchUrl_TextChanged" LostFocus="CustomSearchUrl_LostFocus"/> + <TextBox Style="{StaticResource TransparentTextBoxStyle}" BorderThickness="0" CornerRadius="{ThemeResource ControlCornerRadius}" x:Name="CustomSearchUrl" PlaceholderText="https://www.example.com/search?q={0}" IsSpellCheckEnabled="False" TextChanged="CustomSearchUrl_TextChanged" LostFocus="CustomSearchUrl_LostFocus"/> <TextBlock x:Name="CustomUrlErrorReport" x:Uid="/Settings/TextAndEditorPage_SearchEngineSettings_CustomSearchUrlRadioButton_CustomUrlErrorReport" Style="{ThemeResource DescriptionTextBlockStyle}" Foreground="Red" Visibility="Collapsed"/> </StackPanel> </StackPanel> From b0ef4d6169702dd813f2b43a7ccbf2a537faecdc Mon Sep 17 00:00:00 2001 From: Soumya Ranjan Mahunt <devsoumyamahunt@gmail.com> Date: Fri, 19 Mar 2021 14:59:23 +0530 Subject: [PATCH 03/15] Update control styles. --- src/Notepads/App.xaml | 4 +- .../Controls/TextEditor/TextEditorCore.xaml | 1 + src/Notepads/Notepads.csproj | 4 +- ...mStyle.xaml => CustomFlyoutItemStyle.xaml} | 161 ++++++++ .../CustomNavigationViewItemStyle.xaml | 380 ------------------ .../Resource/CustomNavigationViewStyle.xaml | 275 +++++++++++++ .../Views/MainPage/NotepadsMainPage.xaml | 1 - src/Notepads/Views/Settings/SettingsPage.xaml | 75 ++-- .../Views/Settings/SettingsPage.xaml.cs | 9 +- 9 files changed, 485 insertions(+), 425 deletions(-) rename src/Notepads/Resource/{CustomMenuFlyoutItemStyle.xaml => CustomFlyoutItemStyle.xaml} (67%) delete mode 100644 src/Notepads/Resource/CustomNavigationViewItemStyle.xaml create mode 100644 src/Notepads/Resource/CustomNavigationViewStyle.xaml diff --git a/src/Notepads/App.xaml b/src/Notepads/App.xaml index 5665c7531..d71f70b87 100644 --- a/src/Notepads/App.xaml +++ b/src/Notepads/App.xaml @@ -30,9 +30,9 @@ <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/CustomNavigationViewStyle.xaml"></ResourceDictionary> <ResourceDictionary Source="Resource/CustomAppBarButtonStyle.xaml"></ResourceDictionary> - <ResourceDictionary Source="Resource/CustomMenuFlyoutItemStyle.xaml"></ResourceDictionary> + <ResourceDictionary Source="Resource/CustomFlyoutItemStyle.xaml"></ResourceDictionary> </ResourceDictionary.MergedDictionaries> <Style x:Key="CompactSubtitleTextBlockStyle" TargetType="TextBlock" BasedOn="{StaticResource SubtitleTextBlockStyle}"> diff --git a/src/Notepads/Controls/TextEditor/TextEditorCore.xaml b/src/Notepads/Controls/TextEditor/TextEditorCore.xaml index 0c0153552..f19e8e4c7 100644 --- a/src/Notepads/Controls/TextEditor/TextEditorCore.xaml +++ b/src/Notepads/Controls/TextEditor/TextEditorCore.xaml @@ -87,6 +87,7 @@ Visibility="Collapsed"/> <Grid x:Name="LineHighlighter" Background="{ThemeResource SystemControlBackgroundListLowBrush}" + CornerRadius="{ThemeResource ControlCornerRadius}" Opacity="0.65" BorderThickness="0" Visibility="Collapsed"/> diff --git a/src/Notepads/Notepads.csproj b/src/Notepads/Notepads.csproj index d8dd472f0..9b9b49cc9 100644 --- a/src/Notepads/Notepads.csproj +++ b/src/Notepads/Notepads.csproj @@ -316,7 +316,7 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> - <Page Include="Resource\CustomMenuFlyoutItemStyle.xaml"> + <Page Include="Resource\CustomFlyoutItemStyle.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> @@ -372,7 +372,7 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> - <Page Include="Resource\CustomNavigationViewItemStyle.xaml"> + <Page Include="Resource\CustomNavigationViewStyle.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> diff --git a/src/Notepads/Resource/CustomMenuFlyoutItemStyle.xaml b/src/Notepads/Resource/CustomFlyoutItemStyle.xaml similarity index 67% rename from src/Notepads/Resource/CustomMenuFlyoutItemStyle.xaml rename to src/Notepads/Resource/CustomFlyoutItemStyle.xaml index ba7c35cb4..a8fb642e6 100644 --- a/src/Notepads/Resource/CustomMenuFlyoutItemStyle.xaml +++ b/src/Notepads/Resource/CustomFlyoutItemStyle.xaml @@ -5,6 +5,7 @@ xmlns:local="using:Notepads"> <Style TargetType="MenuFlyoutItem" BasedOn="{StaticResource CustomMenuFlyoutItemStyle}" /> <Style TargetType="MenuFlyoutSubItem" BasedOn="{StaticResource CustomMenuFlyoutSubItemStyle}" /> + <Style TargetType="ComboBoxItem" BasedOn="{StaticResource CustomComboBoxItemStyle}" /> <Style TargetType="MenuFlyoutItem" x:Key="CustomMenuFlyoutItemStyle"> <Setter Property="Background" Value="{ThemeResource MenuFlyoutItemRevealBackground}" /> @@ -341,4 +342,164 @@ </Setter.Value> </Setter> </Style> + + <Style TargetType="ComboBoxItem" x:Key="CustomComboBoxItemStyle"> + <Setter Property="Foreground" Value="{ThemeResource ComboBoxItemForeground}" /> + <Setter Property="Background" Value="{ThemeResource ComboBoxItemRevealBackground}" /> + <Setter Property="BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrush}" /> + <Setter Property="BorderThickness" Value="{ThemeResource ComboBoxItemRevealBorderThemeThickness}" /> + <Setter Property="TabNavigation" Value="Local" /> + <Setter Property="Padding" Value="{ThemeResource ComboBoxItemRevealThemePadding}" /> + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> + <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> + <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="ComboBoxItem"> + <Grid x:Name="LayoutRoot" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{TemplateBinding CornerRadius}" + Control.IsTemplateFocusTarget="True"> + + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="CommonStates"> + <VisualState x:Name="Normal"> + <Storyboard> + <PointerUpThemeAnimation Storyboard.TargetName="LayoutRoot" /> + </Storyboard> + </VisualState> + <VisualState x:Name="PointerOver"> + <VisualState.Setters> + <Setter Target="LayoutRoot.(media:RevealBrush.State)" + Value="PointerOver" /> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource ComboBoxItemRevealBackgroundPointerOver}" /> + <Setter Target="LayoutRoot.BorderBrush" + Value="{ThemeResource ComboBoxItemRevealBorderBrushPointerOver}" /> + <Setter Target="ContentPresenter.Foreground" + Value="{ThemeResource ComboBoxItemForegroundPointerOver}" /> + </VisualState.Setters> + <Storyboard> + <PointerUpThemeAnimation Storyboard.TargetName="LayoutRoot" /> + </Storyboard> + </VisualState> + <VisualState x:Name="Disabled"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource ComboBoxItemRevealBackgroundDisabled}" /> + <Setter Target="LayoutRoot.BorderBrush" + Value="{ThemeResource ComboBoxItemRevealBorderBrushDisabled}" /> + <Setter Target="ContentPresenter.Foreground" + Value="{ThemeResource ComboBoxItemForegroundDisabled}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="Pressed"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource ComboBoxItemRevealBackgroundPressed}" /> + <Setter Target="LayoutRoot.BorderBrush" + Value="{ThemeResource ComboBoxItemRevealBorderBrushPressed}" /> + <Setter Target="ContentPresenter.Foreground" + Value="{ThemeResource ComboBoxItemForegroundPressed}" /> + <Setter Target="LayoutRoot.(media:RevealBrush.State)" + Value="Pressed" /> + </VisualState.Setters> + <Storyboard> + <PointerDownThemeAnimation Storyboard.TargetName="LayoutRoot" /> + </Storyboard> + </VisualState> + <VisualState x:Name="Selected"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource ComboBoxItemRevealBackgroundSelected}" /> + <Setter Target="LayoutRoot.BorderBrush" + Value="{ThemeResource ComboBoxItemRevealBorderBrushSelected}" /> + <Setter Target="ContentPresenter.Foreground" + Value="{ThemeResource ComboBoxItemForegroundSelected}" /> + </VisualState.Setters> + <Storyboard> + <PointerUpThemeAnimation Storyboard.TargetName="LayoutRoot" /> + </Storyboard> + </VisualState> + <VisualState x:Name="SelectedUnfocused"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource ComboBoxItemRevealBackgroundSelectedUnfocused}" /> + <Setter Target="LayoutRoot.BorderBrush" + Value="{ThemeResource ComboBoxItemRevealBorderBrushSelectedUnfocused}" /> + <Setter Target="ContentPresenter.Foreground" + Value="{ThemeResource ComboBoxItemForegroundSelectedUnfocused}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="SelectedDisabled"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource ComboBoxItemRevealBackgroundSelectedDisabled}" /> + <Setter Target="LayoutRoot.BorderBrush" + Value="{ThemeResource ComboBoxItemRevealBorderBrushSelectedDisabled}" /> + <Setter Target="ContentPresenter.Foreground" + Value="{ThemeResource ComboBoxItemForegroundSelectedDisabled}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="SelectedPointerOver"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource ComboBoxItemRevealBackgroundSelectedPointerOver}" /> + <Setter Target="LayoutRoot.BorderBrush" + Value="{ThemeResource ComboBoxItemRevealBorderBrushSelectedPointerOver}" /> + <Setter Target="ContentPresenter.Foreground" + Value="{ThemeResource ComboBoxItemForegroundSelectedPointerOver}" /> + <Setter Target="LayoutRoot.(media:RevealBrush.State)" + Value="PointerOver" /> + </VisualState.Setters> + <Storyboard> + <PointerUpThemeAnimation Storyboard.TargetName="LayoutRoot" /> + </Storyboard> + </VisualState> + <VisualState x:Name="SelectedPressed"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource ComboBoxItemRevealBackgroundSelectedPressed}" /> + <Setter Target="LayoutRoot.BorderBrush" + Value="{ThemeResource ComboBoxItemRevealBorderBrushSelectedPressed}" /> + <Setter Target="ContentPresenter.Foreground" + Value="{ThemeResource ComboBoxItemForegroundSelectedPressed}" /> + <Setter Target="LayoutRoot.(media:RevealBrush.State)" + Value="Pressed" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="InputModeStates"> + <VisualState x:Name="InputModeDefault" /> + <VisualState x:Name="TouchInputMode"> + <VisualState.Setters> + <Setter Target="ContentPresenter.Margin" + Value="{ThemeResource ComboBoxItemRevealThemeTouchPadding}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="GameControllerInputMode"> + <VisualState.Setters> + <Setter Target="ContentPresenter.Margin" + Value="{ThemeResource ComboBoxItemRevealThemeGameControllerPadding}" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + + <ContentPresenter x:Name="ContentPresenter" + Content="{TemplateBinding Content}" + ContentTransitions="{TemplateBinding ContentTransitions}" + ContentTemplate="{TemplateBinding ContentTemplate}" + Foreground="{TemplateBinding Foreground}" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + Margin="{TemplateBinding Padding}" /> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> </ResourceDictionary> \ No newline at end of file diff --git a/src/Notepads/Resource/CustomNavigationViewItemStyle.xaml b/src/Notepads/Resource/CustomNavigationViewItemStyle.xaml deleted file mode 100644 index 88e5a431e..000000000 --- a/src/Notepads/Resource/CustomNavigationViewItemStyle.xaml +++ /dev/null @@ -1,380 +0,0 @@ -<ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:Notepads"> - - <Style x:Name="NavigationViewItemPresenterStyleWhenOnLeftPane" TargetType="NavigationViewItemPresenter"> - <Setter Property="Foreground" Value="{ThemeResource NavigationViewItemForeground}"/> - <Setter Property="Background" Value="{ThemeResource NavigationViewItemBackground}"/> - <Setter Property="BorderBrush" Value="{ThemeResource NavigationViewItemBorderBrush}"/> - <Setter Property="BorderThickness" Value="{StaticResource NavigationViewItemBorderThickness}"/> - <Setter Property="UseSystemFocusVisuals" Value="True"/> - <Setter Property="HorizontalContentAlignment" Value="Stretch"/> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="NavigationViewItemPresenter"> - <Grid x:Name="LayoutRoot" Background="{TemplateBinding Background}" Height="40" Control.IsTemplateFocusTarget="True"> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="PointerStates"> - <VisualState x:Name="Normal"/> - <VisualState x:Name="PointerOver"> - <VisualState.Setters> - <Setter Target="LayoutRoot.(RevealBrush.State)" Value="PointerOver"/> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource NavigationViewItemBackgroundPointerOver}"/> - <Setter Target="RevealBorder.BorderBrush" Value="{ThemeResource NavigationViewItemBorderBrushPointerOver}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource NavigationViewItemForegroundPointerOver}"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="Pressed"> - <VisualState.Setters> - <Setter Target="LayoutRoot.(RevealBrush.State)" Value="Pressed"/> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource NavigationViewItemBackgroundPressed}"/> - <Setter Target="RevealBorder.BorderBrush" Value="{ThemeResource NavigationViewItemBorderBrushPressed}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource NavigationViewItemForegroundPressed}"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="Selected"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource NavigationViewItemBackgroundSelected}"/> - <Setter Target="RevealBorder.BorderBrush" Value="{ThemeResource NavigationViewItemBorderBrushSelected}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource NavigationViewItemForegroundSelected}"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="PointerOverSelected"> - <VisualState.Setters> - <Setter Target="LayoutRoot.(RevealBrush.State)" Value="PointerOver"/> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource NavigationViewItemBackgroundSelectedPointerOver}"/> - <Setter Target="RevealBorder.BorderBrush" Value="{ThemeResource NavigationViewItemBorderBrushSelectedPointerOver}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource NavigationViewItemForegroundSelectedPointerOver}"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="PressedSelected"> - <VisualState.Setters> - <Setter Target="LayoutRoot.(RevealBrush.State)" Value="Pressed"/> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource NavigationViewItemBackgroundSelectedPressed}"/> - <Setter Target="RevealBorder.BorderBrush" Value="{ThemeResource NavigationViewItemBorderBrushSelectedPressed}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource NavigationViewItemForegroundSelectedPressed}"/> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="DisabledStates"> - <VisualState x:Name="Enabled"/> - <VisualState x:Name="Disabled"> - <VisualState.Setters> - <Setter Target="RevealBorder.BorderBrush" Value="{ThemeResource NavigationViewItemBorderBrushCheckedDisabled}"/> - <Setter Target="LayoutRoot.Opacity" Value="{ThemeResource ListViewItemDisabledThemeOpacity}"/> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="IconStates"> - <VisualState x:Name="IconVisible"/> - <VisualState x:Name="IconCollapsed"> - <VisualState.Setters> - <Setter Target="IconBox.Visibility" Value="Collapsed"/> - <Setter Target="IconColumn.Width" Value="16"/> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - <Grid HorizontalAlignment="Left" VerticalAlignment="Center"> - <Rectangle x:Name="SelectionIndicator" Fill="{StaticResource SystemControlForegroundAccentBrush}" Height="24" Opacity="0.0" Width="6"/> - </Grid> - <Border x:Name="RevealBorder" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"/> - <Grid x:Name="ContentGrid" HorizontalAlignment="Left" Height="40"> - <Grid.ColumnDefinitions> - <ColumnDefinition x:Name="IconColumn" Width="48"/> - <ColumnDefinition Width="*"/> - </Grid.ColumnDefinitions> - <Viewbox x:Name="IconBox" Margin="{ThemeResource NavigationViewItemIconBoxMargin}"> - <ContentPresenter x:Name="Icon" Content="{TemplateBinding Icon}"/> - </Viewbox> - <ContentPresenter x:Name="ContentPresenter" AutomationProperties.AccessibilityView="Raw" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentTransitions="{TemplateBinding ContentTransitions}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" Grid.Column="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> - </Grid> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - <Style x:Name="NavigationViewItemPresenterStyleWhenOnTopPane" TargetType="NavigationViewItemPresenter"> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="NavigationViewItemPresenter"> - <Grid x:Name="LayoutRoot" Background="{TemplateBinding Background}" Control.IsTemplateFocusTarget="True"> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="PointerStates"> - <VisualState x:Name="Normal"/> - <VisualState x:Name="PointerOver"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource TopNavigationViewItemBackgroundPointerOver}"/> - <Setter Target="PointerRectangle.Fill" Value="{ThemeResource NavigationViewItemBackgroundPointerOver}"/> - <Setter Target="Icon.Foreground" Value="{ThemeResource TopNavigationViewItemForegroundPointerOver}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TopNavigationViewItemForegroundPointerOver}"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="Pressed"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource TopNavigationViewItemBackgroundPressed}"/> - <Setter Target="PointerRectangle.Fill" Value="{ThemeResource NavigationViewItemBackgroundPressed}"/> - <Setter Target="Icon.Foreground" Value="{ThemeResource TopNavigationViewItemForegroundPressed}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TopNavigationViewItemForegroundPressed}"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="Selected"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource TopNavigationViewItemBackgroundSelected}"/> - <Setter Target="PointerRectangle.Fill" Value="{ThemeResource NavigationViewItemBackgroundSelected}"/> - <Setter Target="Icon.Foreground" Value="{ThemeResource TopNavigationViewItemForegroundSelected}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TopNavigationViewItemForegroundSelected}"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="PointerOverSelected"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource TopNavigationViewItemBackgroundPointerOver}"/> - <Setter Target="PointerRectangle.Fill" Value="{ThemeResource NavigationViewItemBackgroundSelectedPointerOver}"/> - <Setter Target="Icon.Foreground" Value="{ThemeResource TopNavigationViewItemForegroundPointerOver}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TopNavigationViewItemForegroundPointerOver}"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="PressedSelected"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource TopNavigationViewItemBackgroundPressed}"/> - <Setter Target="PointerRectangle.Fill" Value="{ThemeResource NavigationViewItemBackgroundSelectedPressed}"/> - <Setter Target="Icon.Foreground" Value="{ThemeResource TopNavigationViewItemForegroundPressed}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TopNavigationViewItemForegroundPressed}"/> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="DisabledStates"> - <VisualState x:Name="Enabled"/> - <VisualState x:Name="Disabled"> - <VisualState.Setters> - <Setter Target="Icon.Foreground" Value="{ThemeResource TopNavigationViewItemForegroundDisabled}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TopNavigationViewItemForegroundDisabled}"/> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="NavigationViewIconPositionStates"> - <VisualState x:Name="IconOnLeft"/> - <VisualState x:Name="IconOnly"> - <VisualState.Setters> - <Setter Target="PointerRectangle.Visibility" Value="Visible"/> - <Setter Target="LayoutRoot.Width" Value="48"/> - <Setter Target="ContentPresenter.Visibility" Value="Collapsed"/> - <Setter Target="SelectionIndicatorGrid.Margin" Value="4,0,4,4"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="ContentOnly"> - <VisualState.Setters> - <Setter Target="IconBox.Visibility" Value="Collapsed"/> - <Setter Target="ContentPresenter.Margin" Value="12,0"/> - <Setter Target="SelectionIndicatorGrid.Margin" Value="12,0,12,4"/> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - <Rectangle x:Name="PointerRectangle" Fill="Transparent" Visibility="Collapsed"/> - <Grid x:Name="ContentGrid"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="*"/> - </Grid.ColumnDefinitions> - <Viewbox x:Name="IconBox" HorizontalAlignment="Center" Height="16" Margin="16,0,0,0" VerticalAlignment="Center" Width="16"> - <ContentPresenter x:Name="Icon" Content="{TemplateBinding Icon}" Foreground="{ThemeResource TopNavigationViewItemForeground}"/> - </Viewbox> - <ContentPresenter x:Name="ContentPresenter" AutomationProperties.AccessibilityView="Raw" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentTransitions="{TemplateBinding ContentTransitions}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" Grid.Column="1" Foreground="{ThemeResource TopNavigationViewItemForeground}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="8,0,16,0" TextWrapping="NoWrap" VerticalAlignment="Center"/> - </Grid> - <Grid x:Name="SelectionIndicatorGrid" Margin="16,0,16,4" VerticalAlignment="Bottom"> - <Rectangle x:Name="SelectionIndicator" Fill="{ThemeResource NavigationViewSelectionIndicatorForeground}" Height="2" Opacity="0"/> - </Grid> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - <Style x:Name="NavigationViewItemPresenterStyleWhenOnTopPaneWithRevealFocus" TargetType="NavigationViewItemPresenter"> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="NavigationViewItemPresenter"> - <Grid x:Name="LayoutRoot" Background="{TemplateBinding Background}" Control.IsTemplateFocusTarget="True"> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="DisabledStates"> - <VisualState x:Name="Enabled"/> - <VisualState x:Name="Disabled"> - <VisualState.Setters> - <Setter Target="Icon.Foreground" Value="{ThemeResource TopNavigationViewItemForegroundDisabled}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TopNavigationViewItemForegroundDisabled}"/> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="FocusStates"> - <VisualState x:Name="Focused"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource TopNavigationViewItemRevealBackgroundFocused}"/> - <Setter Target="Icon.Foreground" Value="{ThemeResource TopNavigationViewItemRevealIconForegroundFocused}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TopNavigationViewItemRevealContentForegroundFocused}"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="Unfocused"/> - <VisualState x:Name="PointerFocused"/> - </VisualStateGroup> - <VisualStateGroup x:Name="NavigationViewIconPositionStates"> - <VisualState x:Name="IconOnLeft"/> - <VisualState x:Name="IconOnly"> - <VisualState.Setters> - <Setter Target="PointerRectangle.Visibility" Value="Visible"/> - <Setter Target="LayoutRoot.Width" Value="48"/> - <Setter Target="ContentPresenter.Visibility" Value="Collapsed"/> - <Setter Target="SelectionIndicatorGrid.Margin" Value="4,0"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="ContentOnly"> - <VisualState.Setters> - <Setter Target="IconBox.Visibility" Value="Collapsed"/> - <Setter Target="ContentPresenter.Margin" Value="12,0"/> - <Setter Target="SelectionIndicatorGrid.Margin" Value="12,0"/> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - <Rectangle x:Name="PointerRectangle" Fill="Transparent" Visibility="Collapsed"/> - <Grid x:Name="ContentGrid"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="*"/> - </Grid.ColumnDefinitions> - <Viewbox x:Name="IconBox" HorizontalAlignment="Center" Height="16" Margin="16,0,0,0" VerticalAlignment="Center" Width="16"> - <ContentPresenter x:Name="Icon" Content="{TemplateBinding Icon}" Foreground="{ThemeResource DefaultTextForegroundThemeBrush}"/> - </Viewbox> - <ContentPresenter x:Name="ContentPresenter" AutomationProperties.AccessibilityView="Raw" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentTransitions="{TemplateBinding ContentTransitions}" Grid.Column="1" Foreground="{ThemeResource DefaultTextForegroundThemeBrush}" Margin="8,0,16,0" TextWrapping="NoWrap" VerticalAlignment="Center"/> - </Grid> - <Grid x:Name="SelectionIndicatorGrid" Margin="16,0,16,4" VerticalAlignment="Bottom"> - <Rectangle x:Name="SelectionIndicator" Fill="{ThemeResource NavigationViewSelectionIndicatorForeground}" Height="2" Opacity="0"/> - </Grid> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - <Style x:Name="NavigationViewItemPresenterStyleWhenOnTopPaneOverflow" TargetType="NavigationViewItemPresenter"> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="NavigationViewItemPresenter"> - <Grid x:Name="LayoutRoot" Background="{TemplateBinding Background}" Height="40" Control.IsTemplateFocusTarget="True"> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="PointerStates"> - <VisualState x:Name="Normal"/> - <VisualState x:Name="PointerOver"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource NavigationViewItemBackgroundPointerOver}"/> - <Setter Target="Icon.Foreground" Value="{ThemeResource NavigationViewItemForegroundPointerOver}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource NavigationViewItemForegroundPointerOver}"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="Pressed"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource NavigationViewItemBackgroundPressed}"/> - <Setter Target="Icon.Foreground" Value="{ThemeResource NavigationViewItemForegroundPressed}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource NavigationViewItemForegroundPressed}"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="Selected"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource NavigationViewItemBackgroundSelected}"/> - <Setter Target="Icon.Foreground" Value="{ThemeResource NavigationViewItemForegroundSelected}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource NavigationViewItemForegroundSelected}"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="PointerOverSelected"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource NavigationViewItemBackgroundSelectedPointerOver}"/> - <Setter Target="Icon.Foreground" Value="{ThemeResource NavigationViewItemForegroundPointerOver}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource NavigationViewItemForegroundPointerOver}"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="PressedSelected"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource NavigationViewItemBackgroundSelectedPressed}"/> - <Setter Target="Icon.Foreground" Value="{ThemeResource NavigationViewItemForegroundPressed}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource NavigationViewItemForegroundPressed}"/> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="DisabledStates"> - <VisualState x:Name="Enabled"/> - <VisualState x:Name="Disabled"> - <VisualState.Setters> - <Setter Target="Icon.Foreground" Value="{ThemeResource TopNavigationViewItemForegroundDisabled}"/> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TopNavigationViewItemForegroundDisabled}"/> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="NavigationViewIconPositionStates"> - <VisualState x:Name="IconOnLeft"/> - <VisualState x:Name="IconOnly"/> - <VisualState x:Name="ContentOnly"> - <VisualState.Setters> - <Setter Target="IconBox.Visibility" Value="Collapsed"/> - <Setter Target="ContentPresenter.Margin" Value="16,0"/> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - <Grid x:Name="ContentGrid"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="*"/> - </Grid.ColumnDefinitions> - <Viewbox x:Name="IconBox" HorizontalAlignment="Center" Height="16" Margin="16,0,0,0" VerticalAlignment="Center" Width="16"> - <ContentPresenter x:Name="Icon" Content="{TemplateBinding Icon}" Foreground="{TemplateBinding Foreground}"/> - </Viewbox> - <ContentPresenter x:Name="ContentPresenter" AutomationProperties.AccessibilityView="Raw" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentTransitions="{TemplateBinding ContentTransitions}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" Grid.Column="1" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="12,0,16,0" TextWrapping="NoWrap" VerticalAlignment="Center"/> - </Grid> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - <Style x:Key="CustomNavigationViewItemStyle" TargetType="NavigationViewItem"> - <Setter Property="Foreground" Value="{ThemeResource NavigationViewItemForeground}"/> - <Setter Property="Background" Value="{ThemeResource NavigationViewItemBackground}"/> - <Setter Property="BorderBrush" Value="{ThemeResource NavigationViewItemBorderBrush}"/> - <Setter Property="BorderThickness" Value="{StaticResource NavigationViewItemBorderThickness}"/> - <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/> - <Setter Property="FontWeight" Value="Normal"/> - <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/> - <Setter Property="UseSystemFocusVisuals" Value="True"/> - <Setter Property="HorizontalContentAlignment" Value="Stretch"/> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="NavigationViewItem"> - <NavigationViewItemPresenter x:Name="NavigationViewItemPresenter" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentTransitions="{TemplateBinding ContentTransitions}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Icon="{TemplateBinding Icon}" IsTabStop="False" Margin="{TemplateBinding Margin}" Padding="{TemplateBinding Padding}" UseSystemFocusVisuals="{TemplateBinding UseSystemFocusVisuals}" VerticalAlignment="{TemplateBinding VerticalAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="ItemOnNavigationViewListPositionStates"> - <VisualState x:Name="OnLeftNavigation"> - <VisualState.Setters> - <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource NavigationViewItemPresenterStyleWhenOnLeftPane}"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="OnTopNavigationPrimary"> - <VisualState.Setters> - <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource NavigationViewItemPresenterStyleWhenOnTopPane}"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="OnTopNavigationPrimaryReveal"> - <VisualState.Setters> - <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource NavigationViewItemPresenterStyleWhenOnTopPaneWithRevealFocus}"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="OnTopNavigationOverflow"> - <VisualState.Setters> - <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource NavigationViewItemPresenterStyleWhenOnTopPaneOverflow}"/> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - </NavigationViewItemPresenter> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> -</ResourceDictionary> diff --git a/src/Notepads/Resource/CustomNavigationViewStyle.xaml b/src/Notepads/Resource/CustomNavigationViewStyle.xaml new file mode 100644 index 000000000..c46bc0cf4 --- /dev/null +++ b/src/Notepads/Resource/CustomNavigationViewStyle.xaml @@ -0,0 +1,275 @@ +<ResourceDictionary + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" + xmlns:muxcp="using:Microsoft.UI.Xaml.Controls.Primitives" + xmlns:local="using:Notepads"> + <Style x:Key="PaneToggleButtonStyle" TargetType="Button"> + <Setter Property="FontSize" Value="16" /> + <Setter Property="FontFamily" Value="{StaticResource SymbolThemeFontFamily}" /> + <Setter Property="MinHeight" Value="{StaticResource PaneToggleButtonHeight}" /> + <Setter Property="MinWidth" Value="{StaticResource PaneToggleButtonWidth}" /> + <Setter Property="Padding" Value="0" /> + <Setter Property="HorizontalAlignment" Value="Center" /> + <Setter Property="VerticalAlignment" Value="Top" /> + <Setter Property="HorizontalContentAlignment" Value="Center" /> + <Setter Property="VerticalContentAlignment" Value="Center" /> + <Setter Property="Background" Value="{ThemeResource NavigationViewItemBackground}" /> + <Setter Property="Foreground" Value="{ThemeResource NavigationViewItemForeground}" /> + <Setter Property="BorderThickness" Value="{ThemeResource NavigationViewToggleBorderThickness}" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="Button"> + <Grid x:Name="LayoutRoot" + MinWidth="{TemplateBinding MinWidth}" + Height="{TemplateBinding MinHeight}" + Margin="{TemplateBinding Padding}" + Background="{TemplateBinding Background}" + CornerRadius="{ThemeResource ControlCornerRadius}" + HorizontalAlignment="Stretch"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="{ThemeResource PaneToggleButtonHeight}" /> + </Grid.RowDefinitions> + + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="CommonStates"> + <VisualState x:Name="Normal" /> + <VisualState x:Name="PointerOver"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource NavigationViewButtonBackgroundPointerOver}" /> + <Setter Target="ContentPresenter.Foreground" + Value="{ThemeResource NavigationViewButtonForegroundPointerOver}" /> + <Setter Target="Icon.Foreground" + Value="{ThemeResource NavigationViewButtonForegroundPointerOver}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="Pressed"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource NavigationViewButtonBackgroundPressed}" /> + <Setter Target="ContentPresenter.Foreground" + Value="{ThemeResource NavigationViewButtonForegroundPressed}" /> + <Setter Target="Icon.Foreground" + Value="{ThemeResource NavigationViewButtonForegroundPressed}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="Disabled"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource NavigationViewButtonBackgroundDisabled}" /> + <Setter Target="ContentPresenter.Foreground" + Value="{ThemeResource NavigationViewButtonForegroundDisabled}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="Checked"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource ToggleButtonBackgroundChecked}" /> + <Setter Target="ContentPresenter.Foreground" + Value="{ThemeResource ToggleButtonForegroundChecked}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="CheckedPointerOver"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource ToggleButtonBackgroundCheckedPointerOver}" /> + <Setter Target="ContentPresenter.Foreground" + Value="{ThemeResource ToggleButtonForegroundCheckedPointerOver}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="CheckedPressed"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource ToggleButtonBackgroundCheckedPressed}" /> + <Setter Target="ContentPresenter.Foreground" + Value="{ThemeResource ToggleButtonForegroundCheckedPressed}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="CheckedDisabled"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Background" + Value="{ThemeResource ToggleButtonBackgroundCheckedDisabled}" /> + <Setter Target="ContentPresenter.Foreground" + Value="{ThemeResource ToggleButtonForegroundCheckedDisabled}" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + + <Border Width="{TemplateBinding MinWidth}"> + <Viewbox x:Name="IconHost" + Width="16" + Height="16" + HorizontalAlignment="Center" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + AutomationProperties.AccessibilityView="Raw"> + <TextBlock x:Name="Icon" + Text="" + FontSize="{TemplateBinding FontSize}" + AutomationProperties.AccessibilityView="Raw" /> + </Viewbox> + </Border> + <ContentPresenter x:Name="ContentPresenter" + VerticalContentAlignment="Center" + Content="{TemplateBinding Content}" + FontSize="{TemplateBinding FontSize}" + Grid.Column="1" /> + <Border x:Name="RevealBorder" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Grid.ColumnSpan="2" /> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="CustomNavigationViewItemStyle" TargetType="muxc:NavigationViewItem"> + <Setter Property="Foreground" Value="{ThemeResource NavigationViewItemForeground}" /> + <Setter Property="Background" Value="{ThemeResource NavigationViewItemBackground}" /> + <Setter Property="BorderBrush" Value="{ThemeResource NavigationViewItemBorderBrush}" /> + <Setter Property="BorderThickness" Value="{StaticResource NavigationViewItemBorderThickness}" /> + <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> + <Setter Property="FontWeight" Value="Normal" /> + <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> + <Setter Property="Margin" Value="{ThemeResource NavigationViewItemMargin}" /> + <Setter Property="UseSystemFocusVisuals" Value="True" /> + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> + <Setter Property="TabNavigation" Value="Once"/> + <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="muxc:NavigationViewItem"> + <Grid x:Name="NVIRootGrid" CornerRadius="{TemplateBinding CornerRadius}"> + <Grid.RowDefinitions> + <RowDefinition Height="*"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="ItemOnNavigationViewListPositionStates"> + <VisualState x:Name="OnLeftNavigation"> + <VisualState.Setters> + <Setter Target="NavigationViewItemPresenter.Style" + Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnLeftPane}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="OnLeftNavigationReveal"> + <VisualState.Setters> + <Setter Target="NavigationViewItemPresenter.Style" + Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnLeftPaneWithRevealFocus}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="OnTopNavigationPrimary"> + <VisualState.Setters> + <Setter Target="NavigationViewItemPresenter.Margin" + Value="{ThemeResource TopNavigationViewItemMargin}"/> + <Setter Target="NavigationViewItemPresenter.Style" + Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPane}" /> + <Setter Target="ChildrenFlyout.Placement" + Value="BottomEdgeAlignedLeft"/> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="OnTopNavigationPrimaryReveal"> + <VisualState.Setters> + <Setter Target="NavigationViewItemPresenter.Margin" + Value="{ThemeResource TopNavigationViewItemMargin}"/> + <Setter Target="NavigationViewItemPresenter.Style" + Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPaneWithRevealFocus}" /> + <Setter Target="ChildrenFlyout.Placement" + Value="BottomEdgeAlignedLeft"/> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="OnTopNavigationOverflow"> + <VisualState.Setters> + <Setter Target="NavigationViewItemPresenter.Style" + Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPaneOverflow}" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + + <muxcp:NavigationViewItemPresenter x:Name="NavigationViewItemPresenter" + Icon="{TemplateBinding Icon}" + ContentTransitions="{TemplateBinding ContentTransitions}" + ContentTemplate="{TemplateBinding ContentTemplate}" + Margin="{TemplateBinding Margin}" + Padding="{TemplateBinding Padding}" + Foreground="{TemplateBinding Foreground}" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + UseSystemFocusVisuals="{TemplateBinding UseSystemFocusVisuals}" + VerticalAlignment="{TemplateBinding VerticalAlignment}" + HorizontalAlignment="{TemplateBinding HorizontalAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" + Content="{TemplateBinding Content}" + CornerRadius="{TemplateBinding CornerRadius}" + IsTabStop="false" + Control.IsTemplateFocusTarget="True"> + </muxcp:NavigationViewItemPresenter> + <muxc:ItemsRepeater Grid.Row="1" + Visibility="Collapsed" + x:Name="NavigationViewItemMenuItemsHost"> + <muxc:ItemsRepeater.Layout> + <muxc:StackLayout Orientation="Vertical"/> + </muxc:ItemsRepeater.Layout> + </muxc:ItemsRepeater> + <FlyoutBase.AttachedFlyout> + <Flyout x:Name="ChildrenFlyout" Placement="RightEdgeAlignedTop"> + <Flyout.FlyoutPresenterStyle> + <Style TargetType="FlyoutPresenter"> + <Setter Property="Padding" Value="{ThemeResource NavigationViewItemChildrenMenuFlyoutPadding}" /> + <!--Set negative top margin to make the flyout align exactly with the button--> + <Setter Property="Margin" Value="0,-4,0,0" /> + <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto" /> + <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" /> + <Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto" /> + <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> + <Setter Property="ScrollViewer.ZoomMode" Value="Disabled" /> + <Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="FlyoutPresenter"> + <ScrollViewer x:Name="ScrollViewer" + ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}" + HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" + HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" + VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" + VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" + AutomationProperties.AccessibilityView="Raw"> + <ContentPresenter x:Name="ContentPresenter" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Content="{TemplateBinding Content}" + ContentTemplate="{TemplateBinding ContentTemplate}" + ContentTransitions="{TemplateBinding ContentTransitions}" + Padding="{TemplateBinding Padding}" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + CornerRadius="{TemplateBinding CornerRadius}"/> + </ScrollViewer> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + </Flyout.FlyoutPresenterStyle> + <Grid x:Name="FlyoutRootGrid"> + <Grid x:Name="FlyoutContentGrid"/> + </Grid> + </Flyout> + </FlyoutBase.AttachedFlyout> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> +</ResourceDictionary> diff --git a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml index b79477cbf..8f05a8cfa 100644 --- a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml +++ b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml @@ -5,7 +5,6 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:controls="using:Notepads.Controls" - xmlns:muxc="using:Microsoft.UI.Xaml.Controls" xmlns:ui="using:Microsoft.Toolkit.Uwp.UI" xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" xmlns:Core="using:Microsoft.Xaml.Interactions.Core" diff --git a/src/Notepads/Views/Settings/SettingsPage.xaml b/src/Notepads/Views/Settings/SettingsPage.xaml index 754c9dc2c..f1c09b810 100644 --- a/src/Notepads/Views/Settings/SettingsPage.xaml +++ b/src/Notepads/Views/Settings/SettingsPage.xaml @@ -4,55 +4,56 @@ 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" + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" xmlns:settings="using:Notepads.Views.Settings" mc:Ignorable="d" Background="{ThemeResource SystemControlForegroundTransparentBrush}"> - <NavigationView x:Name="SettingsNavigationView" - IsPaneOpen="False" - IsSettingsVisible="False" - IsBackEnabled="False" - IsBackButtonVisible="Collapsed" - PaneDisplayMode="LeftCompact" - OpenPaneLength="200" - ItemInvoked="SettingsPanel_OnItemInvoked"> + <muxc:NavigationView x:Name="SettingsNavigationView" + IsPaneOpen="False" + IsSettingsVisible="False" + IsBackEnabled="False" + IsBackButtonVisible="Collapsed" + PaneDisplayMode="LeftCompact" + OpenPaneLength="200" + PaneToggleButtonStyle="{StaticResource PaneToggleButtonStyle}" + ItemInvoked="SettingsPanel_OnItemInvoked"> - <NavigationView.MenuItems> - <NavigationViewItem Style="{StaticResource CustomNavigationViewItemStyle}" - x:Uid="/Settings/TextAndEditorPage_Title" - Tag="TextAndEditor" - IsSelected="True"> - <NavigationViewItem.Icon> + <muxc:NavigationView.MenuItems> + <muxc:NavigationViewItem x:Uid="/Settings/TextAndEditorPage_Title" + Style="{StaticResource CustomNavigationViewItemStyle}" + Tag="TextAndEditor" + IsSelected="True"> + <muxc:NavigationViewItem.Icon> <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> - </NavigationViewItem.Icon> - </NavigationViewItem> - <NavigationViewItem Style="{StaticResource CustomNavigationViewItemStyle}" - x:Uid="/Settings/PersonalizationPage_Title" - Tag="Personalization" > - <NavigationViewItem.Icon> + </muxc:NavigationViewItem.Icon> + </muxc:NavigationViewItem> + <muxc:NavigationViewItem x:Uid="/Settings/PersonalizationPage_Title" + Style="{StaticResource CustomNavigationViewItemStyle}" + Tag="Personalization" > + <muxc:NavigationViewItem.Icon> <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> - </NavigationViewItem.Icon> - </NavigationViewItem> - <NavigationViewItem Style="{StaticResource CustomNavigationViewItemStyle}" - x:Uid="/Settings/AdvancedPage_Title" - Tag="Advanced" > - <NavigationViewItem.Icon> + </muxc:NavigationViewItem.Icon> + </muxc:NavigationViewItem> + <muxc:NavigationViewItem x:Uid="/Settings/AdvancedPage_Title" + Style="{StaticResource CustomNavigationViewItemStyle}" + Tag="Advanced" > + <muxc:NavigationViewItem.Icon> <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> - </NavigationViewItem.Icon> - </NavigationViewItem> - <NavigationViewItem Style="{StaticResource CustomNavigationViewItemStyle}" - x:Uid="/Settings/AboutPage_Title" - Tag="About" > - <NavigationViewItem.Icon> + </muxc:NavigationViewItem.Icon> + </muxc:NavigationViewItem> + <muxc:NavigationViewItem x:Uid="/Settings/AboutPage_Title" + Style="{StaticResource CustomNavigationViewItemStyle}" + Tag="About" > + <muxc:NavigationViewItem.Icon> <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> - </NavigationViewItem.Icon> - </NavigationViewItem> - </NavigationView.MenuItems> + </muxc:NavigationViewItem.Icon> + </muxc:NavigationViewItem> + </muxc:NavigationView.MenuItems> <settings:SettingsPanel x:Name="SettingsPanel"/> - </NavigationView> - + </muxc:NavigationView> </Page> diff --git a/src/Notepads/Views/Settings/SettingsPage.xaml.cs b/src/Notepads/Views/Settings/SettingsPage.xaml.cs index 82d51f292..8378e28ea 100644 --- a/src/Notepads/Views/Settings/SettingsPage.xaml.cs +++ b/src/Notepads/Views/Settings/SettingsPage.xaml.cs @@ -1,14 +1,14 @@ namespace Notepads.Views.Settings { + using Microsoft.UI.Xaml.Controls; using Notepads.Extensions; using Notepads.Services; using System.Linq; using Windows.UI; using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Navigation; - public sealed partial class SettingsPage : Page + public sealed partial class SettingsPage : Windows.UI.Xaml.Controls.Page { public SettingsPage() { @@ -29,7 +29,10 @@ private void SettingsPage_Loaded(object sender, RoutedEventArgs e) ThemeSettingsService.OnThemeChanged += ThemeSettingsService_OnThemeChanged; ThemeSettingsService.OnAccentColorChanged += ThemeSettingsService_OnAccentColorChanged; } - ((NavigationViewItem)SettingsNavigationView.MenuItems.First()).IsSelected = true; + + var firstItem = ((NavigationViewItem)SettingsNavigationView.MenuItems.First()); + firstItem.IsSelected = true; + SettingsPanel.Show(firstItem.Content.ToString(), firstItem?.Tag as string); } private void SettingsPage_Unloaded(object sender, RoutedEventArgs e) From f64fc0d5dc8b02d7653c9b63160a7b66cc875597 Mon Sep 17 00:00:00 2001 From: Soumya Ranjan Mahunt <devsoumyamahunt@gmail.com> Date: Fri, 19 Mar 2021 20:10:10 +0530 Subject: [PATCH 04/15] Use OverlayCornerRadius instead of ControlCornerRadius for dialogs. --- src/Notepads/Controls/Dialog/NotepadsDialog.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Notepads/Controls/Dialog/NotepadsDialog.cs b/src/Notepads/Controls/Dialog/NotepadsDialog.cs index d6d32e872..7aa0f2746 100644 --- a/src/Notepads/Controls/Dialog/NotepadsDialog.cs +++ b/src/Notepads/Controls/Dialog/NotepadsDialog.cs @@ -17,7 +17,7 @@ public class NotepadsDialog : ContentDialog public NotepadsDialog() { - CornerRadius = (CornerRadius)Application.Current.Resources["ControlCornerRadius"]; + CornerRadius = (CornerRadius)Application.Current.Resources["OverlayCornerRadius"]; PrimaryButtonStyle = GetButtonStyle(); SecondaryButtonStyle = GetButtonStyle(); CloseButtonStyle = GetButtonStyle(); From 758cac7954a6a309ce2b027981294669443ea236 Mon Sep 17 00:00:00 2001 From: Soumya Ranjan Mahunt <devsoumyamahunt@gmail.com> Date: Sat, 20 Mar 2021 21:31:06 +0530 Subject: [PATCH 05/15] Update find/replace/goto control and inapp notification style. --- .../FindAndReplace/FindAndReplaceControl.xaml | 34 +++++++------- .../FindAndReplacePlaceHolder.xaml | 47 ++++++++++++------- .../Controls/TextEditor/TextEditor.xaml | 6 ++- .../InAppNotificationNoDismissButton.xaml | 3 +- .../Views/MainPage/NotepadsMainPage.xaml | 6 +-- 5 files changed, 58 insertions(+), 38 deletions(-) diff --git a/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml b/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml index c910d6433..661fb42c3 100644 --- a/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml +++ b/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml @@ -10,7 +10,6 @@ d:DesignWidth="250"> <Grid x:Name="FindAndReplaceRootGrid" KeyDown="FindAndReplaceRootGrid_KeyDown"> - <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> @@ -75,19 +74,25 @@ FontFamily="Segoe MDL2 Assets"> <Button.Flyout> <MenuFlyout Placement="BottomEdgeAlignedRight"> - <ToggleMenuFlyoutItem x:Uid="FindAndReplace_SearchOptionToggleButton_MatchCase" x:Name="MatchCaseToggle" Click="OptionButtonFlyoutItem_OnClick"> + <ToggleMenuFlyoutItem x:Uid="FindAndReplace_SearchOptionToggleButton_MatchCase" + x:Name="MatchCaseToggle" + Click="OptionButtonFlyoutItem_OnClick"> <ToggleMenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Modifiers="Menu" Key="C"/> + <KeyboardAccelerator Modifiers="Menu" Key="C" /> </ToggleMenuFlyoutItem.KeyboardAccelerators> </ToggleMenuFlyoutItem> - <ToggleMenuFlyoutItem x:Uid="FindAndReplace_SearchOptionToggleButton_MatchWholeWord" x:Name="MatchWholeWordToggle" Click="OptionButtonFlyoutItem_OnClick"> + <ToggleMenuFlyoutItem x:Uid="FindAndReplace_SearchOptionToggleButton_MatchWholeWord" + x:Name="MatchWholeWordToggle" + Click="OptionButtonFlyoutItem_OnClick"> <ToggleMenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Modifiers="Menu" Key="W"/> + <KeyboardAccelerator Modifiers="Menu" Key="W" /> </ToggleMenuFlyoutItem.KeyboardAccelerators> </ToggleMenuFlyoutItem> - <ToggleMenuFlyoutItem x:Uid="FindAndReplace_SearchOptionToggleButton_UseRegex" x:Name="UseRegexToggle" Click="OptionButtonFlyoutItem_OnClick"> + <ToggleMenuFlyoutItem x:Uid="FindAndReplace_SearchOptionToggleButton_UseRegex" + x:Name="UseRegexToggle" + Click="OptionButtonFlyoutItem_OnClick"> <ToggleMenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Modifiers="Menu" Key="E"/> + <KeyboardAccelerator Modifiers="Menu" Key="E" /> </ToggleMenuFlyoutItem.KeyboardAccelerators> </ToggleMenuFlyoutItem> </MenuFlyout> @@ -111,11 +116,10 @@ TextChanged="ReplaceBar_OnTextChanged" KeyDown="ReplaceBar_OnKeyDown" GotFocus="ReplaceBar_GotFocus" - LostFocus="ReplaceBar_LostFocus"/> + LostFocus="ReplaceBar_LostFocus" /> </Grid> <Grid Grid.Row="0" Grid.Column="2" Padding="1, 1, 1, 1" Height="36"> - <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> @@ -134,7 +138,7 @@ FontFamily="Segoe MDL2 Assets" Click="SearchBackwardButton_OnClick"> <Button.KeyboardAccelerators> - <KeyboardAccelerator Modifiers="Shift" Key="F3"/> + <KeyboardAccelerator Modifiers="Shift" Key="F3" /> </Button.KeyboardAccelerators> </Button> @@ -150,7 +154,7 @@ FontFamily="Segoe MDL2 Assets" Click="SearchForwardButton_OnClick"> <Button.KeyboardAccelerators> - <KeyboardAccelerator Key="F3"/> + <KeyboardAccelerator Key="F3" /> </Button.KeyboardAccelerators> </Button> @@ -163,12 +167,10 @@ Style="{StaticResource DismissButtonStyle}" Content="" FontFamily="Segoe MDL2 Assets" - Click="DismissButton_OnClick" > - </Button> + Click="DismissButton_OnClick" /> </Grid> <Grid Grid.Row="1" Grid.Column="2" Padding="1, 1, 1, 1" Height="36"> - <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> @@ -187,7 +189,7 @@ FontFamily="Segoe MDL2 Assets" Click="ReplaceButton_OnClick"> <Button.KeyboardAccelerators> - <KeyboardAccelerator Modifiers="Menu" Key="R"/> + <KeyboardAccelerator Modifiers="Menu" Key="R" /> </Button.KeyboardAccelerators> </Button> @@ -203,7 +205,7 @@ FontFamily="Segoe MDL2 Assets" Click="ReplaceAllButton_OnClick"> <Button.KeyboardAccelerators> - <KeyboardAccelerator Modifiers="Control,Menu" Key="Enter"/> + <KeyboardAccelerator Modifiers="Control,Menu" Key="Enter" /> </Button.KeyboardAccelerators> </Button> </Grid> diff --git a/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml b/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml index 1e28862ce..377259085 100644 --- a/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml +++ b/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml @@ -14,22 +14,26 @@ <Storyboard> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> - <EasingDoubleKeyFrame KeyTime="0" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <EasingDoubleKeyFrame KeyTime="0" + Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> - <EasingDoubleKeyFrame KeyTime="0" Value="20" /> + <EasingDoubleKeyFrame KeyTime="0" + Value="20" /> <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.Opacity)"> - <EasingDoubleKeyFrame KeyTime="0" Value="1" /> - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" /> + <EasingDoubleKeyFrame KeyTime="0" + Value="1" /> + <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" + Value="0" /> </DoubleAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" @@ -52,20 +56,26 @@ <Storyboard> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> - <EasingDoubleKeyFrame KeyTime="0" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <EasingDoubleKeyFrame KeyTime="0" + Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" + Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> - <EasingDoubleKeyFrame KeyTime="0" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="20" /> + <EasingDoubleKeyFrame KeyTime="0" + Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" + Value="20" /> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.Opacity)"> - <EasingDoubleKeyFrame KeyTime="0" Value="0" /> - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="1" /> + <EasingDoubleKeyFrame KeyTime="0" + Value="0" /> + <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" + Value="1" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualState> @@ -77,16 +87,21 @@ Margin="{TemplateBinding Margin}" MaxWidth="{TemplateBinding MaxWidth}" Visibility="{TemplateBinding Visibility}" - Height="{TemplateBinding Height}"> + Height="{TemplateBinding Height}" + CornerRadius="{TemplateBinding CornerRadius}"> <Grid.RenderTransform> <CompositeTransform /> </Grid.RenderTransform> - <controls:DropShadowPanel BlurRadius="10" ShadowOpacity="0.25" - OffsetX="0" OffsetY="0" - HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"> - <Grid Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" + <controls:DropShadowPanel BlurRadius="10" + ShadowOpacity="1" + OffsetX="0" + OffsetY="0" + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch" + IsMasked="True"> + <Grid Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"> <Grid.ColumnDefinitions> diff --git a/src/Notepads/Controls/TextEditor/TextEditor.xaml b/src/Notepads/Controls/TextEditor/TextEditor.xaml index d4cdad7f9..659645ead 100644 --- a/src/Notepads/Controls/TextEditor/TextEditor.xaml +++ b/src/Notepads/Controls/TextEditor/TextEditor.xaml @@ -105,7 +105,8 @@ VerticalOffset="10" HorizontalOffset="-22" FontWeight="Light" - BorderThickness="1" + BorderThickness="0" + CornerRadius="{ThemeResource OverlayCornerRadius}" Closed="FindAndReplacePlaceholder_Closed"> <controls:InAppNotification.Content> <findAndReplace:FindAndReplaceControl x:Name="FindAndReplaceControl" @@ -128,7 +129,8 @@ VerticalOffset="0" HorizontalOffset="-22" FontWeight="Light" - BorderThickness="1" + BorderThickness="0" + CornerRadius="{ThemeResource OverlayCornerRadius}" Closed="GoToPlaceholder_Closed"> <controls:InAppNotification.Content> <goTo:GoToControl x:Name="GoToControl" diff --git a/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml b/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml index 69cd512b8..c3e2a65c2 100644 --- a/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml +++ b/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml @@ -76,7 +76,8 @@ RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}" Margin="{TemplateBinding Margin}" MaxWidth="{TemplateBinding MaxWidth}" - Visibility="{TemplateBinding Visibility}"> + Visibility="{TemplateBinding Visibility}" + CornerRadius="{TemplateBinding CornerRadius}"> <Grid.RenderTransform> <CompositeTransform /> </Grid.RenderTransform> diff --git a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml index 8f05a8cfa..e92402722 100644 --- a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml +++ b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml @@ -245,7 +245,8 @@ VerticalOffset="-20" HorizontalOffset="0" FontWeight="Light" - BorderThickness="1"> + BorderThickness="0" + CornerRadius="{ThemeResource OverlayCornerRadius}"> </controls:InAppNotification> </Grid> </SplitView.Content> @@ -436,8 +437,7 @@ <TextBlock x:Name="ModificationIndicator" Style="{StaticResource StatusBarTextBlockStyle}" Foreground="{StaticResource SystemControlForegroundAccentBrush}" IsTapEnabled="True" - Tapped="StatusBarComponent_OnTapped" - > + Tapped="StatusBarComponent_OnTapped"> <TextBlock.ContextFlyout> <MenuFlyout x:Name="ModificationFlyout" Placement="TopEdgeAlignedRight" Closing="StatusBarFlyout_OnClosing"> <MenuFlyoutItem x:Name="PreviewTextChangesFlyoutItem" From acb59e9844416cf4a4568bb93105abc204502718 Mon Sep 17 00:00:00 2001 From: Soumya Ranjan Mahunt <devsoumyamahunt@gmail.com> Date: Sun, 21 Mar 2021 11:31:27 +0530 Subject: [PATCH 06/15] Fixed shadow not working for some scenario. --- .../FindAndReplace/FindAndReplacePlaceHolder.xaml | 8 ++++---- .../Resource/InAppNotificationNoDismissButton.xaml | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml b/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml index 377259085..21e434178 100644 --- a/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml +++ b/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml @@ -87,14 +87,13 @@ Margin="{TemplateBinding Margin}" MaxWidth="{TemplateBinding MaxWidth}" Visibility="{TemplateBinding Visibility}" - Height="{TemplateBinding Height}" - CornerRadius="{TemplateBinding CornerRadius}"> + Height="{TemplateBinding Height}"> <Grid.RenderTransform> <CompositeTransform /> </Grid.RenderTransform> <controls:DropShadowPanel BlurRadius="10" - ShadowOpacity="1" + ShadowOpacity="0.25" OffsetX="0" OffsetY="0" HorizontalContentAlignment="Stretch" @@ -103,7 +102,8 @@ <Grid Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" - Padding="{TemplateBinding Padding}"> + Padding="{TemplateBinding Padding}" + CornerRadius="{TemplateBinding CornerRadius}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> diff --git a/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml b/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml index c3e2a65c2..c6ce9c897 100644 --- a/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml +++ b/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml @@ -76,8 +76,7 @@ RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}" Margin="{TemplateBinding Margin}" MaxWidth="{TemplateBinding MaxWidth}" - Visibility="{TemplateBinding Visibility}" - CornerRadius="{TemplateBinding CornerRadius}"> + Visibility="{TemplateBinding Visibility}"> <Grid.RenderTransform> <CompositeTransform /> </Grid.RenderTransform> @@ -88,7 +87,8 @@ <Grid Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" - Padding="{TemplateBinding Padding}"> + Padding="{TemplateBinding Padding}" + CornerRadius="{TemplateBinding CornerRadius}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> From 605c103e66b1c42e246514eba087bce6f02c893a Mon Sep 17 00:00:00 2001 From: Soumya Ranjan Mahunt <devsoumyamahunt@gmail.com> Date: Sun, 21 Mar 2021 11:50:41 +0530 Subject: [PATCH 07/15] Restore border thickness for inappnotifications. --- src/Notepads/Controls/TextEditor/TextEditor.xaml | 4 ++-- src/Notepads/Views/MainPage/NotepadsMainPage.xaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Notepads/Controls/TextEditor/TextEditor.xaml b/src/Notepads/Controls/TextEditor/TextEditor.xaml index 659645ead..7f6cdbf9d 100644 --- a/src/Notepads/Controls/TextEditor/TextEditor.xaml +++ b/src/Notepads/Controls/TextEditor/TextEditor.xaml @@ -105,7 +105,7 @@ VerticalOffset="10" HorizontalOffset="-22" FontWeight="Light" - BorderThickness="0" + BorderThickness="1" CornerRadius="{ThemeResource OverlayCornerRadius}" Closed="FindAndReplacePlaceholder_Closed"> <controls:InAppNotification.Content> @@ -129,7 +129,7 @@ VerticalOffset="0" HorizontalOffset="-22" FontWeight="Light" - BorderThickness="0" + BorderThickness="1" CornerRadius="{ThemeResource OverlayCornerRadius}" Closed="GoToPlaceholder_Closed"> <controls:InAppNotification.Content> diff --git a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml index e92402722..e072b4aff 100644 --- a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml +++ b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml @@ -245,7 +245,7 @@ VerticalOffset="-20" HorizontalOffset="0" FontWeight="Light" - BorderThickness="0" + BorderThickness="1" CornerRadius="{ThemeResource OverlayCornerRadius}"> </controls:InAppNotification> </Grid> From e7016ce7ec2436cadc3f179e74809e637f7fc17a Mon Sep 17 00:00:00 2001 From: Soumya Ranjan Mahunt <devsoumyamahunt@gmail.com> Date: Sun, 21 Mar 2021 21:08:59 +0530 Subject: [PATCH 08/15] Remove old WCT part from froject and adopt new version. --- .../DropShadowPanel.Properties.cs | 204 ----- .../DropShadowPanel/DropShadowPanel.cs | 191 ---- .../DropShadowPanel/DropShadowPanel.xaml | 30 - .../GridSplitter/GridSplitter.Data.cs | 158 ---- .../GridSplitter/GridSplitter.Events.cs | 302 ------- .../GridSplitter/GridSplitter.Helper.cs | 261 ------ .../GridSplitter/GridSplitter.Options.cs | 225 ----- .../GridSplitter/GridSplitter.cs | 246 ----- .../GridSplitter/GridSplitter.xaml | 52 -- .../GridSplitter/GripperHoverWrapper.cs | 154 ---- .../Helpers/DispatcherQueueHelper.cs | 250 ------ .../Helpers/ThemeListener.cs | 144 --- .../InAppNotification.AttachedProperties.cs | 58 -- .../InAppNotification.Constants.cs | 33 - .../InAppNotification.Events.cs | 87 -- .../InAppNotification.Properties.cs | 102 --- .../InAppNotification/InAppNotification.cs | 274 ------ .../InAppNotification/InAppNotification.xaml | 35 - .../InAppNotificationClosedEventArgs.cs | 36 - .../InAppNotificationClosingEventArgs.cs | 41 - .../InAppNotificationDismissKind.cs | 28 - .../InAppNotificationOpeningEventArgs.cs | 34 - .../InAppNotification/NotificationOptions.cs | 26 - .../InAppNotification/StackMode.cs | 28 - .../Styles/MSEdgeNotificationStyle.xaml | 200 ----- .../CodeBlockResolvingEventArgs.cs | 47 - .../ImageResolvingEventArgs.cs | 73 -- .../MarkdownTextBlock/LinkClickedEventArgs.cs | 25 - .../Markdown/Blocks/CodeBlock.cs | 196 ---- .../Markdown/Blocks/HeaderBlock.cs | 166 ---- .../Markdown/Blocks/HorizontalRuleBlock.cs | 73 -- .../Markdown/Blocks/LinkReferenceBlock.cs | 170 ---- .../Markdown/Blocks/List/ListItemBlock.cs | 24 - .../Markdown/Blocks/List/ListItemBuilder.cs | 19 - .../Markdown/Blocks/List/ListItemPreamble.cs | 14 - .../Markdown/Blocks/List/NestedListInfo.cs | 15 - .../Markdown/Blocks/ListBlock.cs | 402 --------- .../Markdown/Blocks/ParagraphBlock.cs | 52 -- .../Markdown/Blocks/QuoteBlock.cs | 49 - .../Markdown/Blocks/TableBlock.cs | 329 ------- .../Markdown/Blocks/YamlHeaderBlock.cs | 164 ---- .../Markdown/Core/IParser.cs | 24 - .../Markdown/Core/ParseHelpers.cs | 39 - .../Markdown/Core/SchemaBase.cs | 18 - .../Markdown/Core/StringValueAttribute.cs | 31 - .../Markdown/Enums/ColumnAlignment.cs | 33 - .../Markdown/Enums/HyperlinkType.cs | 43 - .../Markdown/Enums/InlineParseMethod.cs | 95 -- .../Markdown/Enums/ListStyle.cs | 23 - .../Markdown/Enums/MarkdownBlockType.cs | 68 -- .../Markdown/Enums/MarkdownInlineType.cs | 83 -- .../Markdown/Helpers/Common.cs | 535 ----------- .../Markdown/Helpers/DebuggingReporter.cs | 27 - .../Markdown/Helpers/InlineParseResult.cs | 35 - .../Markdown/Helpers/InlineTripCharHelper.cs | 22 - .../Markdown/Helpers/LineInfo.cs | 20 - .../Markdown/Inlines/BoldItalicTextInline.cs | 118 --- .../Markdown/Inlines/BoldTextInline.cs | 107 --- .../Markdown/Inlines/CodeInline.cs | 112 --- .../Markdown/Inlines/CommentInline.cs | 85 -- .../Inlines/EmojiInline.EmojiCodes.cs | 846 ------------------ .../Markdown/Inlines/EmojiInline.cs | 85 -- .../Markdown/Inlines/HyperlinkInline.cs | 477 ---------- .../Markdown/Inlines/IInlineContainer.cs | 20 - .../Markdown/Inlines/IInlineLeaf.cs | 18 - .../Markdown/Inlines/ILinkElement.cs | 25 - .../Markdown/Inlines/ImageInline.cs | 258 ------ .../Markdown/Inlines/ItalicTextInline.cs | 102 --- .../Markdown/Inlines/LinkAnchorInline.cs | 124 --- .../Markdown/Inlines/MarkdownLinkInline.cs | 290 ------ .../Inlines/StrikethroughTextInline.cs | 99 -- .../Markdown/Inlines/SubscriptTextInline.cs | 94 -- .../Markdown/Inlines/SuperscriptTextInline.cs | 150 ---- .../Markdown/Inlines/TextRunInline.cs | 470 ---------- .../Markdown/MarkdownBlock.cs | 50 -- .../Markdown/MarkdownDocument.cs | 417 --------- .../Markdown/MarkdownElement.cs | 14 - .../Markdown/MarkdownInline.cs | 26 - .../Markdown/Render/ICodeBlockResolver.cs | 29 - .../Markdown/Render/IImageResolver.cs | 24 - .../Markdown/Render/ILinkRegister.cs | 31 - .../Markdown/Render/IRenderContext.cs | 29 - .../Markdown/Render/InlineRenderContext.cs | 55 -- .../Render/MarkdownRenderer.Blocks.cs | 475 ---------- .../Render/MarkdownRenderer.Dimensions.cs | 227 ----- .../Render/MarkdownRenderer.Inlines.cs | 595 ------------ .../Render/MarkdownRenderer.Properties.cs | 245 ----- .../Markdown/Render/MarkdownRenderer.cs | 221 ----- .../Render/MarkdownRendererBase.Blocks.cs | 53 -- .../Render/MarkdownRendererBase.Inlines.cs | 90 -- .../Markdown/Render/MarkdownRendererBase.cs | 250 ------ .../Markdown/Render/MarkdownTable.cs | 217 ----- .../Markdown/Render/RenderContext.cs | 37 - .../Render/RenderContextIncorrectException.cs | 27 - .../UIElementCollectionRenderContext.cs | 38 - .../MarkdownRenderedEventArgs.cs | 26 - .../MarkdownTextBlock.Dimensions.cs | 667 -------------- .../MarkdownTextBlock.Events.cs | 84 -- .../MarkdownTextBlock.Methods.cs | 376 -------- .../MarkdownTextBlock.Properties.cs | 692 -------------- .../MarkdownTextBlock/MarkdownTextBlock.cs | 130 --- .../MarkdownTextBlock/MarkdownTextBlock.xaml | 107 --- .../Notepads.Controls.csproj | 119 +-- src/Notepads.Controls/SetsView/SetsView.cs | 1 + src/Notepads.Controls/SetsView/SetsView.xaml | 121 +-- src/Notepads.Controls/Themes/Generic.xaml | 4 - .../Brushes/HostBackdropAcrylicBrush.cs | 6 +- .../FindAndReplacePlaceHolder.xaml | 48 +- .../Markdown/MarkdownExtensionView.xaml | 14 +- .../Markdown/MarkdownExtensionView.xaml.cs | 2 +- .../Controls/TextEditor/TextEditor.xaml | 38 +- .../Controls/TextEditor/TextEditor.xaml.cs | 1 + src/Notepads/Notepads.csproj | 4 +- .../InAppNotificationNoDismissButton.xaml | 83 +- src/Notepads/Services/ThemeSettingsService.cs | 2 +- .../Views/MainPage/NotepadsMainPage.xaml | 27 +- 116 files changed, 176 insertions(+), 15119 deletions(-) delete mode 100644 src/Notepads.Controls/DropShadowPanel/DropShadowPanel.Properties.cs delete mode 100644 src/Notepads.Controls/DropShadowPanel/DropShadowPanel.cs delete mode 100644 src/Notepads.Controls/DropShadowPanel/DropShadowPanel.xaml delete mode 100644 src/Notepads.Controls/GridSplitter/GridSplitter.Data.cs delete mode 100644 src/Notepads.Controls/GridSplitter/GridSplitter.Events.cs delete mode 100644 src/Notepads.Controls/GridSplitter/GridSplitter.Helper.cs delete mode 100644 src/Notepads.Controls/GridSplitter/GridSplitter.Options.cs delete mode 100644 src/Notepads.Controls/GridSplitter/GridSplitter.cs delete mode 100644 src/Notepads.Controls/GridSplitter/GridSplitter.xaml delete mode 100644 src/Notepads.Controls/GridSplitter/GripperHoverWrapper.cs delete mode 100644 src/Notepads.Controls/Helpers/DispatcherQueueHelper.cs delete mode 100644 src/Notepads.Controls/Helpers/ThemeListener.cs delete mode 100644 src/Notepads.Controls/InAppNotification/InAppNotification.AttachedProperties.cs delete mode 100644 src/Notepads.Controls/InAppNotification/InAppNotification.Constants.cs delete mode 100644 src/Notepads.Controls/InAppNotification/InAppNotification.Events.cs delete mode 100644 src/Notepads.Controls/InAppNotification/InAppNotification.Properties.cs delete mode 100644 src/Notepads.Controls/InAppNotification/InAppNotification.cs delete mode 100644 src/Notepads.Controls/InAppNotification/InAppNotification.xaml delete mode 100644 src/Notepads.Controls/InAppNotification/InAppNotificationClosedEventArgs.cs delete mode 100644 src/Notepads.Controls/InAppNotification/InAppNotificationClosingEventArgs.cs delete mode 100644 src/Notepads.Controls/InAppNotification/InAppNotificationDismissKind.cs delete mode 100644 src/Notepads.Controls/InAppNotification/InAppNotificationOpeningEventArgs.cs delete mode 100644 src/Notepads.Controls/InAppNotification/NotificationOptions.cs delete mode 100644 src/Notepads.Controls/InAppNotification/StackMode.cs delete mode 100644 src/Notepads.Controls/InAppNotification/Styles/MSEdgeNotificationStyle.xaml delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/CodeBlockResolvingEventArgs.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/ImageResolvingEventArgs.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/LinkClickedEventArgs.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/CodeBlock.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/HeaderBlock.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/HorizontalRuleBlock.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/LinkReferenceBlock.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/List/ListItemBlock.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/List/ListItemBuilder.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/List/ListItemPreamble.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/List/NestedListInfo.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/ListBlock.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/ParagraphBlock.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/QuoteBlock.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/TableBlock.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/YamlHeaderBlock.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Core/IParser.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Core/ParseHelpers.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Core/SchemaBase.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Core/StringValueAttribute.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/ColumnAlignment.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/HyperlinkType.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/InlineParseMethod.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/ListStyle.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/MarkdownBlockType.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/MarkdownInlineType.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/Common.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/DebuggingReporter.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/InlineParseResult.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/InlineTripCharHelper.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/LineInfo.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/BoldItalicTextInline.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/BoldTextInline.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/CodeInline.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/CommentInline.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/EmojiInline.EmojiCodes.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/EmojiInline.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/HyperlinkInline.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/IInlineContainer.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/IInlineLeaf.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/ILinkElement.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/ImageInline.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/ItalicTextInline.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/LinkAnchorInline.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/MarkdownLinkInline.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/StrikethroughTextInline.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/SubscriptTextInline.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/SuperscriptTextInline.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/TextRunInline.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/MarkdownBlock.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/MarkdownDocument.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/MarkdownElement.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/MarkdownInline.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/ICodeBlockResolver.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/IImageResolver.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/ILinkRegister.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/IRenderContext.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/InlineRenderContext.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.Blocks.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.Dimensions.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.Inlines.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.Properties.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRendererBase.Blocks.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRendererBase.Inlines.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRendererBase.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownTable.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/RenderContext.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/RenderContextIncorrectException.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/UIElementCollectionRenderContext.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/MarkdownRenderedEventArgs.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.Dimensions.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.Events.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.Methods.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.Properties.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.cs delete mode 100644 src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.xaml diff --git a/src/Notepads.Controls/DropShadowPanel/DropShadowPanel.Properties.cs b/src/Notepads.Controls/DropShadowPanel/DropShadowPanel.Properties.cs deleted file mode 100644 index e850f0775..000000000 --- a/src/Notepads.Controls/DropShadowPanel/DropShadowPanel.Properties.cs +++ /dev/null @@ -1,204 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/DropShadowPanel - -namespace Notepads.Controls -{ - using Windows.UI; - using Windows.UI.Composition; - using Windows.UI.Xaml; - - /// <summary> - /// The <see cref="DropShadowPanel"/> control allows the creation of a DropShadow for any Xaml FrameworkElement in markup - /// making it easier to add shadows to Xaml without having to directly drop down to Windows.UI.Composition APIs. - /// </summary> - public partial class DropShadowPanel - { - /// <summary> - /// Identifies the <see cref="BlurRadius"/> dependency property. - /// </summary> - public static readonly DependencyProperty BlurRadiusProperty = - DependencyProperty.Register(nameof(BlurRadius), typeof(double), typeof(DropShadowPanel), new PropertyMetadata(9.0, OnBlurRadiusChanged)); - - /// <summary> - /// Identifies the <see cref="Color"/> dependency property. - /// </summary> - public static readonly DependencyProperty ColorProperty = - DependencyProperty.Register(nameof(Color), typeof(Color), typeof(DropShadowPanel), new PropertyMetadata(Colors.Black, OnColorChanged)); - - /// <summary> - /// Identifies the <see cref="OffsetX"/> dependency property. - /// </summary> - public static readonly DependencyProperty OffsetXProperty = - DependencyProperty.Register(nameof(OffsetX), typeof(double), typeof(DropShadowPanel), new PropertyMetadata(0.0, OnOffsetXChanged)); - - /// <summary> - /// Identifies the <see cref="OffsetY"/> dependency property. - /// </summary> - public static readonly DependencyProperty OffsetYProperty = - DependencyProperty.Register(nameof(OffsetY), typeof(double), typeof(DropShadowPanel), new PropertyMetadata(0.0, OnOffsetYChanged)); - - /// <summary> - /// Identifies the <see cref="OffsetZ"/> dependency property. - /// </summary> - public static readonly DependencyProperty OffsetZProperty = - DependencyProperty.Register(nameof(OffsetZ), typeof(double), typeof(DropShadowPanel), new PropertyMetadata(0.0, OnOffsetZChanged)); - - /// <summary> - /// Identifies the <see cref="ShadowOpacity"/> dependency property. - /// </summary> - public static readonly DependencyProperty ShadowOpacityProperty = - DependencyProperty.Register(nameof(ShadowOpacity), typeof(double), typeof(DropShadowPanel), new PropertyMetadata(1.0, OnShadowOpacityChanged)); - - /// <summary> - /// Identifies the <see cref="IsMasked"/> dependency property. - /// </summary> - public static readonly DependencyProperty IsMaskedProperty = - DependencyProperty.Register(nameof(IsMasked), typeof(bool), typeof(DropShadowPanel), new PropertyMetadata(true, OnIsMaskedChanged)); - - /// <summary> - /// Gets DropShadow. Exposes the underlying composition object to allow custom Windows.UI.Composition animations. - /// </summary> - public DropShadow DropShadow => _dropShadow; - - /// <summary> - /// Gets or sets the mask of the underlying <see cref="Windows.UI.Composition.DropShadow"/>. - /// Allows for a custom <see cref="Windows.UI.Composition.CompositionBrush"/> to be set. - /// </summary> - public CompositionBrush Mask - { - get => _dropShadow?.Mask; - - set - { - if (_dropShadow != null) - { - _dropShadow.Mask = value; - } - } - } - - /// <summary> - /// Gets or sets the blur radius of the drop shadow. - /// </summary> - public double BlurRadius - { - get => (double)GetValue(BlurRadiusProperty); - set => SetValue(BlurRadiusProperty, value); - } - - /// <summary> - /// Gets or sets the color of the drop shadow. - /// </summary> - public Color Color - { - get => (Color)GetValue(ColorProperty); - set => SetValue(ColorProperty, value); - } - - /// <summary> - /// Gets or sets the x offset of the drop shadow. - /// </summary> - public double OffsetX - { - get => (double)GetValue(OffsetXProperty); - set => SetValue(OffsetXProperty, value); - } - - /// <summary> - /// Gets or sets the y offset of the drop shadow. - /// </summary> - public double OffsetY - { - get => (double)GetValue(OffsetYProperty); - set => SetValue(OffsetYProperty, value); - } - - /// <summary> - /// Gets or sets the z offset of the drop shadow. - /// </summary> - public double OffsetZ - { - get => (double)GetValue(OffsetZProperty); - set => SetValue(OffsetZProperty, value); - } - - /// <summary> - /// Gets or sets the opacity of the drop shadow. - /// </summary> - public double ShadowOpacity - { - get => (double)GetValue(ShadowOpacityProperty); - set => SetValue(ShadowOpacityProperty, value); - } - - /// <summary> - /// Gets or sets a value indicating whether the panel uses an alpha mask to create a more precise shadow vs. a quicker rectangle shape. - /// </summary> - /// <remarks> - /// Turn this off to lose fidelity and gain performance of the panel. - /// </remarks> - public bool IsMasked - { - get => (bool)GetValue(IsMaskedProperty); - set => SetValue(IsMaskedProperty, value); - } - - private static void OnBlurRadiusChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (d is DropShadowPanel panel) - { - panel.OnBlurRadiusChanged((double)e.NewValue); - } - } - - private static void OnColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (d is DropShadowPanel panel) - { - panel.OnColorChanged((Color)e.NewValue); - } - } - - private static void OnOffsetXChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (d is DropShadowPanel panel) - { - panel.OnOffsetXChanged((double)e.NewValue); - } - } - - private static void OnOffsetYChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (d is DropShadowPanel panel) - { - panel.OnOffsetYChanged((double)e.NewValue); - } - } - - private static void OnOffsetZChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (d is DropShadowPanel panel) - { - panel.OnOffsetZChanged((double)e.NewValue); - } - } - - private static void OnShadowOpacityChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (d is DropShadowPanel panel) - { - panel.OnShadowOpacityChanged((double)e.NewValue); - } - } - - private static void OnIsMaskedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (d is DropShadowPanel panel) - { - panel.UpdateShadowMask(); - } - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/DropShadowPanel/DropShadowPanel.cs b/src/Notepads.Controls/DropShadowPanel/DropShadowPanel.cs deleted file mode 100644 index 81a4ca10f..000000000 --- a/src/Notepads.Controls/DropShadowPanel/DropShadowPanel.cs +++ /dev/null @@ -1,191 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/DropShadowPanel - -namespace Notepads.Controls -{ - using System.Numerics; - using Windows.UI; - using Windows.UI.Composition; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Hosting; - using Windows.UI.Xaml.Shapes; - - /// <summary> - /// The <see cref="DropShadowPanel"/> control allows the creation of a DropShadow for any Xaml FrameworkElement in markup - /// making it easier to add shadows to Xaml without having to directly drop down to Windows.UI.Composition APIs. - /// </summary> - [TemplatePart(Name = PartShadow, Type = typeof(Border))] - public partial class DropShadowPanel : ContentControl - { - private const string PartShadow = "ShadowElement"; - - private readonly DropShadow _dropShadow; - private readonly SpriteVisual _shadowVisual; - private Border _border; - - /// <summary> - /// Initializes a new instance of the <see cref="DropShadowPanel"/> class. - /// </summary> - public DropShadowPanel() - { - DefaultStyleKey = typeof(DropShadowPanel); - - Compositor compositor = ElementCompositionPreview.GetElementVisual(this).Compositor; - - _shadowVisual = compositor.CreateSpriteVisual(); - - _dropShadow = compositor.CreateDropShadow(); - _shadowVisual.Shadow = _dropShadow; - } - - /// <summary> - /// Update the visual state of the control when its template is changed. - /// </summary> - protected override void OnApplyTemplate() - { - _border = GetTemplateChild(PartShadow) as Border; - - if (_border != null) - { - ElementCompositionPreview.SetElementChildVisual(_border, _shadowVisual); - } - - ConfigureShadowVisualForCastingElement(); - - base.OnApplyTemplate(); - } - - /// <inheritdoc/> - protected override void OnContentChanged(object oldContent, object newContent) - { - if (oldContent != null) - { - if (oldContent is FrameworkElement oldElement) - { - oldElement.SizeChanged -= OnSizeChanged; - } - } - - if (newContent != null) - { - if (newContent is FrameworkElement newElement) - { - newElement.SizeChanged += OnSizeChanged; - } - } - - base.OnContentChanged(oldContent, newContent); - } - - private void OnSizeChanged(object sender, SizeChangedEventArgs e) - { - UpdateShadowSize(); - } - - private void ConfigureShadowVisualForCastingElement() - { - UpdateShadowMask(); - UpdateShadowSize(); - } - - private void OnBlurRadiusChanged(double newValue) - { - if (_dropShadow != null) - { - _dropShadow.BlurRadius = (float)newValue; - } - } - - private void OnColorChanged(Color newValue) - { - if (_dropShadow != null) - { - _dropShadow.Color = newValue; - } - } - - private void OnOffsetXChanged(double newValue) - { - if (_dropShadow != null) - { - UpdateShadowOffset((float)newValue, _dropShadow.Offset.Y, _dropShadow.Offset.Z); - } - } - - private void OnOffsetYChanged(double newValue) - { - if (_dropShadow != null) - { - UpdateShadowOffset(_dropShadow.Offset.X, (float)newValue, _dropShadow.Offset.Z); - } - } - - private void OnOffsetZChanged(double newValue) - { - if (_dropShadow != null) - { - UpdateShadowOffset(_dropShadow.Offset.X, _dropShadow.Offset.Y, (float)newValue); - } - } - - private void OnShadowOpacityChanged(double newValue) - { - if (_dropShadow != null) - { - _dropShadow.Opacity = (float)newValue; - } - } - - private void UpdateShadowMask() - { - if (Content != null && IsMasked) - { - CompositionBrush mask = null; - - if (Content is Image image) - { - mask = image.GetAlphaMask(); - } - else if (Content is Shape shape) - { - mask = shape.GetAlphaMask(); - } - else if (Content is TextBlock textBlock) - { - mask = textBlock.GetAlphaMask(); - } - - _dropShadow.Mask = mask; - } - else - { - _dropShadow.Mask = null; - } - } - - private void UpdateShadowOffset(float x, float y, float z) - { - if (_dropShadow != null) - { - _dropShadow.Offset = new Vector3(x, y, z); - } - } - - private void UpdateShadowSize() - { - if (_shadowVisual != null) - { - Vector2 newSize = new Vector2(0, 0); - if (Content is FrameworkElement content) - { - newSize = new Vector2((float)content.ActualWidth, (float)content.ActualHeight); - } - - _shadowVisual.Size = newSize; - } - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/DropShadowPanel/DropShadowPanel.xaml b/src/Notepads.Controls/DropShadowPanel/DropShadowPanel.xaml deleted file mode 100644 index d56d2d6fd..000000000 --- a/src/Notepads.Controls/DropShadowPanel/DropShadowPanel.xaml +++ /dev/null @@ -1,30 +0,0 @@ -<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:controls="using:Notepads.Controls"> - - <Style TargetType="controls:DropShadowPanel"> - <Setter Property="IsTabStop" - Value="False" /> - <Setter Property="HorizontalAlignment" Value="Stretch"/> - <Setter Property="HorizontalContentAlignment" Value="Left"/> - <Setter Property="VerticalAlignment" Value="Stretch"/> - <Setter Property="VerticalContentAlignment" Value="Stretch"/> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="controls:DropShadowPanel"> - <Grid Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - HorizontalAlignment="{TemplateBinding HorizontalAlignment}" - VerticalAlignment="{TemplateBinding VerticalAlignment}"> - <Border x:Name="ShadowElement" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> - <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> -</ResourceDictionary> diff --git a/src/Notepads.Controls/GridSplitter/GridSplitter.Data.cs b/src/Notepads.Controls/GridSplitter/GridSplitter.Data.cs deleted file mode 100644 index 2a2f72695..000000000 --- a/src/Notepads.Controls/GridSplitter/GridSplitter.Data.cs +++ /dev/null @@ -1,158 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/GridSplitter - -namespace Notepads.Controls -{ - /// <summary> - /// Represents the control that redistributes space between columns or rows of a Grid control. - /// </summary> - public partial class GridSplitter - { - /// <summary> - /// Enum to indicate whether GridSplitter resizes Columns or Rows - /// </summary> - public enum GridResizeDirection - { - /// <summary> - /// Determines whether to resize rows or columns based on its Alignment and - /// width compared to height - /// </summary> - Auto, - - /// <summary> - /// Resize columns when dragging Splitter. - /// </summary> - Columns, - - /// <summary> - /// Resize rows when dragging Splitter. - /// </summary> - Rows - } - - /// <summary> - /// Enum to indicate what Columns or Rows the GridSplitter resizes - /// </summary> - public enum GridResizeBehavior - { - /// <summary> - /// Determine which columns or rows to resize based on its Alignment. - /// </summary> - BasedOnAlignment, - - /// <summary> - /// Resize the current and next Columns or Rows. - /// </summary> - CurrentAndNext, - - /// <summary> - /// Resize the previous and current Columns or Rows. - /// </summary> - PreviousAndCurrent, - - /// <summary> - /// Resize the previous and next Columns or Rows. - /// </summary> - PreviousAndNext - } - - /// <summary> - /// Enum to indicate the supported gripper cursor types. - /// </summary> - public enum GripperCursorType - { - /// <summary> - /// Change the cursor based on the splitter direction - /// </summary> - Default = -1, - - /// <summary> - /// Standard Arrow cursor - /// </summary> - Arrow, - - /// <summary> - /// Standard Cross cursor - /// </summary> - Cross, - - /// <summary> - /// Standard Custom cursor - /// </summary> - Custom, - - /// <summary> - /// Standard Hand cursor - /// </summary> - Hand, - - /// <summary> - /// Standard Help cursor - /// </summary> - Help, - - /// <summary> - /// Standard IBeam cursor - /// </summary> - IBeam, - - /// <summary> - /// Standard SizeAll cursor - /// </summary> - SizeAll, - - /// <summary> - /// Standard SizeNortheastSouthwest cursor - /// </summary> - SizeNortheastSouthwest, - - /// <summary> - /// Standard SizeNorthSouth cursor - /// </summary> - SizeNorthSouth, - - /// <summary> - /// Standard SizeNorthwestSoutheast cursor - /// </summary> - SizeNorthwestSoutheast, - - /// <summary> - /// Standard SizeWestEast cursor - /// </summary> - SizeWestEast, - - /// <summary> - /// Standard UniversalNo cursor - /// </summary> - UniversalNo, - - /// <summary> - /// Standard UpArrow cursor - /// </summary> - UpArrow, - - /// <summary> - /// Standard Wait cursor - /// </summary> - Wait - } - - /// <summary> - /// Enum to indicate the behavior of window cursor on grid splitter hover - /// </summary> - public enum SplitterCursorBehavior - { - /// <summary> - /// Update window cursor on Grid Splitter hover - /// </summary> - ChangeOnSplitterHover, - - /// <summary> - /// Update window cursor on Grid Splitter Gripper hover - /// </summary> - ChangeOnGripperHover - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/GridSplitter/GridSplitter.Events.cs b/src/Notepads.Controls/GridSplitter/GridSplitter.Events.cs deleted file mode 100644 index b57cee22c..000000000 --- a/src/Notepads.Controls/GridSplitter/GridSplitter.Events.cs +++ /dev/null @@ -1,302 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/GridSplitter - -namespace Notepads.Controls -{ - using Windows.System; - using Windows.UI.Core; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Input; - using Windows.UI.Xaml.Media; - - /// <summary> - /// Represents the control that redistributes space between columns or rows of a Grid control. - /// </summary> - public partial class GridSplitter - { - // Symbols for GripperBar in Segoe MDL2 Assets - private const string GripperBarVertical = "\xE784"; - private const string GripperBarHorizontal = "\xE76F"; - private const string GripperDisplayFont = "Segoe MDL2 Assets"; - - private void GridSplitter_Loaded(object sender, RoutedEventArgs e) - { - _resizeDirection = GetResizeDirection(); - _resizeBehavior = GetResizeBehavior(); - - // Adding Grip to Grid Splitter - if (Element == default(UIElement)) - { - CreateGripperDisplay(); - Element = _gripperDisplay; - } - - if (_hoverWrapper == null) - { - var hoverWrapper = new GripperHoverWrapper( - CursorBehavior == SplitterCursorBehavior.ChangeOnSplitterHover - ? this - : Element, - _resizeDirection, - GripperCursor, - GripperCustomCursorResource); - ManipulationStarted += hoverWrapper.SplitterManipulationStarted; - ManipulationCompleted += hoverWrapper.SplitterManipulationCompleted; - - _hoverWrapper = hoverWrapper; - } - } - - private void CreateGripperDisplay() - { - if (_gripperDisplay == null) - { - _gripperDisplay = new TextBlock - { - FontFamily = new FontFamily(GripperDisplayFont), - HorizontalAlignment = HorizontalAlignment.Center, - VerticalAlignment = VerticalAlignment.Center, - Foreground = GripperForeground, - Text = _resizeDirection == GridResizeDirection.Columns ? GripperBarVertical : GripperBarHorizontal - }; - } - } - - /// <inheritdoc /> - protected override void OnKeyDown(KeyRoutedEventArgs e) - { - var step = 1; - var ctrl = Window.Current.CoreWindow.GetKeyState(VirtualKey.Control); - if (ctrl.HasFlag(CoreVirtualKeyStates.Down)) - { - step = 5; - } - - if (_resizeDirection == GridResizeDirection.Columns) - { - if (e.Key == VirtualKey.Left) - { - HorizontalMove(-step); - } - else if (e.Key == VirtualKey.Right) - { - HorizontalMove(step); - } - else - { - return; - } - - e.Handled = true; - return; - } - - if (_resizeDirection == GridResizeDirection.Rows) - { - if (e.Key == VirtualKey.Up) - { - VerticalMove(-step); - } - else if (e.Key == VirtualKey.Down) - { - VerticalMove(step); - } - else - { - return; - } - - e.Handled = true; - } - - base.OnKeyDown(e); - } - - /// <inheritdoc /> - protected override void OnManipulationStarted(ManipulationStartedRoutedEventArgs e) - { - // saving the previous state - PreviousCursor = Window.Current.CoreWindow.PointerCursor; - _resizeDirection = GetResizeDirection(); - _resizeBehavior = GetResizeBehavior(); - - if (_resizeDirection == GridResizeDirection.Columns) - { - Window.Current.CoreWindow.PointerCursor = ColumnsSplitterCursor; - } - else if (_resizeDirection == GridResizeDirection.Rows) - { - Window.Current.CoreWindow.PointerCursor = RowSplitterCursor; - } - - base.OnManipulationStarted(e); - } - - /// <inheritdoc /> - protected override void OnManipulationCompleted(ManipulationCompletedRoutedEventArgs e) - { - Window.Current.CoreWindow.PointerCursor = PreviousCursor; - - base.OnManipulationCompleted(e); - } - - /// <inheritdoc /> - protected override void OnManipulationDelta(ManipulationDeltaRoutedEventArgs e) - { - var horizontalChange = e.Delta.Translation.X; - var verticalChange = e.Delta.Translation.Y; - - if (_resizeDirection == GridResizeDirection.Columns) - { - if (HorizontalMove(horizontalChange)) - { - return; - } - } - else if (_resizeDirection == GridResizeDirection.Rows) - { - if (VerticalMove(verticalChange)) - { - return; - } - } - - base.OnManipulationDelta(e); - } - - private bool VerticalMove(double verticalChange) - { - if (CurrentRow == null || SiblingRow == null) - { - return true; - } - - // if current row has fixed height then resize it - if (!IsStarRow(CurrentRow)) - { - // No need to check for the row Min height because it is automatically respected - if (!SetRowHeight(CurrentRow, verticalChange, GridUnitType.Pixel)) - { - return true; - } - } - - // if sibling row has fixed width then resize it - else if (!IsStarRow(SiblingRow)) - { - // Would adding to this column make the current column violate the MinWidth? - if (IsValidRowHeight(CurrentRow, verticalChange) == false) - { - return false; - } - - if (!SetRowHeight(SiblingRow, verticalChange * -1, GridUnitType.Pixel)) - { - return true; - } - } - - // if both row haven't fixed height (auto *) - else - { - // change current row height to the new height with respecting the auto - // change sibling row height to the new height relative to current row - // respect the other star row height by setting it's height to it's actual height with stars - - // We need to validate current and sibling height to not cause any un expected behavior - if (!IsValidRowHeight(CurrentRow, verticalChange) || - !IsValidRowHeight(SiblingRow, verticalChange * -1)) - { - return true; - } - - foreach (var rowDefinition in Resizable.RowDefinitions) - { - if (rowDefinition == CurrentRow) - { - SetRowHeight(CurrentRow, verticalChange, GridUnitType.Star); - } - else if (rowDefinition == SiblingRow) - { - SetRowHeight(SiblingRow, verticalChange * -1, GridUnitType.Star); - } - else if (IsStarRow(rowDefinition)) - { - rowDefinition.Height = new GridLength(rowDefinition.ActualHeight, GridUnitType.Star); - } - } - } - - return false; - } - - private bool HorizontalMove(double horizontalChange) - { - if (CurrentColumn == null || SiblingColumn == null) - { - return true; - } - - // if current column has fixed width then resize it - if (!IsStarColumn(CurrentColumn)) - { - // No need to check for the Column Min width because it is automatically respected - if (!SetColumnWidth(CurrentColumn, horizontalChange, GridUnitType.Pixel)) - { - return true; - } - } - - // if sibling column has fixed width then resize it - else if (!IsStarColumn(SiblingColumn)) - { - // Would adding to this column make the current column violate the MinWidth? - if (IsValidColumnWidth(CurrentColumn, horizontalChange) == false) - { - return false; - } - - if (!SetColumnWidth(SiblingColumn, horizontalChange * -1, GridUnitType.Pixel)) - { - return true; - } - } - - // if both column haven't fixed width (auto *) - else - { - // change current column width to the new width with respecting the auto - // change sibling column width to the new width relative to current column - // respect the other star column width by setting it's width to it's actual width with stars - - // We need to validate current and sibling width to not cause any un expected behavior - if (!IsValidColumnWidth(CurrentColumn, horizontalChange) || - !IsValidColumnWidth(SiblingColumn, horizontalChange * -1)) - { - return true; - } - - foreach (var columnDefinition in Resizable.ColumnDefinitions) - { - if (columnDefinition == CurrentColumn) - { - SetColumnWidth(CurrentColumn, horizontalChange, GridUnitType.Star); - } - else if (columnDefinition == SiblingColumn) - { - SetColumnWidth(SiblingColumn, horizontalChange * -1, GridUnitType.Star); - } - else if (IsStarColumn(columnDefinition)) - { - columnDefinition.Width = new GridLength(columnDefinition.ActualWidth, GridUnitType.Star); - } - } - } - - return false; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/GridSplitter/GridSplitter.Helper.cs b/src/Notepads.Controls/GridSplitter/GridSplitter.Helper.cs deleted file mode 100644 index 1c53cf135..000000000 --- a/src/Notepads.Controls/GridSplitter/GridSplitter.Helper.cs +++ /dev/null @@ -1,261 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/GridSplitter - -namespace Notepads.Controls -{ - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - - /// <summary> - /// Represents the control that redistributes space between columns or rows of a Grid control. - /// </summary> - public partial class GridSplitter - { - private static bool IsStarColumn(ColumnDefinition definition) - { - return ((GridLength)definition.GetValue(ColumnDefinition.WidthProperty)).IsStar; - } - - private static bool IsStarRow(RowDefinition definition) - { - return ((GridLength)definition.GetValue(RowDefinition.HeightProperty)).IsStar; - } - - private bool SetColumnWidth(ColumnDefinition columnDefinition, double horizontalChange, GridUnitType unitType) - { - var newWidth = columnDefinition.ActualWidth + horizontalChange; - - var minWidth = columnDefinition.MinWidth; - if (!double.IsNaN(minWidth) && newWidth < minWidth) - { - newWidth = minWidth; - } - - var maxWidth = columnDefinition.MaxWidth; - if (!double.IsNaN(maxWidth) && newWidth > maxWidth) - { - newWidth = maxWidth; - } - - if (newWidth > ActualWidth) - { - columnDefinition.Width = new GridLength(newWidth, unitType); - return true; - } - - return false; - } - - private bool IsValidColumnWidth(ColumnDefinition columnDefinition, double horizontalChange) - { - var newWidth = columnDefinition.ActualWidth + horizontalChange; - - var minWidth = columnDefinition.MinWidth; - if (!double.IsNaN(minWidth) && newWidth < minWidth) - { - return false; - } - - var maxWidth = columnDefinition.MaxWidth; - if (!double.IsNaN(maxWidth) && newWidth > maxWidth) - { - return false; - } - - if (newWidth <= ActualWidth) - { - return false; - } - - return true; - } - - private bool SetRowHeight(RowDefinition rowDefinition, double verticalChange, GridUnitType unitType) - { - var newHeight = rowDefinition.ActualHeight + verticalChange; - - var minHeight = rowDefinition.MinHeight; - if (!double.IsNaN(minHeight) && newHeight < minHeight) - { - newHeight = minHeight; - } - - var maxWidth = rowDefinition.MaxHeight; - if (!double.IsNaN(maxWidth) && newHeight > maxWidth) - { - newHeight = maxWidth; - } - - if (newHeight > ActualHeight) - { - rowDefinition.Height = new GridLength(newHeight, unitType); - return true; - } - - return false; - } - - private bool IsValidRowHeight(RowDefinition rowDefinition, double verticalChange) - { - var newHeight = rowDefinition.ActualHeight + verticalChange; - - var minHeight = rowDefinition.MinHeight; - if (!double.IsNaN(minHeight) && newHeight < minHeight) - { - return false; - } - - var maxHeight = rowDefinition.MaxHeight; - if (!double.IsNaN(maxHeight) && newHeight > maxHeight) - { - return false; - } - - if (newHeight <= ActualHeight) - { - return false; - } - - return true; - } - - // Return the targeted Column based on the resize behavior - private int GetTargetedColumn() - { - var currentIndex = Grid.GetColumn(TargetControl); - return GetTargetIndex(currentIndex); - } - - // Return the sibling Row based on the resize behavior - private int GetTargetedRow() - { - var currentIndex = Grid.GetRow(TargetControl); - return GetTargetIndex(currentIndex); - } - - // Return the sibling Column based on the resize behavior - private int GetSiblingColumn() - { - var currentIndex = Grid.GetColumn(TargetControl); - return GetSiblingIndex(currentIndex); - } - - // Return the sibling Row based on the resize behavior - private int GetSiblingRow() - { - var currentIndex = Grid.GetRow(TargetControl); - return GetSiblingIndex(currentIndex); - } - - // Gets index based on resize behavior for first targeted row/column - private int GetTargetIndex(int currentIndex) - { - switch (_resizeBehavior) - { - case GridResizeBehavior.CurrentAndNext: - return currentIndex; - case GridResizeBehavior.PreviousAndNext: - return currentIndex - 1; - case GridResizeBehavior.PreviousAndCurrent: - return currentIndex - 1; - default: - return -1; - } - } - - // Gets index based on resize behavior for second targeted row/column - private int GetSiblingIndex(int currentIndex) - { - switch (_resizeBehavior) - { - case GridResizeBehavior.CurrentAndNext: - return currentIndex + 1; - case GridResizeBehavior.PreviousAndNext: - return currentIndex + 1; - case GridResizeBehavior.PreviousAndCurrent: - return currentIndex; - default: - return -1; - } - } - - // Checks the control alignment and Width/Height to detect the control resize direction columns/rows - private GridResizeDirection GetResizeDirection() - { - GridResizeDirection direction = ResizeDirection; - - if (direction == GridResizeDirection.Auto) - { - // When HorizontalAlignment is Left, Right or Center, resize Columns - if (HorizontalAlignment != HorizontalAlignment.Stretch) - { - direction = GridResizeDirection.Columns; - } - - // When VerticalAlignment is Top, Bottom or Center, resize Rows - else if (VerticalAlignment != VerticalAlignment.Stretch) - { - direction = GridResizeDirection.Rows; - } - - // Check Width vs Height - else if (ActualWidth <= ActualHeight) - { - direction = GridResizeDirection.Columns; - } - else - { - direction = GridResizeDirection.Rows; - } - } - - return direction; - } - - // Get the resize behavior (Which columns/rows should be resized) based on alignment and Direction - private GridResizeBehavior GetResizeBehavior() - { - GridResizeBehavior resizeBehavior = ResizeBehavior; - - if (resizeBehavior == GridResizeBehavior.BasedOnAlignment) - { - if (_resizeDirection == GridResizeDirection.Columns) - { - switch (HorizontalAlignment) - { - case HorizontalAlignment.Left: - resizeBehavior = GridResizeBehavior.PreviousAndCurrent; - break; - case HorizontalAlignment.Right: - resizeBehavior = GridResizeBehavior.CurrentAndNext; - break; - default: - resizeBehavior = GridResizeBehavior.PreviousAndNext; - break; - } - } - - // resize direction is vertical - else - { - switch (VerticalAlignment) - { - case VerticalAlignment.Top: - resizeBehavior = GridResizeBehavior.PreviousAndCurrent; - break; - case VerticalAlignment.Bottom: - resizeBehavior = GridResizeBehavior.CurrentAndNext; - break; - default: - resizeBehavior = GridResizeBehavior.PreviousAndNext; - break; - } - } - } - - return resizeBehavior; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/GridSplitter/GridSplitter.Options.cs b/src/Notepads.Controls/GridSplitter/GridSplitter.Options.cs deleted file mode 100644 index aab678ba4..000000000 --- a/src/Notepads.Controls/GridSplitter/GridSplitter.Options.cs +++ /dev/null @@ -1,225 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/GridSplitter - -namespace Notepads.Controls -{ - using Windows.UI.Core; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Media; - - /// <summary> - /// Represents the control that redistributes space between columns or rows of a Grid control. - /// </summary> - public partial class GridSplitter - { - /// <summary> - /// Identifies the <see cref="Element"/> dependency property. - /// </summary> - public static readonly DependencyProperty ElementProperty - = DependencyProperty.Register( - nameof(Element), - typeof(UIElement), - typeof(GridSplitter), - new PropertyMetadata(default(UIElement), OnElementPropertyChanged)); - - /// <summary> - /// Identifies the <see cref="ResizeDirection"/> dependency property. - /// </summary> - public static readonly DependencyProperty ResizeDirectionProperty - = DependencyProperty.Register( - nameof(ResizeDirection), - typeof(GridResizeDirection), - typeof(GridSplitter), - new PropertyMetadata(GridResizeDirection.Auto)); - - /// <summary> - /// Identifies the <see cref="ResizeBehavior"/> dependency property. - /// </summary> - public static readonly DependencyProperty ResizeBehaviorProperty - = DependencyProperty.Register( - nameof(ResizeBehavior), - typeof(GridResizeBehavior), - typeof(GridSplitter), - new PropertyMetadata(GridResizeBehavior.BasedOnAlignment)); - - /// <summary> - /// Identifies the <see cref="GripperForeground"/> dependency property. - /// </summary> - public static readonly DependencyProperty GripperForegroundProperty - = DependencyProperty.Register( - nameof(GripperForeground), - typeof(Brush), - typeof(GridSplitter), - new PropertyMetadata(default(Brush), OnGripperForegroundPropertyChanged)); - - /// <summary> - /// Identifies the <see cref="ParentLevel"/> dependency property. - /// </summary> - public static readonly DependencyProperty ParentLevelProperty - = DependencyProperty.Register( - nameof(ParentLevel), - typeof(int), - typeof(GridSplitter), - new PropertyMetadata(default(int))); - - /// <summary> - /// Identifies the <see cref="GripperCursor"/> dependency property. - /// </summary> - public static readonly DependencyProperty GripperCursorProperty = - DependencyProperty.RegisterAttached( - nameof(GripperCursor), - typeof(CoreCursorType?), - typeof(GridSplitter), - new PropertyMetadata(GripperCursorType.Default, OnGripperCursorPropertyChanged)); - - /// <summary> - /// Identifies the <see cref="GripperCustomCursorResource"/> dependency property. - /// </summary> - public static readonly DependencyProperty GripperCustomCursorResourceProperty = - DependencyProperty.RegisterAttached( - nameof(GripperCustomCursorResource), - typeof(uint), - typeof(GridSplitter), - new PropertyMetadata(GripperCustomCursorDefaultResource, GripperCustomCursorResourcePropertyChanged)); - - /// <summary> - /// Identifies the <see cref="CursorBehavior"/> dependency property. - /// </summary> - public static readonly DependencyProperty CursorBehaviorProperty = - DependencyProperty.RegisterAttached( - nameof(CursorBehavior), - typeof(SplitterCursorBehavior), - typeof(GridSplitter), - new PropertyMetadata(SplitterCursorBehavior.ChangeOnSplitterHover, CursorBehaviorPropertyChanged)); - - /// <summary> - /// Gets or sets the visual content of this Grid Splitter - /// </summary> - public UIElement Element - { - get => (UIElement)GetValue(ElementProperty); - set => SetValue(ElementProperty, value); - } - - /// <summary> - /// Gets or sets whether the Splitter resizes the Columns, Rows, or Both. - /// </summary> - public GridResizeDirection ResizeDirection - { - get => (GridResizeDirection)GetValue(ResizeDirectionProperty); - set => SetValue(ResizeDirectionProperty, value); - } - - /// <summary> - /// Gets or sets which Columns or Rows the Splitter resizes. - /// </summary> - public GridResizeBehavior ResizeBehavior - { - get => (GridResizeBehavior)GetValue(ResizeBehaviorProperty); - set => SetValue(ResizeBehaviorProperty, value); - } - - /// <summary> - /// Gets or sets the foreground color of grid splitter grip - /// </summary> - public Brush GripperForeground - { - get => (Brush)GetValue(GripperForegroundProperty); - set => SetValue(GripperForegroundProperty, value); - } - - /// <summary> - /// Gets or sets the level of the parent grid to resize - /// </summary> - public int ParentLevel - { - get => (int)GetValue(ParentLevelProperty); - set => SetValue(ParentLevelProperty, value); - } - - /// <summary> - /// Gets or sets the gripper Cursor type - /// </summary> - public GripperCursorType GripperCursor - { - get => (GripperCursorType)GetValue(GripperCursorProperty); - set => SetValue(GripperCursorProperty, value); - } - - /// <summary> - /// Gets or sets the gripper Custom Cursor resource number - /// </summary> - public int GripperCustomCursorResource - { - get => (int)GetValue(GripperCustomCursorResourceProperty); - set => SetValue(GripperCustomCursorResourceProperty, value); - } - - /// <summary> - /// Gets or sets splitter cursor on hover behavior - /// </summary> - public SplitterCursorBehavior CursorBehavior - { - get => (SplitterCursorBehavior)GetValue(CursorBehaviorProperty); - set => SetValue(CursorBehaviorProperty, value); - } - - private static void OnGripperForegroundPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var gridSplitter = (GridSplitter)d; - - if (gridSplitter._gripperDisplay == null) - { - return; - } - - gridSplitter._gripperDisplay.Foreground = gridSplitter.GripperForeground; - } - - private static void OnGripperCursorPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var gridSplitter = (GridSplitter)d; - - if (gridSplitter._hoverWrapper == null) - { - return; - } - - gridSplitter._hoverWrapper.GripperCursor = gridSplitter.GripperCursor; - } - - private static void GripperCustomCursorResourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var gridSplitter = (GridSplitter)d; - - if (gridSplitter._hoverWrapper == null) - { - return; - } - - gridSplitter._hoverWrapper.GripperCustomCursorResource = gridSplitter.GripperCustomCursorResource; - } - - private static void CursorBehaviorPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var gridSplitter = (GridSplitter)d; - - gridSplitter._hoverWrapper?.UpdateHoverElement(gridSplitter.CursorBehavior == - SplitterCursorBehavior.ChangeOnSplitterHover - ? gridSplitter - : gridSplitter.Element); - } - - private static void OnElementPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var gridSplitter = (GridSplitter)d; - - gridSplitter._hoverWrapper?.UpdateHoverElement(gridSplitter.CursorBehavior == - SplitterCursorBehavior.ChangeOnSplitterHover - ? gridSplitter - : gridSplitter.Element); - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/GridSplitter/GridSplitter.cs b/src/Notepads.Controls/GridSplitter/GridSplitter.cs deleted file mode 100644 index e65946dc2..000000000 --- a/src/Notepads.Controls/GridSplitter/GridSplitter.cs +++ /dev/null @@ -1,246 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/GridSplitter - -namespace Notepads.Controls -{ - using Windows.UI.Core; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Automation; - using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Input; - - /// <summary> - /// Represents the control that redistributes space between columns or rows of a Grid control. - /// </summary> - public partial class GridSplitter : Control - { - internal const int GripperCustomCursorDefaultResource = -1; - internal static readonly CoreCursor ColumnsSplitterCursor = new CoreCursor(CoreCursorType.SizeWestEast, 1); - internal static readonly CoreCursor RowSplitterCursor = new CoreCursor(CoreCursorType.SizeNorthSouth, 1); - - internal CoreCursor PreviousCursor { get; set; } - - private GridResizeDirection _resizeDirection; - private GridResizeBehavior _resizeBehavior; - private GripperHoverWrapper _hoverWrapper; - private TextBlock _gripperDisplay; - - private bool _pressed = false; - private bool _dragging = false; - private bool _pointerEntered = false; - - /// <summary> - /// Gets the target parent grid from level - /// </summary> - private FrameworkElement TargetControl - { - get - { - if (ParentLevel == 0) - { - return this; - } - - var parent = Parent; - for (int i = 2; i < ParentLevel; i++) - { - if (parent is FrameworkElement frameworkElement) - { - parent = frameworkElement.Parent; - } - } - - return parent as FrameworkElement; - } - } - - /// <summary> - /// Gets GridSplitter Container Grid - /// </summary> - private Grid Resizable => TargetControl?.Parent as Grid; - - /// <summary> - /// Gets the current Column definition of the parent Grid - /// </summary> - private ColumnDefinition CurrentColumn - { - get - { - if (Resizable == null) - { - return null; - } - - var gridSplitterTargetedColumnIndex = GetTargetedColumn(); - - if ((gridSplitterTargetedColumnIndex >= 0) - && (gridSplitterTargetedColumnIndex < Resizable.ColumnDefinitions.Count)) - { - return Resizable.ColumnDefinitions[gridSplitterTargetedColumnIndex]; - } - - return null; - } - } - - /// <summary> - /// Gets the Sibling Column definition of the parent Grid - /// </summary> - private ColumnDefinition SiblingColumn - { - get - { - if (Resizable == null) - { - return null; - } - - var gridSplitterSiblingColumnIndex = GetSiblingColumn(); - - if ((gridSplitterSiblingColumnIndex >= 0) - && (gridSplitterSiblingColumnIndex < Resizable.ColumnDefinitions.Count)) - { - return Resizable.ColumnDefinitions[gridSplitterSiblingColumnIndex]; - } - - return null; - } - } - - /// <summary> - /// Gets the current Row definition of the parent Grid - /// </summary> - private RowDefinition CurrentRow - { - get - { - if (Resizable == null) - { - return null; - } - - var gridSplitterTargetedRowIndex = GetTargetedRow(); - - if ((gridSplitterTargetedRowIndex >= 0) - && (gridSplitterTargetedRowIndex < Resizable.RowDefinitions.Count)) - { - return Resizable.RowDefinitions[gridSplitterTargetedRowIndex]; - } - - return null; - } - } - - /// <summary> - /// Gets the Sibling Row definition of the parent Grid - /// </summary> - private RowDefinition SiblingRow - { - get - { - if (Resizable == null) - { - return null; - } - - var gridSplitterSiblingRowIndex = GetSiblingRow(); - - if ((gridSplitterSiblingRowIndex >= 0) - && (gridSplitterSiblingRowIndex < Resizable.RowDefinitions.Count)) - { - return Resizable.RowDefinitions[gridSplitterSiblingRowIndex]; - } - - return null; - } - } - - /// <summary> - /// Initializes a new instance of the <see cref="GridSplitter"/> class. - /// </summary> - public GridSplitter() - { - DefaultStyleKey = typeof(GridSplitter); - Loaded += GridSplitter_Loaded; - string automationName = "GridSpliter"; - AutomationProperties.SetName(this, automationName); - } - - /// <inheritdoc /> - protected override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - // Unhook registered events - Loaded -= GridSplitter_Loaded; - PointerEntered -= GridSplitter_PointerEntered; - PointerExited -= GridSplitter_PointerExited; - PointerPressed -= GridSplitter_PointerPressed; - PointerReleased -= GridSplitter_PointerReleased; - ManipulationStarted -= GridSplitter_ManipulationStarted; - ManipulationCompleted -= GridSplitter_ManipulationCompleted; - - _hoverWrapper?.UnhookEvents(); - - // Register Events - Loaded += GridSplitter_Loaded; - PointerEntered += GridSplitter_PointerEntered; - PointerExited += GridSplitter_PointerExited; - PointerPressed += GridSplitter_PointerPressed; - PointerReleased += GridSplitter_PointerReleased; - ManipulationStarted += GridSplitter_ManipulationStarted; - ManipulationCompleted += GridSplitter_ManipulationCompleted; - - _hoverWrapper?.UpdateHoverElement(Element); - - ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.TranslateY; - } - - private void GridSplitter_PointerReleased(object sender, PointerRoutedEventArgs e) - { - _pressed = false; - VisualStateManager.GoToState(this, _pointerEntered ? "PointerOver" : "Normal", true); - } - - private void GridSplitter_PointerPressed(object sender, PointerRoutedEventArgs e) - { - _pressed = true; - VisualStateManager.GoToState(this, "Pressed", true); - } - - private void GridSplitter_PointerExited(object sender, PointerRoutedEventArgs e) - { - _pointerEntered = false; - - if (!_pressed && !_dragging) - { - VisualStateManager.GoToState(this, "Normal", true); - } - } - - private void GridSplitter_PointerEntered(object sender, PointerRoutedEventArgs e) - { - _pointerEntered = true; - - if (!_pressed && !_dragging) - { - VisualStateManager.GoToState(this, "PointerOver", true); - } - } - - private void GridSplitter_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e) - { - _dragging = false; - _pressed = false; - VisualStateManager.GoToState(this, _pointerEntered ? "PointerOver" : "Normal", true); - } - - private void GridSplitter_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e) - { - _dragging = true; - VisualStateManager.GoToState(this, "Pressed", true); - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/GridSplitter/GridSplitter.xaml b/src/Notepads.Controls/GridSplitter/GridSplitter.xaml deleted file mode 100644 index 02242fe7d..000000000 --- a/src/Notepads.Controls/GridSplitter/GridSplitter.xaml +++ /dev/null @@ -1,52 +0,0 @@ -<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:Notepads.Controls"> - - <ResourceDictionary.ThemeDictionaries> - <ResourceDictionary x:Key="Default"> - <SolidColorBrush x:Key="SystemControlSplitterPointerOver" Color="{ThemeResource SystemBaseLowColor}" /> - <SolidColorBrush x:Key="SystemControlSplitterPressed" Color="{ThemeResource SystemBaseHighColor}" /> - </ResourceDictionary> - <ResourceDictionary x:Key="HighContrast"> - <SolidColorBrush x:Key="SystemControlSplitterPointerOver" Color="{ThemeResource SystemColorHighlightColor}" /> - <SolidColorBrush x:Key="SystemControlSplitterPressed" Color="{ThemeResource SystemColorHighlightColor}" /> - </ResourceDictionary> - </ResourceDictionary.ThemeDictionaries> - - <Style TargetType="local:GridSplitter"> - <Setter Property="IsTabStop" Value="True"></Setter> - <Setter Property="UseSystemFocusVisuals" Value="True"></Setter> - <Setter Property="HorizontalAlignment" Value="Stretch"></Setter> - <Setter Property="VerticalAlignment" Value="Stretch"></Setter> - <Setter Property="IsFocusEngagementEnabled" Value="True"></Setter> - <Setter Property="MinWidth" Value="16"></Setter> - <Setter Property="MinHeight" Value="16"></Setter> - <Setter Property="Background" Value="{ThemeResource SystemControlHighlightChromeHighBrush}"></Setter> - <Setter Property="GripperForeground" Value="{ThemeResource SystemControlForegroundAltHighBrush}" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="local:GridSplitter"> - <Grid x:Name="RootGrid" Background="{TemplateBinding Background}"> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="GridSplitterStates"> - <VisualState x:Name="Normal" /> - <VisualState x:Name="PointerOver"> - <VisualState.Setters> - <Setter Target="RootGrid.Background" Value="{ThemeResource SystemControlSplitterPointerOver}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="Pressed"> - <VisualState.Setters> - <Setter Target="RootGrid.Background" Value="{ThemeResource SystemControlSplitterPressed}" /> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - <ContentPresenter Content="{TemplateBinding Element}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" /> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - -</ResourceDictionary> diff --git a/src/Notepads.Controls/GridSplitter/GripperHoverWrapper.cs b/src/Notepads.Controls/GridSplitter/GripperHoverWrapper.cs deleted file mode 100644 index d806e268a..000000000 --- a/src/Notepads.Controls/GridSplitter/GripperHoverWrapper.cs +++ /dev/null @@ -1,154 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/GridSplitter - -namespace Notepads.Controls -{ - using Windows.UI.Core; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Input; - - internal class GripperHoverWrapper - { - private readonly GridSplitter.GridResizeDirection _gridSplitterDirection; - - private CoreCursor _splitterPreviousPointer; - private CoreCursor _previousCursor; - private GridSplitter.GripperCursorType _gripperCursor; - private int _gripperCustomCursorResource; - private bool _isDragging; - private UIElement _element; - - internal GridSplitter.GripperCursorType GripperCursor - { - get => _gripperCursor; - set => _gripperCursor = value; - } - - internal int GripperCustomCursorResource - { - get => _gripperCustomCursorResource; - set => _gripperCustomCursorResource = value; - } - - /// <summary> - /// Initializes a new instance of the <see cref="GripperHoverWrapper"/> class that add cursor change on hover functionality for GridSplitter. - /// </summary> - /// <param name="element">UI element to apply cursor change on hover</param> - /// <param name="gridSplitterDirection">GridSplitter resize direction</param> - /// <param name="gripperCursor">GridSplitter gripper on hover cursor type</param> - /// <param name="gripperCustomCursorResource">GridSplitter gripper custom cursor resource number</param> - internal GripperHoverWrapper(UIElement element, GridSplitter.GridResizeDirection gridSplitterDirection, GridSplitter.GripperCursorType gripperCursor, int gripperCustomCursorResource) - { - _gridSplitterDirection = gridSplitterDirection; - _gripperCursor = gripperCursor; - _gripperCustomCursorResource = gripperCustomCursorResource; - _element = element; - UnhookEvents(); - _element.PointerEntered += Element_PointerEntered; - _element.PointerExited += Element_PointerExited; - } - - internal void UpdateHoverElement(UIElement element) - { - UnhookEvents(); - _element = element; - _element.PointerEntered += Element_PointerEntered; - _element.PointerExited += Element_PointerExited; - } - - private void Element_PointerExited(object sender, PointerRoutedEventArgs e) - { - if (_isDragging) - { - // if dragging don't update the curser just update the splitter cursor with the last window cursor, - // because the splitter is still using the arrow cursor and will revert to original case when drag completes - _splitterPreviousPointer = _previousCursor; - } - else - { - Window.Current.CoreWindow.PointerCursor = _previousCursor; - } - } - - private void Element_PointerEntered(object sender, PointerRoutedEventArgs e) - { - // if not dragging - if (!_isDragging) - { - _previousCursor = _splitterPreviousPointer = Window.Current.CoreWindow.PointerCursor; - UpdateDisplayCursor(); - } - - // if dragging - else - { - _previousCursor = _splitterPreviousPointer; - } - } - - private void UpdateDisplayCursor() - { - if (_gripperCursor == GridSplitter.GripperCursorType.Default) - { - if (_gridSplitterDirection == GridSplitter.GridResizeDirection.Columns) - { - Window.Current.CoreWindow.PointerCursor = GridSplitter.ColumnsSplitterCursor; - } - else if (_gridSplitterDirection == GridSplitter.GridResizeDirection.Rows) - { - Window.Current.CoreWindow.PointerCursor = GridSplitter.RowSplitterCursor; - } - } - else - { - var coreCursor = (CoreCursorType)((int)_gripperCursor); - if (_gripperCursor == GridSplitter.GripperCursorType.Custom) - { - if (_gripperCustomCursorResource > GridSplitter.GripperCustomCursorDefaultResource) - { - Window.Current.CoreWindow.PointerCursor = new CoreCursor(coreCursor, (uint)_gripperCustomCursorResource); - } - } - else - { - Window.Current.CoreWindow.PointerCursor = new CoreCursor(coreCursor, 1); - } - } - } - - internal void SplitterManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e) - { - if (!(sender is GridSplitter splitter)) - { - return; - } - - _splitterPreviousPointer = splitter.PreviousCursor; - _isDragging = true; - } - - internal void SplitterManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e) - { - if (!(sender is GridSplitter splitter)) - { - return; - } - - Window.Current.CoreWindow.PointerCursor = splitter.PreviousCursor = _splitterPreviousPointer; - _isDragging = false; - } - - internal void UnhookEvents() - { - if (_element == null) - { - return; - } - - _element.PointerEntered -= Element_PointerEntered; - _element.PointerExited -= Element_PointerExited; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/Helpers/DispatcherQueueHelper.cs b/src/Notepads.Controls/Helpers/DispatcherQueueHelper.cs deleted file mode 100644 index 5eb2f3478..000000000 --- a/src/Notepads.Controls/Helpers/DispatcherQueueHelper.cs +++ /dev/null @@ -1,250 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/8464f8e5263686c1484732bdea86ebba3f30a075/Microsoft.Toolkit.Uwp/Helpers/DispatcherQueueHelper.cs - -namespace Notepads.Controls.Helpers -{ - using System; - using System.Threading.Tasks; - using Windows.System; - - /// <summary> - /// This class provides static methods helper for executing code in a DispatcherQueue. - /// </summary> - public static class DispatcherQueueHelper - { - /// <summary> - /// Extension method for <see cref="DispatcherQueue"/>. Offering an actual awaitable <see cref="Task"/> with optional result that will be executed on the given dispatcher. - /// </summary> - /// <param name="dispatcher">DispatcherQueue of a thread to run <paramref name="function"/>.</param> - /// <param name="function"> Function to be executed on the given dispatcher.</param> - /// <param name="priority">DispatcherQueue execution priority, default is normal.</param> - /// <returns>An awaitable <see cref="Task"/> for the operation.</returns> - /// <remarks>If the current thread has UI access, <paramref name="function"/> will be invoked directly.</remarks> - public static Task ExecuteOnUIThreadAsync(this DispatcherQueue dispatcher, Action function, DispatcherQueuePriority priority = DispatcherQueuePriority.Normal) - { - if (function is null) - { - throw new ArgumentNullException(nameof(function)); - } - - /* Run the function directly when we have thread access. - * Also reuse Task.CompletedTask in case of success, - * to skip an unnecessary heap allocation for every invocation. */ - - // Ignoring for now, but need to map the CurrentThreadID for all dispatcher queue code we have - /* - if (dispatcher.HasThreadAccess) - { - try - { - function(); - - return Task.CompletedTask; - } - catch (Exception e) - { - return Task.FromException(e); - } - } - */ - - var taskCompletionSource = new TaskCompletionSource<object>(); - - _ = dispatcher?.TryEnqueue(priority, () => - { - try - { - function(); - - taskCompletionSource.SetResult(null); - } - catch (Exception e) - { - taskCompletionSource.SetException(e); - } - }); - - return taskCompletionSource.Task; - } - - /// <summary> - /// Extension method for <see cref="DispatcherQueue"/>. Offering an actual awaitable <see cref="Task{T}"/> with optional result that will be executed on the given dispatcher. - /// </summary> - /// <typeparam name="T">Returned data type of the function.</typeparam> - /// <param name="dispatcher">DispatcherQueue of a thread to run <paramref name="function"/>.</param> - /// <param name="function"> Function to be executed on the given dispatcher.</param> - /// <param name="priority">DispatcherQueue execution priority, default is normal.</param> - /// <returns>An awaitable <see cref="Task{T}"/> for the operation.</returns> - /// <remarks>If the current thread has UI access, <paramref name="function"/> will be invoked directly.</remarks> - public static Task<T> ExecuteOnUIThreadAsync<T>(this DispatcherQueue dispatcher, Func<T> function, DispatcherQueuePriority priority = DispatcherQueuePriority.Normal) - { - if (function is null) - { - throw new ArgumentNullException(nameof(function)); - } - - // Skip the dispatch, if possible - // Ignoring for now, but need to map the CurrentThreadID for all dispatcher queue code we have - /* - if (dispatcher.HasThreadAccess) - { - try - { - return Task.FromResult(function()); - } - catch (Exception e) - { - return Task.FromException<T>(e); - } - } - */ - - var taskCompletionSource = new TaskCompletionSource<T>(); - - _ = dispatcher?.TryEnqueue(priority, () => - { - try - { - taskCompletionSource.SetResult(function()); - } - catch (Exception e) - { - taskCompletionSource.SetException(e); - } - }); - - return taskCompletionSource.Task; - } - - /// <summary> - /// Extension method for <see cref="DispatcherQueue"/>. Offering an actual awaitable <see cref="Task"/> with optional result that will be executed on the given dispatcher. - /// </summary> - /// <param name="dispatcher">DispatcherQueue of a thread to run <paramref name="function"/>.</param> - /// <param name="function">Asynchronous function to be executed on the given dispatcher.</param> - /// <param name="priority">DispatcherQueue execution priority, default is normal.</param> - /// <returns>An awaitable <see cref="Task"/> for the operation.</returns> - /// <remarks>If the current thread has UI access, <paramref name="function"/> will be invoked directly.</remarks> - public static Task ExecuteOnUIThreadAsync(this DispatcherQueue dispatcher, Func<Task> function, DispatcherQueuePriority priority = DispatcherQueuePriority.Normal) - { - if (function is null) - { - throw new ArgumentNullException(nameof(function)); - } - - /* If we have thread access, we can retrieve the task directly. - * We don't use ConfigureAwait(false) in this case, in order - * to let the caller continue its execution on the same thread - * after awaiting the task returned by this function. */ - - // Ignoring for now, but need to map the CurrentThreadID for all dispatcher queue code we have - /* - if (dispatcher.HasThreadAccess) - { - try - { - if (function() is Task awaitableResult) - { - return awaitableResult; - } - - return Task.FromException(new InvalidOperationException("The Task returned by function cannot be null.")); - } - catch (Exception e) - { - return Task.FromException(e); - } - } - */ - - var taskCompletionSource = new TaskCompletionSource<object>(); - - _ = dispatcher?.TryEnqueue(priority, async () => - { - try - { - if (function() is Task awaitableResult) - { - await awaitableResult.ConfigureAwait(false); - - taskCompletionSource.SetResult(null); - } - else - { - taskCompletionSource.SetException(new InvalidOperationException("The Task returned by function cannot be null.")); - } - } - catch (Exception e) - { - taskCompletionSource.SetException(e); - } - }); - - return taskCompletionSource.Task; - } - - /// <summary> - /// Extension method for <see cref="DispatcherQueue"/>. Offering an actual awaitable <see cref="Task{T}"/> with optional result that will be executed on the given dispatcher. - /// </summary> - /// <typeparam name="T">Returned data type of the function.</typeparam> - /// <param name="dispatcher">DispatcherQueue of a thread to run <paramref name="function"/>.</param> - /// <param name="function">Asynchronous function to be executed asynchronously on the given dispatcher.</param> - /// <param name="priority">DispatcherQueue execution priority, default is normal.</param> - /// <returns>An awaitable <see cref="Task{T}"/> for the operation.</returns> - /// <remarks>If the current thread has UI access, <paramref name="function"/> will be invoked directly.</remarks> - public static Task<T> ExecuteOnUIThreadAsync<T>(this DispatcherQueue dispatcher, Func<Task<T>> function, DispatcherQueuePriority priority = DispatcherQueuePriority.Normal) - { - if (function is null) - { - throw new ArgumentNullException(nameof(function)); - } - - // Skip the dispatch, if possible - // Ignoring for now, but need to map the CurrentThreadID for all dispatcher queue code we have - /* - if (dispatcher.HasThreadAccess) - { - try - { - if (function() is Task<T> awaitableResult) - { - return awaitableResult; - } - - return Task.FromException<T>(new InvalidOperationException("The Task returned by function cannot be null.")); - } - catch (Exception e) - { - return Task.FromException<T>(e); - } - } - */ - - var taskCompletionSource = new TaskCompletionSource<T>(); - - _ = dispatcher?.TryEnqueue(priority, async () => - { - try - { - if (function() is Task<T> awaitableResult) - { - var result = await awaitableResult.ConfigureAwait(false); - - taskCompletionSource.SetResult(result); - } - else - { - taskCompletionSource.SetException(new InvalidOperationException("The Task returned by function cannot be null.")); - } - } - catch (Exception e) - { - taskCompletionSource.SetException(e); - } - }); - - return taskCompletionSource.Task; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/Helpers/ThemeListener.cs b/src/Notepads.Controls/Helpers/ThemeListener.cs deleted file mode 100644 index c05b5c0ce..000000000 --- a/src/Notepads.Controls/Helpers/ThemeListener.cs +++ /dev/null @@ -1,144 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/8464f8e5263686c1484732bdea86ebba3f30a075/Microsoft.Toolkit.Uwp.UI/Helpers/ThemeListener.cs - -namespace Notepads.Controls.Helpers -{ - using System; - using System.Threading.Tasks; - using Windows.Foundation.Metadata; - using Windows.System; - using Windows.UI.ViewManagement; - using Windows.UI.Xaml; - - /// <summary> - /// The Delegate for a ThemeChanged Event. - /// </summary> - /// <param name="sender">Sender ThemeListener</param> - public delegate void ThemeChangedEvent(ThemeListener sender); - - /// <summary> - /// Class which listens for changes to Application Theme or High Contrast Modes - /// and Signals an Event when they occur. - /// </summary> - [AllowForWeb] - public sealed class ThemeListener : IDisposable - { - /// <summary> - /// Gets the Name of the Current Theme. - /// </summary> - public string CurrentThemeName => CurrentTheme.ToString(); - - /// <summary> - /// Gets or sets the Current Theme. - /// </summary> - public ApplicationTheme CurrentTheme { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether the current theme is high contrast. - /// </summary> - public bool IsHighContrast { get; set; } - - /// <summary> - /// Gets or sets which DispatcherQueue is used to dispatch UI updates. - /// </summary> - public DispatcherQueue DispatcherQueue { get; set; } - - /// <summary> - /// An event that fires if the Theme changes. - /// </summary> - public event ThemeChangedEvent ThemeChanged; - - private readonly AccessibilitySettings _accessible = new AccessibilitySettings(); - private readonly UISettings _settings = new UISettings(); - - /// <summary> - /// Initializes a new instance of the <see cref="ThemeListener"/> class. - /// </summary> - /// <param name="dispatcherQueue">The DispatcherQueue that should be used to dispatch UI updates, or null if this is being called from the UI thread.</param> - public ThemeListener(DispatcherQueue dispatcherQueue = null) - { - CurrentTheme = Application.Current.RequestedTheme; - IsHighContrast = _accessible.HighContrast; - - DispatcherQueue = dispatcherQueue ?? DispatcherQueue.GetForCurrentThread(); - - _accessible.HighContrastChanged += Accessible_HighContrastChanged; - _settings.ColorValuesChanged += Settings_ColorValuesChanged; - - // Fallback in case either of the above fail, we'll check when we get activated next. - if (Window.Current != null) - { - Window.Current.CoreWindow.Activated += CoreWindow_Activated; - } - } - - private async void Accessible_HighContrastChanged(AccessibilitySettings sender, object args) - { - await DispatcherQueue.ExecuteOnUIThreadAsync(UpdateProperties, DispatcherQueuePriority.Normal); - } - - // Note: This can get called multiple times during HighContrast switch, do we care? - private async void Settings_ColorValuesChanged(UISettings sender, object args) - { - await OnColorValuesChanged(); - } - - internal Task OnColorValuesChanged() - { - // Getting called off thread, so we need to dispatch to request value. - return DispatcherQueue.ExecuteOnUIThreadAsync( - () => - { - // TODO: This doesn't stop the multiple calls if we're in our faked 'White' HighContrast Mode below. - if (CurrentTheme != Application.Current.RequestedTheme || - IsHighContrast != _accessible.HighContrast) - { - UpdateProperties(); - } - }, DispatcherQueuePriority.Normal); - } - - private void CoreWindow_Activated(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.WindowActivatedEventArgs args) - { - if (CurrentTheme != Application.Current.RequestedTheme || - IsHighContrast != _accessible.HighContrast) - { - UpdateProperties(); - } - } - - /// <summary> - /// Set our current properties and fire a change notification. - /// </summary> - private void UpdateProperties() - { - // TODO: Not sure if HighContrastScheme names are localized? - if (_accessible.HighContrast && _accessible.HighContrastScheme.IndexOf("white", StringComparison.OrdinalIgnoreCase) != -1) - { - IsHighContrast = false; - CurrentTheme = ApplicationTheme.Light; - } - else - { - // Otherwise, we just set to what's in the system as we'd expect. - IsHighContrast = _accessible.HighContrast; - CurrentTheme = Application.Current.RequestedTheme; - } - - ThemeChanged?.Invoke(this); - } - - /// <inheritdoc/> - public void Dispose() - { - _accessible.HighContrastChanged -= Accessible_HighContrastChanged; - _settings.ColorValuesChanged -= Settings_ColorValuesChanged; - if (Window.Current != null) - { - Window.Current.CoreWindow.Activated -= CoreWindow_Activated; - } - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/InAppNotification/InAppNotification.AttachedProperties.cs b/src/Notepads.Controls/InAppNotification/InAppNotification.AttachedProperties.cs deleted file mode 100644 index c8effb5a7..000000000 --- a/src/Notepads.Controls/InAppNotification/InAppNotification.AttachedProperties.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/InAppNotification - -namespace Notepads.Controls -{ - using System; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Media.Animation; - - /// <summary> - /// In App Notification defines a control to show local notification in the app. - /// </summary> - public partial class InAppNotification - { - /// <summary> - /// Gets the value of the KeyFrameDuration attached Property - /// </summary> - /// <param name="obj">the KeyFrame where the duration is set</param> - /// <returns>Value of KeyFrameDuration</returns> - public static TimeSpan GetKeyFrameDuration(DependencyObject obj) - { - return (TimeSpan)obj.GetValue(KeyFrameDurationProperty); - } - - /// <summary> - /// Sets the value of the KeyFrameDuration attached property - /// </summary> - /// <param name="obj">The KeyFrame object where the property is attached</param> - /// <param name="value">The TimeSpan value to be set as duration</param> - public static void SetKeyFrameDuration(DependencyObject obj, TimeSpan value) - { - obj.SetValue(KeyFrameDurationProperty, value); - } - - /// <summary> - /// Using a DependencyProperty as the backing store for KeyFrameDuration. This enables animation, styling, binding, etc - /// </summary> - public static readonly DependencyProperty KeyFrameDurationProperty = - DependencyProperty.RegisterAttached("KeyFrameDuration", typeof(TimeSpan), typeof(InAppNotification), new PropertyMetadata(0, OnKeyFrameAnimationChanged)); - - private static void OnKeyFrameAnimationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (e.NewValue is TimeSpan ts) - { - if (d is DoubleKeyFrame dkf) - { - dkf.KeyTime = KeyTime.FromTimeSpan(ts); - } - else if (d is ObjectKeyFrame okf) - { - okf.KeyTime = KeyTime.FromTimeSpan(ts); - } - } - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/InAppNotification/InAppNotification.Constants.cs b/src/Notepads.Controls/InAppNotification/InAppNotification.Constants.cs deleted file mode 100644 index d1e4dd986..000000000 --- a/src/Notepads.Controls/InAppNotification/InAppNotification.Constants.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/InAppNotification - -namespace Notepads.Controls -{ - /// <summary> - /// In App Notification defines a control to show local notification in the app. - /// </summary> - public partial class InAppNotification - { - /// <summary> - /// Key of the VisualStateGroup that show/dismiss content - /// </summary> - private const string GroupContent = "State"; - - /// <summary> - /// Key of the VisualState when content is showed - /// </summary> - private const string StateContentVisible = "Visible"; - - /// <summary> - /// Key of the VisualState when content is dismissed - /// </summary> - private const string StateContentCollapsed = "Collapsed"; - - /// <summary> - /// Key of the UI Element that dismiss the control - /// </summary> - private const string DismissButtonPart = "PART_DismissButton"; - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/InAppNotification/InAppNotification.Events.cs b/src/Notepads.Controls/InAppNotification/InAppNotification.Events.cs deleted file mode 100644 index ae6cbfae7..000000000 --- a/src/Notepads.Controls/InAppNotification/InAppNotification.Events.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/InAppNotification - -namespace Notepads.Controls -{ - using System; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Automation; - using Windows.UI.Xaml.Automation.Peers; - - /// <summary> - /// In App Notification defines a control to show local notification in the app. - /// </summary> - public partial class InAppNotification - { - /// <summary> - /// Event raised when the notification is opening - /// </summary> - public event InAppNotificationOpeningEventHandler Opening; - - /// <summary> - /// Event raised when the notification is opened - /// </summary> - public event EventHandler Opened; - - /// <summary> - /// Event raised when the notification is closing - /// </summary> - public event InAppNotificationClosingEventHandler Closing; - - /// <summary> - /// Event raised when the notification is closed - /// </summary> - public event InAppNotificationClosedEventHandler Closed; - - private AutomationPeer peer; - - private void DismissButton_Click(object sender, RoutedEventArgs e) - { - Dismiss(InAppNotificationDismissKind.User); - } - - private void DismissTimer_Tick(object sender, object e) - { - Dismiss(InAppNotificationDismissKind.Timeout); - } - - private void OpenAnimationTimer_Tick(object sender, object e) - { - lock (_openAnimationTimer) - { - _openAnimationTimer.Stop(); - Opened?.Invoke(this, EventArgs.Empty); - SetValue(AutomationProperties.NameProperty, "Notification"); - peer = FrameworkElementAutomationPeer.CreatePeerForElement(ContentTemplateRoot); - if (Content?.GetType() == typeof(string)) - { - AutomateTextNotification(Content.ToString()); - } - } - } - - private void AutomateTextNotification(string message) - { - if (peer != null) - { - peer.SetFocus(); - peer.RaiseNotificationEvent( - AutomationNotificationKind.Other, - AutomationNotificationProcessing.ImportantMostRecent, - "New notification" + message, - Guid.NewGuid().ToString()); - } - } - - private void ClosingAnimationTimer_Tick(object sender, object e) - { - lock (_closingAnimationTimer) - { - _closingAnimationTimer.Stop(); - Closed?.Invoke(this, new InAppNotificationClosedEventArgs(_lastDismissKind)); - } - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/InAppNotification/InAppNotification.Properties.cs b/src/Notepads.Controls/InAppNotification/InAppNotification.Properties.cs deleted file mode 100644 index 3f7431a1b..000000000 --- a/src/Notepads.Controls/InAppNotification/InAppNotification.Properties.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/InAppNotification - -namespace Notepads.Controls -{ - using System; - using Windows.UI.Xaml; - - /// <summary> - /// In App Notification defines a control to show local notification in the app. - /// </summary> - public partial class InAppNotification - { - /// <summary> - /// Identifies the <see cref="ShowDismissButton"/> dependency property. - /// </summary> - public static readonly DependencyProperty ShowDismissButtonProperty = - DependencyProperty.Register(nameof(ShowDismissButton), typeof(bool), typeof(InAppNotification), new PropertyMetadata(true, OnShowDismissButtonChanged)); - - /// <summary> - /// Identifies the <see cref="AnimationDuration"/> dependency property. - /// </summary> - public static readonly DependencyProperty AnimationDurationProperty = - DependencyProperty.Register(nameof(AnimationDuration), typeof(TimeSpan), typeof(InAppNotification), new PropertyMetadata(TimeSpan.FromMilliseconds(100))); - - /// <summary> - /// Identifies the <see cref="VerticalOffset"/> dependency property. - /// </summary> - public static readonly DependencyProperty VerticalOffsetProperty = - DependencyProperty.Register(nameof(VerticalOffset), typeof(double), typeof(InAppNotification), new PropertyMetadata(100)); - - /// <summary> - /// Identifies the <see cref="HorizontalOffset"/> dependency property. - /// </summary> - public static readonly DependencyProperty HorizontalOffsetProperty = - DependencyProperty.Register(nameof(HorizontalOffset), typeof(double), typeof(InAppNotification), new PropertyMetadata(0)); - - /// <summary> - /// Identifies the <see cref="StackMode"/> dependency property. - /// </summary> - public static readonly DependencyProperty StackModeProperty = - DependencyProperty.Register(nameof(StackMode), typeof(StackMode), typeof(InAppNotification), new PropertyMetadata(StackMode.Replace)); - - /// <summary> - /// Gets or sets a value indicating whether to show the Dismiss button of the control. - /// </summary> - public bool ShowDismissButton - { - get => (bool)GetValue(ShowDismissButtonProperty); - set => SetValue(ShowDismissButtonProperty, value); - } - - /// <summary> - /// Gets or sets a value indicating the duration of the popup animation (in milliseconds). - /// </summary> - public TimeSpan AnimationDuration - { - get => (TimeSpan)GetValue(AnimationDurationProperty); - set => SetValue(AnimationDurationProperty, value); - } - - /// <summary> - /// Gets or sets a value indicating the vertical offset of the popup animation. - /// </summary> - public double VerticalOffset - { - get => (double)GetValue(VerticalOffsetProperty); - set => SetValue(VerticalOffsetProperty, value); - } - - /// <summary> - /// Gets or sets a value indicating the horizontal offset of the popup animation. - /// </summary> - public double HorizontalOffset - { - get => (double)GetValue(HorizontalOffsetProperty); - set => SetValue(HorizontalOffsetProperty, value); - } - - /// <summary> - /// Gets or sets a value indicating the stack mode of the notifications. - /// </summary> - public StackMode StackMode - { - get => (StackMode)GetValue(StackModeProperty); - set => SetValue(StackModeProperty, value); - } - - private static void OnShowDismissButtonChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var inApNotification = d as InAppNotification; - - if (inApNotification._dismissButton != null) - { - bool showDismissButton = (bool)e.NewValue; - inApNotification._dismissButton.Visibility = showDismissButton ? Visibility.Visible : Visibility.Collapsed; - } - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/InAppNotification/InAppNotification.cs b/src/Notepads.Controls/InAppNotification/InAppNotification.cs deleted file mode 100644 index 667b4651a..000000000 --- a/src/Notepads.Controls/InAppNotification/InAppNotification.cs +++ /dev/null @@ -1,274 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/InAppNotification - -namespace Notepads.Controls -{ - using System; - using System.Collections.Generic; - using System.Linq; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - - /// <summary> - /// In App Notification defines a control to show local notification in the app. - /// </summary> - [TemplateVisualState(Name = StateContentVisible, GroupName = GroupContent)] - [TemplateVisualState(Name = StateContentCollapsed, GroupName = GroupContent)] - [TemplatePart(Name = DismissButtonPart, Type = typeof(Button))] - public partial class InAppNotification : ContentControl - { - private InAppNotificationDismissKind _lastDismissKind; - private readonly DispatcherTimer _openAnimationTimer = new DispatcherTimer(); - private readonly DispatcherTimer _closingAnimationTimer = new DispatcherTimer(); - private readonly DispatcherTimer _dismissTimer = new DispatcherTimer(); - private Button _dismissButton; - //private VisualStateGroup _visualStateGroup; - private readonly List<NotificationOptions> _stackedNotificationOptions = new List<NotificationOptions>(); - - /// <summary> - /// Initializes a new instance of the <see cref="InAppNotification"/> class. - /// </summary> - public InAppNotification() - { - DefaultStyleKey = typeof(InAppNotification); - - _dismissTimer.Tick += DismissTimer_Tick; - _openAnimationTimer.Tick += OpenAnimationTimer_Tick; - _closingAnimationTimer.Tick += ClosingAnimationTimer_Tick; - } - - /// <inheritdoc /> - protected override void OnApplyTemplate() - { - if (_dismissButton != null) - { - _dismissButton.Click -= DismissButton_Click; - } - - _dismissButton = (Button)GetTemplateChild(DismissButtonPart); - //_visualStateGroup = (VisualStateGroup)GetTemplateChild(GroupContent); - - if (_dismissButton != null) - { - _dismissButton.Visibility = ShowDismissButton ? Visibility.Visible : Visibility.Collapsed; - _dismissButton.Click += DismissButton_Click; - } - - if (Visibility == Visibility.Visible) - { - VisualStateManager.GoToState(this, StateContentVisible, true); - } - else - { - VisualStateManager.GoToState(this, StateContentCollapsed, true); - } - - base.OnApplyTemplate(); - } - - /// <summary> - /// Show notification using the current template - /// </summary> - /// <param name="duration">Displayed duration of the notification in ms (less or equal 0 means infinite duration)</param> - public void Show(int duration = 0) - { - lock (_openAnimationTimer) - lock (_closingAnimationTimer) - lock (_dismissTimer) - { - _openAnimationTimer.Stop(); - _closingAnimationTimer.Stop(); - _dismissTimer.Stop(); - - var eventArgs = new InAppNotificationOpeningEventArgs(); - Opening?.Invoke(this, eventArgs); - - if (eventArgs.Cancel) - { - return; - } - - Visibility = Visibility.Visible; - VisualStateManager.GoToState(this, StateContentVisible, true); - - _openAnimationTimer.Interval = AnimationDuration; - _openAnimationTimer.Start(); - - if (duration > 0) - { - _dismissTimer.Interval = TimeSpan.FromMilliseconds(duration); - _dismissTimer.Start(); - } - } - } - - /// <summary> - /// Show notification using text as the content of the notification - /// </summary> - /// <param name="text">Text used as the content of the notification</param> - /// <param name="duration">Displayed duration of the notification in ms (less or equal 0 means infinite duration)</param> - public void Show(string text, int duration = 0) - { - var notificationOptions = new NotificationOptions - { - Duration = duration, - Content = text - }; - Show(notificationOptions); - } - - /// <summary> - /// Show notification using UIElement as the content of the notification - /// </summary> - /// <param name="element">UIElement used as the content of the notification</param> - /// <param name="duration">Displayed duration of the notification in ms (less or equal 0 means infinite duration)</param> - public void Show(UIElement element, int duration = 0) - { - var notificationOptions = new NotificationOptions - { - Duration = duration, - Content = element - }; - Show(notificationOptions); - } - - /// <summary> - /// Show notification using DataTemplate as the content of the notification - /// </summary> - /// <param name="dataTemplate">DataTemplate used as the content of the notification</param> - /// <param name="duration">Displayed duration of the notification in ms (less or equal 0 means infinite duration)</param> - public void Show(DataTemplate dataTemplate, int duration = 0) - { - var notificationOptions = new NotificationOptions - { - Duration = duration, - Content = dataTemplate - }; - Show(notificationOptions); - } - - /// <summary> - /// Dismiss the notification - /// </summary> - public void Dismiss() - { - Dismiss(InAppNotificationDismissKind.Programmatic); - } - - /// <summary> - /// Dismiss the notification - /// </summary> - /// <param name="dismissKind">Kind of action that triggered dismiss event</param> - private void Dismiss(InAppNotificationDismissKind dismissKind) - { - lock (_openAnimationTimer) - lock (_closingAnimationTimer) - lock (_dismissTimer) - { - if (Visibility == Visibility.Visible) - { - _dismissTimer.Stop(); - - // Continue to display notification if on remaining stacked notification - if (_stackedNotificationOptions.Any()) - { - _stackedNotificationOptions.RemoveAt(0); - - if (_stackedNotificationOptions.Any()) - { - var notificationOptions = _stackedNotificationOptions[0]; - - UpdateContent(notificationOptions); - - if (notificationOptions.Duration > 0) - { - _dismissTimer.Interval = TimeSpan.FromMilliseconds(notificationOptions.Duration); - _dismissTimer.Start(); - } - - return; - } - } - - _openAnimationTimer.Stop(); - _closingAnimationTimer.Stop(); - - var closingEventArgs = new InAppNotificationClosingEventArgs(dismissKind); - Closing?.Invoke(this, closingEventArgs); - - if (closingEventArgs.Cancel) - { - return; - } - - VisualStateManager.GoToState(this, StateContentCollapsed, true); - - _lastDismissKind = dismissKind; - - _closingAnimationTimer.Interval = AnimationDuration; - _closingAnimationTimer.Start(); - } - } - } - - /// <summary> - /// Informs if the notification should be displayed immediately (based on the StackMode) - /// </summary> - /// <returns>True if notification should be displayed immediately</returns> - private bool ShouldDisplayImmediately() - { - return StackMode != StackMode.QueueBehind || - (StackMode == StackMode.QueueBehind && _stackedNotificationOptions.Count == 0); - } - - /// <summary> - /// Update the Content of the notification - /// </summary> - /// <param name="notificationOptions">Information about the notification to display</param> - private void UpdateContent(NotificationOptions notificationOptions) - { - switch (notificationOptions.Content) - { - case string text: - ContentTemplate = null; - Content = text; - break; - case UIElement element: - ContentTemplate = null; - Content = element; - break; - case DataTemplate dataTemplate: - ContentTemplate = dataTemplate; - Content = null; - break; - } - } - - /// <summary> - /// Handle the display of the notification based on the current StackMode - /// </summary> - /// <param name="notificationOptions">Information about the notification to display</param> - private void Show(NotificationOptions notificationOptions) - { - bool shouldDisplayImmediately = ShouldDisplayImmediately(); - - if (StackMode == StackMode.QueueBehind) - { - _stackedNotificationOptions.Add(notificationOptions); - } - - if (StackMode == StackMode.StackInFront) - { - _stackedNotificationOptions.Insert(0, notificationOptions); - } - - if (shouldDisplayImmediately) - { - UpdateContent(notificationOptions); - Show(notificationOptions.Duration); - } - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/InAppNotification/InAppNotification.xaml b/src/Notepads.Controls/InAppNotification/InAppNotification.xaml deleted file mode 100644 index 459ff026f..000000000 --- a/src/Notepads.Controls/InAppNotification/InAppNotification.xaml +++ /dev/null @@ -1,35 +0,0 @@ -<ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:Notepads.Controls"> - - <ResourceDictionary.MergedDictionaries> - <ResourceDictionary Source="Styles/MSEdgeNotificationStyle.xaml" /> - </ResourceDictionary.MergedDictionaries> - - <Style TargetType="local:InAppNotification" x:Key="BaseInAppNotificationsStyle"> - <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeMediumBrush}" /> - <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" /> - <Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseLowBrush}" /> - <Setter Property="Visibility" Value="Collapsed" /> - <Setter Property="BorderThickness" Value="2" /> - <Setter Property="HorizontalAlignment" Value="Stretch" /> - <Setter Property="VerticalAlignment" Value="Bottom" /> - <Setter Property="MinHeight" Value="55" /> - <Setter Property="FontSize" Value="16" /> - <Setter Property="RenderTransformOrigin" Value="0.5,1" /> - <Setter Property="Margin" Value="24,12" /> - <Setter Property="Padding" Value="24,12" /> - <Setter Property="MaxWidth" Value="960" /> - <Setter Property="MinWidth" Value="132" /> - <Setter Property="AnimationDuration" Value="0:0:0.100" /> - <Setter Property="VerticalOffset" Value="100" /> - <Setter Property="HorizontalOffset" Value="0" /> - <Setter Property="Template" Value="{StaticResource MSEdgeNotificationTemplate}" /> - </Style> - - <Style TargetType="local:InAppNotification" BasedOn="{StaticResource BaseInAppNotificationsStyle}"> - <Setter Property="Background" Value="{ThemeResource SystemControlAcrylicElementBrush}" /> - </Style> - -</ResourceDictionary> diff --git a/src/Notepads.Controls/InAppNotification/InAppNotificationClosedEventArgs.cs b/src/Notepads.Controls/InAppNotification/InAppNotificationClosedEventArgs.cs deleted file mode 100644 index bfe6fe09a..000000000 --- a/src/Notepads.Controls/InAppNotification/InAppNotificationClosedEventArgs.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/InAppNotification - -namespace Notepads.Controls -{ - using System; - - /// <summary> - /// A delegate for <see cref="InAppNotification"/> dismissing. - /// </summary> - /// <param name="sender">The sender.</param> - /// <param name="e">The event arguments.</param> - public delegate void InAppNotificationClosedEventHandler(object sender, InAppNotificationClosedEventArgs e); - - /// <summary> - /// Provides data for the <see cref="InAppNotification"/> Dismissing event. - /// </summary> - public class InAppNotificationClosedEventArgs : EventArgs - { - /// <summary> - /// Initializes a new instance of the <see cref="InAppNotificationClosedEventArgs"/> class. - /// </summary> - /// <param name="dismissKind">Dismiss kind that triggered the closing event</param> - public InAppNotificationClosedEventArgs(InAppNotificationDismissKind dismissKind) - { - DismissKind = dismissKind; - } - - /// <summary> - /// Gets the kind of action for the closing event. - /// </summary> - public InAppNotificationDismissKind DismissKind { get; private set; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/InAppNotification/InAppNotificationClosingEventArgs.cs b/src/Notepads.Controls/InAppNotification/InAppNotificationClosingEventArgs.cs deleted file mode 100644 index b2ba76084..000000000 --- a/src/Notepads.Controls/InAppNotification/InAppNotificationClosingEventArgs.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/InAppNotification - -namespace Notepads.Controls -{ - using System; - - /// <summary> - /// A delegate for <see cref="InAppNotification"/> dismissing. - /// </summary> - /// <param name="sender">The sender.</param> - /// <param name="e">The event arguments.</param> - public delegate void InAppNotificationClosingEventHandler(object sender, InAppNotificationClosingEventArgs e); - - /// <summary> - /// Provides data for the <see cref="InAppNotification"/> Dismissing event. - /// </summary> - public class InAppNotificationClosingEventArgs : EventArgs - { - /// <summary> - /// Initializes a new instance of the <see cref="InAppNotificationClosingEventArgs"/> class. - /// </summary> - /// <param name="dismissKind">Dismiss kind that triggered the closing event</param> - public InAppNotificationClosingEventArgs(InAppNotificationDismissKind dismissKind) - { - DismissKind = dismissKind; - } - - /// <summary> - /// Gets the kind of action for the closing event. - /// </summary> - public InAppNotificationDismissKind DismissKind { get; private set; } - - /// <summary> - /// Gets or sets a value indicating whether the notification should be closed. - /// </summary> - public bool Cancel { get; set; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/InAppNotification/InAppNotificationDismissKind.cs b/src/Notepads.Controls/InAppNotification/InAppNotificationDismissKind.cs deleted file mode 100644 index f6d335501..000000000 --- a/src/Notepads.Controls/InAppNotification/InAppNotificationDismissKind.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/InAppNotification - -namespace Notepads.Controls -{ - /// <summary> - /// Enumeration to describe how an InAppNotification was dismissed - /// </summary> - public enum InAppNotificationDismissKind - { - /// <summary> - /// When the system dismissed the notification. - /// </summary> - Programmatic, - - /// <summary> - /// When user explicitly dismissed the notification. - /// </summary> - User, - - /// <summary> - /// When the system dismissed the notification after timeout. - /// </summary> - Timeout - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/InAppNotification/InAppNotificationOpeningEventArgs.cs b/src/Notepads.Controls/InAppNotification/InAppNotificationOpeningEventArgs.cs deleted file mode 100644 index 78e39cc4a..000000000 --- a/src/Notepads.Controls/InAppNotification/InAppNotificationOpeningEventArgs.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/InAppNotification - -namespace Notepads.Controls -{ - using System; - - /// <summary> - /// A delegate for <see cref="InAppNotification"/> opening. - /// </summary> - /// <param name="sender">The sender.</param> - /// <param name="e">The event arguments.</param> - public delegate void InAppNotificationOpeningEventHandler(object sender, InAppNotificationOpeningEventArgs e); - - /// <summary> - /// Provides data for the <see cref="InAppNotification"/> Dismissing event. - /// </summary> - public class InAppNotificationOpeningEventArgs : EventArgs - { - /// <summary> - /// Initializes a new instance of the <see cref="InAppNotificationOpeningEventArgs"/> class. - /// </summary> - public InAppNotificationOpeningEventArgs() - { - } - - /// <summary> - /// Gets or sets a value indicating whether the notification should be opened. - /// </summary> - public bool Cancel { get; set; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/InAppNotification/NotificationOptions.cs b/src/Notepads.Controls/InAppNotification/NotificationOptions.cs deleted file mode 100644 index ca67a8d50..000000000 --- a/src/Notepads.Controls/InAppNotification/NotificationOptions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/InAppNotification - -namespace Notepads.Controls -{ - using Windows.UI.Xaml; - - /// <summary> - /// Base class that contains options of notification - /// </summary> - internal class NotificationOptions - { - /// <summary> - /// Gets or sets duration of the stacked notification - /// </summary> - public int Duration { get; set; } - - /// <summary> - /// Gets or sets Content of the notification - /// Could be either a <see cref="string"/> or a <see cref="UIElement"/> or a <see cref="DataTemplate"/> - /// </summary> - public object Content { get; set; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/InAppNotification/StackMode.cs b/src/Notepads.Controls/InAppNotification/StackMode.cs deleted file mode 100644 index e619a1080..000000000 --- a/src/Notepads.Controls/InAppNotification/StackMode.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/InAppNotification - -namespace Notepads.Controls -{ - /// <summary> - /// The Stack mode of an in-app notification. - /// </summary> - public enum StackMode - { - /// <summary> - /// Each notification will replace the previous one - /// </summary> - Replace, - - /// <summary> - /// Opening a notification will display it immediately, remaining notifications will appear when a notification is dismissed - /// </summary> - StackInFront, - - /// <summary> - /// Dismissing a notification will show the next one in the queue - /// </summary> - QueueBehind - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/InAppNotification/Styles/MSEdgeNotificationStyle.xaml b/src/Notepads.Controls/InAppNotification/Styles/MSEdgeNotificationStyle.xaml deleted file mode 100644 index a560dc3b8..000000000 --- a/src/Notepads.Controls/InAppNotification/Styles/MSEdgeNotificationStyle.xaml +++ /dev/null @@ -1,200 +0,0 @@ -<ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:Notepads.Controls"> - - <ResourceDictionary.ThemeDictionaries> - <!-- Default is a fallback if a more precise theme isn't called - out below --> - <ResourceDictionary x:Key="Default"> - <SolidColorBrush x:Key="SystemControlMSEdgeNotificationPointerOverChromeBrush" Color="Transparent" /> - <SolidColorBrush x:Key="SystemControlMSEdgeNotificationPointerOverForegroundBrush" Color="{ThemeResource SystemColorButtonTextColor}"/> - <SolidColorBrush x:Key="SystemControlMSEdgeNotificationButtonBorderBrush" Color="Transparent" /> - </ResourceDictionary> - - <!-- HighContrast is used in all high contrast themes --> - <ResourceDictionary x:Key="HighContrast"> - <SolidColorBrush x:Key="SystemControlMSEdgeNotificationPointerOverChromeBrush" Color="{ThemeResource SystemColorHighlightColor}" /> - <SolidColorBrush x:Key="SystemControlMSEdgeNotificationPointerOverForegroundBrush" Color="{ThemeResource SystemColorHighlightTextColor}"/> - <SolidColorBrush x:Key="SystemControlMSEdgeNotificationButtonBorderBrush" Color="{ThemeResource SystemColorButtonTextColor}" /> - </ResourceDictionary> - </ResourceDictionary.ThemeDictionaries> - - <Style x:Key="DismissTextBlockButtonStyle" TargetType="ButtonBase"> - <Setter Property="Background" Value="{ThemeResource HyperlinkButtonBackground}" /> - <Setter Property="Foreground" Value="{ThemeResource ApplicationForegroundThemeBrush}" /> - <Setter Property="Width" Value="40" /> - <Setter Property="Height" Value="40" /> - <Setter Property="UseSystemFocusVisuals" Value="True" /> - <Setter Property="HighContrastAdjustment" Value="None" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="ButtonBase"> - <Grid x:Name="RootGrid" Margin="{TemplateBinding Padding}" Background="{TemplateBinding Background}"> - <Border x:Name="TextBorder" BorderThickness="2" BorderBrush="{ThemeResource SystemControlMSEdgeNotificationButtonBorderBrush}"> - <ContentPresenter x:Name="Text" - Content="{TemplateBinding Content}" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> - </Border> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal" /> - <VisualState x:Name="PointerOver"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlMSEdgeNotificationPointerOverForegroundBrush}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlMSEdgeNotificationPointerOverChromeBrush}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="Pressed"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlMSEdgeNotificationPointerOverForegroundBrush}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlMSEdgeNotificationPointerOverChromeBrush}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="Disabled"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource HyperlinkButtonForegroundDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource HyperlinkButtonBackgroundDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource HyperlinkButtonBorderBrushDisabled}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - - <ControlTemplate x:Key="MSEdgeNotificationTemplate" - TargetType="local:InAppNotification"> - <Grid> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="State"> - <VisualState x:Name="Collapsed"> - <Storyboard> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> - <EasingDoubleKeyFrame KeyTime="0" Value="0" /> - <EasingDoubleKeyFrame local:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" - Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - </DoubleAnimationUsingKeyFrames> - - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> - <EasingDoubleKeyFrame KeyTime="0" Value="0" /> - <EasingDoubleKeyFrame local:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" - Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}"/> - </DoubleAnimationUsingKeyFrames> - - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.Visibility)"> - <DiscreteObjectKeyFrame KeyTime="0"> - <DiscreteObjectKeyFrame.Value> - <Visibility>Visible</Visibility> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - <DiscreteObjectKeyFrame local:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}"> - <DiscreteObjectKeyFrame.Value> - <Visibility>Collapsed</Visibility> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - - <VisualState x:Name="Visible"> - <Storyboard> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> - <EasingDoubleKeyFrame KeyTime="0" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - <EasingDoubleKeyFrame local:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" /> - </DoubleAnimationUsingKeyFrames> - - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> - <EasingDoubleKeyFrame KeyTime="0" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - <EasingDoubleKeyFrame local:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" /> - </DoubleAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - - <Grid x:Name="RootGrid" - RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}" - Margin="{TemplateBinding Margin}" - Padding="{TemplateBinding Padding}" - MaxWidth="{TemplateBinding MaxWidth}" - Visibility="{TemplateBinding Visibility}" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}"> - - <Grid.RenderTransform> - <CompositeTransform /> - </Grid.RenderTransform> - - <Grid.ColumnDefinitions> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> - - <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalAlignment}" - HorizontalContentAlignment="Stretch" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - VerticalContentAlignment="Center" - TextWrapping="WrapWholeWords" /> - - <Button x:Name="PART_DismissButton" - Grid.Column="1" - Margin="24,0,0,0" - FontSize="16" - Style="{StaticResource DismissTextBlockButtonStyle}" - Content="" - FontFamily="Segoe MDL2 Assets" - AutomationProperties.Name="Dismiss"> - <Button.RenderTransform> - <TranslateTransform x:Name="DismissButtonTransform" X="18" /> - </Button.RenderTransform> - </Button> - </Grid> - </Grid> - </ControlTemplate> - - <Style x:Key="MSEdgeNotificationStyle" TargetType="local:InAppNotification"> - <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeMediumBrush}" /> - <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" /> - <Setter Property="BorderBrush" Value="{ThemeResource SystemControlBackgroundBaseLowBrush}" /> - <Setter Property="Visibility" Value="Collapsed" /> - <Setter Property="BorderThickness" Value="2" /> - <Setter Property="HorizontalAlignment" Value="Stretch" /> - <Setter Property="VerticalAlignment" Value="Bottom" /> - <Setter Property="MinHeight" Value="55" /> - <Setter Property="FontSize" Value="16" /> - <Setter Property="RenderTransformOrigin" Value="0.5,1" /> - <Setter Property="Margin" Value="24,12" /> - <Setter Property="Padding" Value="24,12" /> - <Setter Property="MaxWidth" Value="960" /> - <Setter Property="MinWidth" Value="132" /> - <Setter Property="AnimationDuration" Value="0:0:0.100" /> - <Setter Property="VerticalOffset" Value="100" /> - <Setter Property="HorizontalOffset" Value="0" /> - <Setter Property="Template" Value="{StaticResource MSEdgeNotificationTemplate}" /> - </Style> -</ResourceDictionary> diff --git a/src/Notepads.Controls/MarkdownTextBlock/CodeBlockResolvingEventArgs.cs b/src/Notepads.Controls/MarkdownTextBlock/CodeBlockResolvingEventArgs.cs deleted file mode 100644 index ef0136348..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/CodeBlockResolvingEventArgs.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock - -namespace Notepads.Controls -{ - using System; - using Windows.UI.Xaml.Documents; - - /// <summary> - /// Arguments for the <see cref="MarkdownTextBlock.CodeBlockResolving"/> event when a Code Block is being rendered. - /// </summary> - public class CodeBlockResolvingEventArgs : EventArgs - { - internal CodeBlockResolvingEventArgs(InlineCollection inlineCollection, string text, string codeLanguage) - { - InlineCollection = inlineCollection; - Text = text; - CodeLanguage = codeLanguage; - } - - /// <summary> - /// Gets the language of the Code Block, as specified by ```{Language} on the first line of the block, - /// e.g. <para/> - /// ```C# <para/> - /// public void Method();<para/> - /// ```<para/> - /// </summary> - public string CodeLanguage { get; } - - /// <summary> - /// Gets the raw code block text - /// </summary> - public string Text { get; } - - /// <summary> - /// Gets Collection to add formatted Text to. - /// </summary> - public InlineCollection InlineCollection { get; } - - /// <summary> - /// Gets or sets a value indicating whether this event was handled successfully. - /// </summary> - public bool Handled { get; set; } = false; - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/ImageResolvingEventArgs.cs b/src/Notepads.Controls/MarkdownTextBlock/ImageResolvingEventArgs.cs deleted file mode 100644 index 601b77abb..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/ImageResolvingEventArgs.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock - -namespace Notepads.Controls -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Threading.Tasks; - using Windows.Foundation; - using Windows.UI.Xaml.Media; - - /// <summary> - /// Arguments for the <see cref="MarkdownTextBlock.ImageResolving"/> event which is called when a url needs to be resolved to a <see cref="ImageSource"/>. - /// </summary> - public class ImageResolvingEventArgs : EventArgs - { - private readonly IList<TaskCompletionSource<object>> _deferrals; - - internal ImageResolvingEventArgs(string url, string tooltip) - { - _deferrals = new List<TaskCompletionSource<object>>(); - Url = url; - Tooltip = tooltip; - } - - /// <summary> - /// Gets the url of the image in the markdown document. - /// </summary> - public string Url { get; } - - /// <summary> - /// Gets the tooltip of the image in the markdown document. - /// </summary> - public string Tooltip { get; } - - /// <summary> - /// Gets or sets a value indicating whether this event was handled successfully. - /// </summary> - public bool Handled { get; set; } - - /// <summary> - /// Gets or sets the image to display in the <see cref="MarkdownTextBlock"/>. - /// </summary> - public ImageSource Image { get; set; } - - /// <summary> - /// Informs the <see cref="MarkdownTextBlock"/> that the event handler might run asynchronously. - /// </summary> - /// <returns>Deferral</returns> - public Deferral GetDeferral() - { - var task = new TaskCompletionSource<object>(); - _deferrals.Add(task); - - return new Deferral(() => - { - task.SetResult(null); - }); - } - - /// <summary> - /// Returns a <see cref="Task"/> that completes when all <see cref="Deferral"/>s have completed. - /// </summary> - /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> - internal Task WaitForDeferrals() - { - return Task.WhenAll(_deferrals.Select(f => f.Task)); - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/LinkClickedEventArgs.cs b/src/Notepads.Controls/MarkdownTextBlock/LinkClickedEventArgs.cs deleted file mode 100644 index 8a83e2b82..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/LinkClickedEventArgs.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock - -namespace Notepads.Controls -{ - using System; - - /// <summary> - /// Arguments for the OnLinkClicked event which is fired then the user presses a link. - /// </summary> - public class LinkClickedEventArgs : EventArgs - { - internal LinkClickedEventArgs(string link) - { - Link = link; - } - - /// <summary> - /// Gets the link that was tapped. - /// </summary> - public string Link { get; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/CodeBlock.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/CodeBlock.cs deleted file mode 100644 index 79abd1490..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/CodeBlock.cs +++ /dev/null @@ -1,196 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Blocks - -namespace Notepads.Controls.Markdown -{ - using System.Text; - - /// <summary> - /// Represents a block of text that is displayed in a fixed-width font. Inline elements and - /// escape sequences are ignored inside the code block. - /// </summary> - public class CodeBlock : MarkdownBlock - { - /// <summary> - /// Initializes a new instance of the <see cref="CodeBlock"/> class. - /// </summary> - public CodeBlock() - : base(MarkdownBlockType.Code) - { - } - - /// <summary> - /// Gets or sets the source code to display. - /// </summary> - public string Text { get; set; } - - /// <summary> - /// Gets or sets the Language specified in prefix, e.g. ```c# (Github Style Parsing).<para/> - /// This does not guarantee that the Code Block has a language, or no language, some valid code might not have been prefixed, and this will still return null. <para/> - /// To ensure all Code is Highlighted (If desired), you might have to determine the language from the provided string, such as looking for key words. - /// </summary> - public string CodeLanguage { get; set; } - - /// <summary> - /// Parses a code block. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location of the first character in the block. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <param name="quoteDepth"> The current nesting level for block quoting. </param> - /// <param name="actualEnd"> Set to the end of the block when the return value is non-null. </param> - /// <returns> A parsed code block, or <c>null</c> if this is not a code block. </returns> - internal static CodeBlock Parse(string markdown, int start, int maxEnd, int quoteDepth, out int actualEnd) - { - StringBuilder code = null; - actualEnd = start; - bool insideCodeBlock = false; - string codeLanguage = string.Empty; - - /* - Two options here: - Either every line starts with a tab character or at least 4 spaces - Or the code block starts and ends with ``` - */ - - foreach (var lineInfo in Common.ParseLines(markdown, start, maxEnd, quoteDepth)) - { - int pos = lineInfo.StartOfLine; - if (pos < maxEnd && markdown[pos] == '`') - { - var backTickCount = 0; - while (pos < maxEnd && backTickCount < 3) - { - if (markdown[pos] == '`') - { - backTickCount++; - } - else - { - break; - } - - pos++; - } - - if (backTickCount == 3) - { - insideCodeBlock = !insideCodeBlock; - - if (!insideCodeBlock) - { - actualEnd = lineInfo.StartOfNextLine; - break; - } - else - { - // Collects the Programming Language from the end of the starting ticks. - while (pos < lineInfo.EndOfLine) - { - codeLanguage += markdown[pos]; - pos++; - } - } - } - } - - if (!insideCodeBlock) - { - // Add every line that starts with a tab character or at least 4 spaces. - if (pos < maxEnd && markdown[pos] == '\t') - { - pos++; - } - else - { - int spaceCount = 0; - while (pos < maxEnd && spaceCount < 4) - { - if (markdown[pos] == ' ') - { - spaceCount++; - } - else if (markdown[pos] == '\t') - { - spaceCount += 4; - } - else - { - break; - } - - pos++; - } - - if (spaceCount < 4) - { - // We found a line that doesn't start with a tab or 4 spaces. - // But don't end the code block until we find a non-blank line. - if (lineInfo.IsLineBlank == false) - { - break; - } - } - } - } - - // Separate each line of the code text. - if (code == null) - { - code = new StringBuilder(); - } - else - { - code.AppendLine(); - } - - if (lineInfo.IsLineBlank == false) - { - // Append the code text, excluding the first tab/4 spaces, and convert tab characters into spaces. - string lineText = markdown.Substring(pos, lineInfo.EndOfLine - pos); - int startOfLinePos = code.Length; - for (int i = 0; i < lineText.Length; i++) - { - char c = lineText[i]; - if (c == '\t') - { - code.Append(' ', 4 - ((code.Length - startOfLinePos) % 4)); - } - else - { - code.Append(c); - } - } - } - - // Update the end position. - actualEnd = lineInfo.StartOfNextLine; - } - - if (code == null) - { - // Not a valid code block. - actualEnd = start; - return null; - } - - // Blank lines should be trimmed from the start and end. - return new CodeBlock() - { - Text = code.ToString().Trim('\r', '\n'), - CodeLanguage = !string.IsNullOrWhiteSpace(codeLanguage) ? codeLanguage.Trim() : null - }; - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - return Text; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/HeaderBlock.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/HeaderBlock.cs deleted file mode 100644 index a4dd874fb..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/HeaderBlock.cs +++ /dev/null @@ -1,166 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Blocks - -namespace Notepads.Controls.Markdown -{ - using System; - using System.Collections.Generic; - - /// <summary> - /// Represents a heading. - /// <seealso href="https://spec.commonmark.org/0.29/#atx-headings">Single-Line Header CommonMark Spec</seealso> - /// <seealso href="https://spec.commonmark.org/0.29/#setext-headings">Two-Line Header CommonMark Spec</seealso> - /// </summary> - public class HeaderBlock : MarkdownBlock - { - /// <summary> - /// Initializes a new instance of the <see cref="HeaderBlock"/> class. - /// </summary> - public HeaderBlock() - : base(MarkdownBlockType.Header) - { - } - - private int _headerLevel; - - /// <summary> - /// Gets or sets the header level (1-6). 1 is the most important header, 6 is the least important. - /// </summary> - public int HeaderLevel - { - get => _headerLevel; - - set - { - if (value < 1 || value > 6) - { - throw new ArgumentOutOfRangeException("HeaderLevel", "The header level must be between 1 and 6 (inclusive)."); - } - - _headerLevel = value; - } - } - - /// <summary> - /// Gets or sets the contents of the block. - /// </summary> - public IList<MarkdownInline> Inlines { get; set; } - - /// <summary> - /// Parses a header that starts with a hash. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location of the first hash character. </param> - /// <param name="end"> The location of the end of the line. </param> - /// <returns> A parsed header block, or <c>null</c> if this is not a header. </returns> - internal static HeaderBlock ParseHashPrefixedHeader(string markdown, int start, int end) - { - // This type of header starts with one or more '#' characters, followed by the header - // text, optionally followed by any number of hash characters. - var result = new HeaderBlock(); - - // Figure out how many consecutive hash characters there are. - int pos = start; - while (pos < end && markdown[pos] == '#' && pos - start < 6) - { - pos++; - } - - result.HeaderLevel = pos - start; - if (result.HeaderLevel == 0) - { - return null; - } - - // Ignore any hashes at the end of the line. - while (pos < end && markdown[end - 1] == '#') - { - end--; - } - - // Parse the inline content. - result.Inlines = Common.ParseInlineChildren(markdown, pos, end); - return result; - } - - /// <summary> - /// Parses a two-line header. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="firstLineStart"> The location of the start of the first line. </param> - /// <param name="firstLineEnd"> The location of the end of the first line. </param> - /// <param name="secondLineStart"> The location of the start of the second line. </param> - /// <param name="secondLineEnd"> The location of the end of the second line. </param> - /// <returns> A parsed header block, or <c>null</c> if this is not a header. </returns> - internal static HeaderBlock ParseUnderlineStyleHeader(string markdown, int firstLineStart, int firstLineEnd, int secondLineStart, int secondLineEnd) - { - // This type of header starts with some text on the first line, followed by one or more - // underline characters ('=' or '-') on the second line. - // The second line can have whitespace after the underline characters, but not before - // or between each character. - - // Check the second line is valid. - if (secondLineEnd <= secondLineStart) - { - return null; - } - - // Figure out what the underline character is ('=' or '-'). - char underlineChar = markdown[secondLineStart]; - if (underlineChar != '=' && underlineChar != '-') - { - return null; - } - - // Read past consecutive underline characters. - int pos = secondLineStart + 1; - for (; pos < secondLineEnd; pos++) - { - char c = markdown[pos]; - if (c != underlineChar) - { - break; - } - - pos++; - } - - // The rest of the line must be whitespace. - for (; pos < secondLineEnd; pos++) - { - char c = markdown[pos]; - if (c != ' ' && c != '\t') - { - return null; - } - - pos++; - } - - var result = new HeaderBlock - { - HeaderLevel = underlineChar == '=' ? 1 : 2, - - // Parse the inline content. - Inlines = Common.ParseInlineChildren(markdown, firstLineStart, firstLineEnd) - }; - return result; - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - if (Inlines == null) - { - return base.ToString(); - } - - return string.Join(string.Empty, Inlines); - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/HorizontalRuleBlock.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/HorizontalRuleBlock.cs deleted file mode 100644 index 1dd9a35c6..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/HorizontalRuleBlock.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Blocks - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// Represents a horizontal line. - /// </summary> - public class HorizontalRuleBlock : MarkdownBlock - { - /// <summary> - /// Initializes a new instance of the <see cref="HorizontalRuleBlock"/> class. - /// </summary> - public HorizontalRuleBlock() - : base(MarkdownBlockType.HorizontalRule) - { - } - - /// <summary> - /// Parses a horizontal rule. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location of the start of the line. </param> - /// <param name="end"> The location of the end of the line. </param> - /// <returns> A parsed horizontal rule block, or <c>null</c> if this is not a horizontal rule. </returns> - internal static HorizontalRuleBlock Parse(string markdown, int start, int end) - { - // A horizontal rule is a line with at least 3 stars, optionally separated by spaces - // OR a line with at least 3 dashes, optionally separated by spaces - // OR a line with at least 3 underscores, optionally separated by spaces. - char hrChar = '\0'; - int hrCharCount = 0; - int pos = start; - while (pos < end) - { - char c = markdown[pos++]; - if (c == '*' || c == '-' || c == '_') - { - // All of the non-whitespace characters on the line must match. - if (hrCharCount > 0 && c != hrChar) - { - return null; - } - - hrChar = c; - hrCharCount++; - } - else if (c == '\n') - { - break; - } - else if (!ParseHelpers.IsMarkdownWhiteSpace(c)) - { - return null; - } - } - - // Hopefully there were at least 3 stars/dashes/underscores. - return hrCharCount >= 3 ? new HorizontalRuleBlock() : null; - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - return "---"; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/LinkReferenceBlock.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/LinkReferenceBlock.cs deleted file mode 100644 index 98c1bb402..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/LinkReferenceBlock.cs +++ /dev/null @@ -1,170 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Blocks - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// Represents the target of a reference ([ref][]). - /// </summary> - public class LinkReferenceBlock : MarkdownBlock - { - /// <summary> - /// Initializes a new instance of the <see cref="LinkReferenceBlock"/> class. - /// </summary> - public LinkReferenceBlock() - : base(MarkdownBlockType.LinkReference) - { - } - - /// <summary> - /// Gets or sets the reference ID. - /// </summary> - public string Id { get; set; } - - /// <summary> - /// Gets or sets the link URL. - /// </summary> - public string Url { get; set; } - - /// <summary> - /// Gets or sets a tooltip to display on hover. - /// </summary> - public string Tooltip { get; set; } - - /// <summary> - /// Attempts to parse a reference e.g. "[example]: http://www.reddit.com 'title'". - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="end"> The location to stop parsing. </param> - /// <returns> A parsed markdown link, or <c>null</c> if this is not a markdown link. </returns> - internal static LinkReferenceBlock Parse(string markdown, int start, int end) - { - // Expect a '[' character. - if (start >= end || markdown[start] != '[') - { - return null; - } - - // Find the ']' character - int pos = start + 1; - while (pos < end) - { - if (markdown[pos] == ']') - { - break; - } - - pos++; - } - - if (pos == end) - { - return null; - } - - // Extract the ID. - string id = markdown.Substring(start + 1, pos - (start + 1)); - - // Expect the ':' character. - pos++; - if (pos == end || markdown[pos] != ':') - { - return null; - } - - // Skip whitespace - pos++; - while (pos < end && ParseHelpers.IsMarkdownWhiteSpace(markdown[pos])) - { - pos++; - } - - if (pos == end) - { - return null; - } - - // Extract the URL. - int urlStart = pos; - while (pos < end && !ParseHelpers.IsMarkdownWhiteSpace(markdown[pos])) - { - pos++; - } - - string url = TextRunInline.ResolveEscapeSequences(markdown, urlStart, pos); - - // Ignore leading '<' and trailing '>'. - url = url.TrimStart('<').TrimEnd('>'); - - // Skip whitespace. - pos++; - while (pos < end && ParseHelpers.IsMarkdownWhiteSpace(markdown[pos])) - { - pos++; - } - - string tooltip = null; - if (pos < end) - { - // Extract the tooltip. - char tooltipEndChar; - switch (markdown[pos]) - { - case '(': - tooltipEndChar = ')'; - break; - - case '"': - case '\'': - tooltipEndChar = markdown[pos]; - break; - - default: - return null; - } - - pos++; - int tooltipStart = pos; - while (pos < end && markdown[pos] != tooltipEndChar) - { - pos++; - } - - if (pos == end) - { - return null; // No end character. - } - - tooltip = markdown.Substring(tooltipStart, pos - tooltipStart); - - // Check there isn't any trailing text. - pos++; - while (pos < end && ParseHelpers.IsMarkdownWhiteSpace(markdown[pos])) - { - pos++; - } - - if (pos < end) - { - return null; - } - } - - // We found something! - var result = new LinkReferenceBlock { Id = id, Url = url, Tooltip = tooltip }; - return result; - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - return $"[{Id}]: {Url} {Tooltip}"; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/List/ListItemBlock.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/List/ListItemBlock.cs deleted file mode 100644 index a65adc6b5..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/List/ListItemBlock.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Blocks/List - -namespace Notepads.Controls.Markdown -{ - using System.Collections.Generic; - - /// <summary> - /// This specifies the Content of the List element. - /// </summary> - public class ListItemBlock - { - /// <summary> - /// Gets or sets the contents of the list item. - /// </summary> - public IList<MarkdownBlock> Blocks { get; set; } - - internal ListItemBlock() - { - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/List/ListItemBuilder.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/List/ListItemBuilder.cs deleted file mode 100644 index 93c9fe928..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/List/ListItemBuilder.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Blocks/List - -namespace Notepads.Controls.Markdown -{ - using System.Text; - - internal class ListItemBuilder : MarkdownBlock - { - public StringBuilder Builder { get; } = new StringBuilder(); - - public ListItemBuilder() - : base(MarkdownBlockType.ListItemBuilder) - { - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/List/ListItemPreamble.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/List/ListItemPreamble.cs deleted file mode 100644 index cef7a13ed..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/List/ListItemPreamble.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Blocks/List - -namespace Notepads.Controls.Markdown -{ - internal class ListItemPreamble - { - public ListStyle Style { get; set; } - - public int ContentStartPos { get; set; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/List/NestedListInfo.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/List/NestedListInfo.cs deleted file mode 100644 index e1f88bab7..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/List/NestedListInfo.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Blocks/List - -namespace Notepads.Controls.Markdown -{ - internal class NestedListInfo - { - public ListBlock List { get; set; } - - // The number of spaces at the start of the line the list first appeared. - public int SpaceCount { get; set; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/ListBlock.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/ListBlock.cs deleted file mode 100644 index 241701c54..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/ListBlock.cs +++ /dev/null @@ -1,402 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Blocks - -namespace Notepads.Controls.Markdown -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Text; - using System.Text.RegularExpressions; - - /// <summary> - /// Represents a list, with each list item proceeded by either a number or a bullet. - /// </summary> - public class ListBlock : MarkdownBlock - { - /// <summary> - /// Initializes a new instance of the <see cref="ListBlock"/> class. - /// </summary> - public ListBlock() - : base(MarkdownBlockType.List) - { - } - - /// <summary> - /// Gets or sets the list items. - /// </summary> - public IList<ListItemBlock> Items { get; set; } - - /// <summary> - /// Gets or sets the style of the list, either numbered or bulleted. - /// </summary> - public ListStyle Style { get; set; } - - /// <summary> - /// Parses a list block. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location of the first character in the block. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <param name="quoteDepth"> The current nesting level for block quoting. </param> - /// <param name="actualEnd"> Set to the end of the block when the return value is non-null. </param> - /// <returns> A parsed list block, or <c>null</c> if this is not a list block. </returns> - internal static ListBlock Parse(string markdown, int start, int maxEnd, int quoteDepth, out int actualEnd) - { - var russianDolls = new List<NestedListInfo>(); - int russianDollIndex = -1; - bool previousLineWasBlank = false; - bool inCodeBlock = false; - ListItemBlock currentListItem = null; - actualEnd = start; - - foreach (var lineInfo in Common.ParseLines(markdown, start, maxEnd, quoteDepth)) - { - // Is this line blank? - if (lineInfo.IsLineBlank) - { - // The line is blank, which means the next line which contains text may end the list (or it may not...). - previousLineWasBlank = true; - } - else - { - // Does the line contain a list item? - ListItemPreamble listItemPreamble = null; - if (lineInfo.FirstNonWhitespaceChar - lineInfo.StartOfLine < (russianDollIndex + 2) * 4) - { - listItemPreamble = ParseItemPreamble(markdown, lineInfo.FirstNonWhitespaceChar, lineInfo.EndOfLine); - } - - if (listItemPreamble != null) - { - // Yes, this line contains a list item. - - // Determining the nesting level is done as follows: - // 1. If this is the first line, then the list is not nested. - // 2. If the number of spaces at the start of the line is equal to that of - // an existing list, then the nesting level is the same as that list. - // 3. Otherwise, if the number of spaces is 0-4, then the nesting level - // is one level deep. - // 4. Otherwise, if the number of spaces is 5-8, then the nesting level - // is two levels deep (but no deeper than one level more than the - // previous list item). - // 5. Etcetera. - ListBlock listToAddTo = null; - int spaceCount = lineInfo.FirstNonWhitespaceChar - lineInfo.StartOfLine; - russianDollIndex = russianDolls.FindIndex(rd => rd.SpaceCount == spaceCount); - if (russianDollIndex >= 0) - { - // Add the new list item to an existing list. - listToAddTo = russianDolls[russianDollIndex].List; - - // Don't add new list items to items higher up in the list. - russianDolls.RemoveRange(russianDollIndex + 1, russianDolls.Count - (russianDollIndex + 1)); - } - else - { - russianDollIndex = Math.Max(1, 1 + ((spaceCount - 1) / 4)); - if (russianDollIndex < russianDolls.Count) - { - // Add the new list item to an existing list. - listToAddTo = russianDolls[russianDollIndex].List; - - // Don't add new list items to items higher up in the list. - russianDolls.RemoveRange(russianDollIndex + 1, russianDolls.Count - (russianDollIndex + 1)); - } - else - { - // Create a new list. - listToAddTo = new ListBlock { Style = listItemPreamble.Style, Items = new List<ListItemBlock>() }; - if (russianDolls.Count > 0) - { - currentListItem.Blocks.Add(listToAddTo); - } - - russianDollIndex = russianDolls.Count; - russianDolls.Add(new NestedListInfo { List = listToAddTo, SpaceCount = spaceCount }); - } - } - - // Add a new list item. - currentListItem = new ListItemBlock() { Blocks = new List<MarkdownBlock>() }; - listToAddTo.Items.Add(currentListItem); - - // Add the rest of the line to the builder. - AppendTextToListItem(currentListItem, markdown, listItemPreamble.ContentStartPos, lineInfo.EndOfLine); - } - else - { - // No, this line contains text. - - // Is there even a list in progress? - if (currentListItem == null) - { - actualEnd = start; - return null; - } - - // This is the start of a new paragraph. - int spaceCount = lineInfo.FirstNonWhitespaceChar - lineInfo.StartOfLine; - if (spaceCount == 0) - { - break; - } - - russianDollIndex = Math.Min(russianDollIndex, (spaceCount - 1) / 4); - int lineStart = Math.Min(lineInfo.FirstNonWhitespaceChar, lineInfo.StartOfLine + ((russianDollIndex + 1) * 4)); - - // 0 spaces = end of the list. - // 1-4 spaces = first level. - // 5-8 spaces = second level, etc. - if (previousLineWasBlank) - { - ListBlock listToAddTo = russianDolls[russianDollIndex].List; - currentListItem = listToAddTo.Items[listToAddTo.Items.Count - 1]; - - ListItemBuilder builder; - - // Prevents new Block creation if still in a Code Block. - if (!inCodeBlock) - { - builder = new ListItemBuilder(); - currentListItem.Blocks.Add(builder); - } - else - { - // This can only ever be a ListItemBuilder, so it is not a null reference. - builder = currentListItem.Blocks.Last() as ListItemBuilder; - - // Make up for the escaped NewLines. - builder.Builder.AppendLine(); - builder.Builder.AppendLine(); - } - - AppendTextToListItem(currentListItem, markdown, lineStart, lineInfo.EndOfLine); - } - else - { - // Inline text. Ignores the 4 spaces that are used to continue the list. - AppendTextToListItem(currentListItem, markdown, lineStart, lineInfo.EndOfLine, true); - } - } - - // Check for Closing Code Blocks. - if (currentListItem.Blocks.Last() is ListItemBuilder currentBlock) - { - var blockmatchcount = Regex.Matches(currentBlock.Builder.ToString(), "```").Count; - if (blockmatchcount > 0 && blockmatchcount % 2 != 0) - { - inCodeBlock = true; - } - else - { - inCodeBlock = false; - } - } - - // The line was not blank. - previousLineWasBlank = false; - } - - // Go to the next line. - actualEnd = lineInfo.EndOfLine; - } - - var result = russianDolls[0].List; - ReplaceStringBuilders(result); - return result; - } - - /// <summary> - /// Parsing helper method. - /// </summary> - /// <returns>Returns a ListItemPreamble</returns> - private static ListItemPreamble ParseItemPreamble(string markdown, int start, int maxEnd) - { - // There are two types of lists. - // A numbered list starts with a number, then a period ('.'), then a space. - // A bulleted list starts with a star ('*'), dash ('-') or plus ('+'), then a period, then a space. - ListStyle style; - if (markdown[start] == '*' || markdown[start] == '-' || markdown[start] == '+') - { - style = ListStyle.Bulleted; - start++; - } - else if (markdown[start] >= '0' && markdown[start] <= '9') - { - style = ListStyle.Numbered; - start++; - - // Skip any other digits. - while (start < maxEnd) - { - char c = markdown[start]; - if (c < '0' || c > '9') - { - break; - } - - start++; - } - - // Next should be a period ('.'). - if (start == maxEnd || markdown[start] != '.') - { - return null; - } - - start++; - } - else - { - return null; - } - - // Next should be a space. - if (start == maxEnd || (markdown[start] != ' ' && markdown[start] != '\t')) - { - return null; - } - - start++; - - // This is a valid list item. - return new ListItemPreamble { Style = style, ContentStartPos = start }; - } - - /// <summary> - /// Parsing helper method. - /// </summary> - private static void AppendTextToListItem(ListItemBlock listItem, string markdown, int start, int end, bool newLine = false) - { - ListItemBuilder listItemBuilder = null; - if (listItem.Blocks.Count > 0) - { - listItemBuilder = listItem.Blocks[listItem.Blocks.Count - 1] as ListItemBuilder; - } - - if (listItemBuilder == null) - { - // Add a new block. - listItemBuilder = new ListItemBuilder(); - listItem.Blocks.Add(listItemBuilder); - } - - var builder = listItemBuilder.Builder; - if (builder.Length >= 2 && - ParseHelpers.IsMarkdownWhiteSpace(builder[builder.Length - 2]) && - ParseHelpers.IsMarkdownWhiteSpace(builder[builder.Length - 1])) - { - builder.Length -= 2; - builder.AppendLine(); - } - else if (builder.Length > 0) - { - builder.Append(' '); - } - - if (newLine) - { - builder.Append(Environment.NewLine); - } - - builder.Append(markdown.Substring(start, end - start)); - } - - /// <summary> - /// Parsing helper. - /// </summary> - /// <returns> <c>true</c> if any of the list items were parsed using the block parser. </returns> - private static bool ReplaceStringBuilders(ListBlock list) - { - bool usedBlockParser = false; - foreach (var listItem in list.Items) - { - // Use the inline parser if there is one paragraph, use the block parser otherwise. - var useBlockParser = listItem.Blocks.Count(block => block.Type == MarkdownBlockType.ListItemBuilder) > 1; - - // Recursively replace any child lists. - foreach (var block in listItem.Blocks) - { - if (block is ListBlock listBlock && ReplaceStringBuilders(listBlock)) - { - useBlockParser = true; - } - } - - // Parse the text content of the list items. - var newBlockList = new List<MarkdownBlock>(); - foreach (var block in listItem.Blocks) - { - if (block is ListItemBuilder) - { - var blockText = ((ListItemBuilder)block).Builder.ToString(); - if (useBlockParser) - { - // Parse the list item as a series of blocks. - newBlockList.AddRange(MarkdownDocument.Parse(blockText, 0, blockText.Length, quoteDepth: 0, actualEnd: out var actualEnd)); - usedBlockParser = true; - } - else - { - // Don't allow blocks. - var paragraph = new ParagraphBlock - { - Inlines = Common.ParseInlineChildren(blockText, 0, blockText.Length) - }; - newBlockList.Add(paragraph); - } - } - else - { - newBlockList.Add(block); - } - } - - listItem.Blocks = newBlockList; - } - - return usedBlockParser; - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - if (Items == null) - { - return base.ToString(); - } - - var result = new StringBuilder(); - for (int i = 0; i < Items.Count; i++) - { - if (result.Length > 0) - { - result.AppendLine(); - } - - switch (Style) - { - case ListStyle.Bulleted: - result.Append("* "); - break; - - case ListStyle.Numbered: - result.Append(i + 1); - result.Append("."); - break; - } - - result.Append(" "); - result.Append(string.Join("\r\n", Items[i].Blocks)); - } - - return result.ToString(); - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/ParagraphBlock.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/ParagraphBlock.cs deleted file mode 100644 index 310c84618..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/ParagraphBlock.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Blocks - -namespace Notepads.Controls.Markdown -{ - using System.Collections.Generic; - - /// <summary> - /// Represents a block of text that is displayed as a single paragraph. - /// </summary> - public class ParagraphBlock : MarkdownBlock - { - /// <summary> - /// Initializes a new instance of the <see cref="ParagraphBlock"/> class. - /// </summary> - public ParagraphBlock() - : base(MarkdownBlockType.Paragraph) - { - } - - /// <summary> - /// Gets or sets the contents of the block. - /// </summary> - public IList<MarkdownInline> Inlines { get; set; } - - /// <summary> - /// Parses paragraph text. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <returns> A parsed paragraph. </returns> - internal static ParagraphBlock Parse(string markdown) - { - return new ParagraphBlock { Inlines = Common.ParseInlineChildren(markdown, 0, markdown.Length) }; - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - if (Inlines == null) - { - return base.ToString(); - } - - return string.Join(string.Empty, Inlines); - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/QuoteBlock.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/QuoteBlock.cs deleted file mode 100644 index c541fbf8b..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/QuoteBlock.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Blocks - -namespace Notepads.Controls.Markdown -{ - using System.Collections.Generic; - - /// <summary> - /// Represents a block that is displayed using a quote style. Quotes are used to indicate - /// that the text originated elsewhere (e.g. a previous comment). - /// </summary> - public class QuoteBlock : MarkdownBlock - { - /// <summary> - /// Initializes a new instance of the <see cref="QuoteBlock"/> class. - /// </summary> - public QuoteBlock() - : base(MarkdownBlockType.Quote) - { - } - - /// <summary> - /// Gets or sets the contents of the block. - /// </summary> - public IList<MarkdownBlock> Blocks { get; set; } - - /// <summary> - /// Parses a quote block. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="startOfLine"> The location of the start of the line. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <param name="quoteDepth"> The current nesting level of quotes. </param> - /// <param name="actualEnd"> Set to the end of the block when the return value is non-null. </param> - /// <returns> A parsed quote block. </returns> - internal static QuoteBlock Parse(string markdown, int startOfLine, int maxEnd, int quoteDepth, out int actualEnd) - { - var result = new QuoteBlock - { - // Recursively call into the markdown block parser. - Blocks = MarkdownDocument.Parse(markdown, startOfLine, maxEnd, quoteDepth: quoteDepth + 1, actualEnd: out actualEnd) - }; - - return result; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/TableBlock.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/TableBlock.cs deleted file mode 100644 index ea73e1392..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/TableBlock.cs +++ /dev/null @@ -1,329 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Blocks - -namespace Notepads.Controls.Markdown -{ - using System; - using System.Collections.Generic; - - /// <summary> - /// Represents a block which contains tabular data. - /// </summary> - public class TableBlock : MarkdownBlock - { - /// <summary> - /// Initializes a new instance of the <see cref="TableBlock"/> class. - /// </summary> - public TableBlock() - : base(MarkdownBlockType.Table) - { - } - - /// <summary> - /// Gets or sets the table rows. - /// </summary> - public IList<TableRow> Rows { get; set; } - - /// <summary> - /// Gets or sets describes the columns in the table. Rows can have more or less cells than the number - /// of columns. Rows with fewer cells should be padded with empty cells. For rows with - /// more cells, the extra cells should be hidden. - /// </summary> - public IList<TableColumnDefinition> ColumnDefinitions { get; set; } - - /// <summary> - /// Parses a table block. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location of the first character in the block. </param> - /// <param name="endOfFirstLine"> The location of the end of the first line. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <param name="quoteDepth"> The current nesting level for block quoting. </param> - /// <param name="actualEnd"> Set to the end of the block when the return value is non-null. </param> - /// <returns> A parsed table block, or <c>null</c> if this is not a table block. </returns> - internal static TableBlock Parse(string markdown, int start, int endOfFirstLine, int maxEnd, int quoteDepth, out int actualEnd) - { - // A table is a line of text, with at least one vertical bar (|), followed by a line of - // of text that consists of alternating dashes (-) and vertical bars (|) and optionally - // vertical bars at the start and end. The second line must have at least as many - // interior vertical bars as there are interior vertical bars on the first line. - actualEnd = start; - - // First thing to do is to check if there is a vertical bar on the line. - var barSections = markdown.Substring(start, endOfFirstLine - start).Split('|'); - - var allBarsEscaped = true; - - // we can skip the last section, because there is no bar at the end of it - for (var i = 0; i < barSections.Length - 1; i++) - { - var barSection = barSections[i]; - if (!barSection.EndsWith("\\", StringComparison.Ordinal)) - { - allBarsEscaped = false; - break; - } - } - - if (allBarsEscaped) - { - return null; - } - - var rows = new List<TableRow>(); - - // Parse the first row. - var firstRow = new TableRow(); - start = firstRow.Parse(markdown, start, maxEnd, quoteDepth); - rows.Add(firstRow); - - // Parse the contents of the second row. - var secondRowContents = new List<string>(); - start = TableRow.ParseContents( - markdown, - start, - maxEnd, - quoteDepth, - requireVerticalBar: false, - contentParser: (start2, end2) => secondRowContents.Add(markdown.Substring(start2, end2 - start2))); - - // There must be at least as many columns in the second row as in the first row. - if (secondRowContents.Count < firstRow.Cells.Count) - { - return null; - } - - // Check each column definition. - // Note: excess columns past firstRowColumnCount are ignored and can contain anything. - var columnDefinitions = new List<TableColumnDefinition>(firstRow.Cells.Count); - for (int i = 0; i < firstRow.Cells.Count; i++) - { - var cellContent = secondRowContents[i]; - if (cellContent.Length == 0) - { - return null; - } - - // The first and last characters can be '-' or ':'. - if (cellContent[0] != ':' && cellContent[0] != '-') - { - return null; - } - - if (cellContent[cellContent.Length - 1] != ':' && cellContent[cellContent.Length - 1] != '-') - { - return null; - } - - // Every other character must be '-'. - for (int j = 1; j < cellContent.Length - 1; j++) - { - if (cellContent[j] != '-') - { - return null; - } - } - - // Record the alignment. - var columnDefinition = new TableColumnDefinition(); - if (cellContent.Length > 1 && cellContent[0] == ':' && cellContent[cellContent.Length - 1] == ':') - { - columnDefinition.Alignment = ColumnAlignment.Center; - } - else if (cellContent[0] == ':') - { - columnDefinition.Alignment = ColumnAlignment.Left; - } - else if (cellContent[cellContent.Length - 1] == ':') - { - columnDefinition.Alignment = ColumnAlignment.Right; - } - - columnDefinitions.Add(columnDefinition); - } - - // Parse additional rows. - while (start < maxEnd) - { - var row = new TableRow(); - start = row.Parse(markdown, start, maxEnd, quoteDepth); - if (row.Cells.Count == 0) - { - break; - } - - rows.Add(row); - } - - actualEnd = start; - return new TableBlock { ColumnDefinitions = columnDefinitions, Rows = rows }; - } - - /// <summary> - /// Describes a column in the markdown table. - /// </summary> - public class TableColumnDefinition - { - /// <summary> - /// Gets or sets the alignment of content in a table column. - /// </summary> - public ColumnAlignment Alignment { get; set; } - } - - /// <summary> - /// Represents a single row in the table. - /// </summary> - public class TableRow - { - /// <summary> - /// Gets or sets the table cells. - /// </summary> - public IList<TableCell> Cells { get; set; } - - /// <summary> - /// Parses the contents of the row, ignoring whitespace at the beginning and end of each cell. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="startingPos"> The position of the start of the row. </param> - /// <param name="maxEndingPos"> The maximum position of the end of the row </param> - /// <param name="quoteDepth"> The current nesting level for block quoting. </param> - /// <param name="requireVerticalBar"> Indicates whether the line must contain a vertical bar. </param> - /// <param name="contentParser"> Called for each cell. </param> - /// <returns> The position of the start of the next line. </returns> - internal static int ParseContents(string markdown, int startingPos, int maxEndingPos, int quoteDepth, bool requireVerticalBar, Action<int, int> contentParser) - { - // Skip quote characters. - int pos = Common.SkipQuoteCharacters(markdown, startingPos, maxEndingPos, quoteDepth); - - // If the line starts with a '|' character, skip it. - bool lineHasVerticalBar = false; - if (pos < maxEndingPos && markdown[pos] == '|') - { - lineHasVerticalBar = true; - pos++; - } - - while (pos < maxEndingPos) - { - // Ignore any whitespace at the start of the cell (except for a newline character). - while (pos < maxEndingPos && ParseHelpers.IsMarkdownWhiteSpace(markdown[pos]) && markdown[pos] != '\n' && markdown[pos] != '\r') - { - pos++; - } - - int startOfCellContent = pos; - - // Find the end of the cell. - bool endOfLineFound = true; - while (pos < maxEndingPos) - { - char c = markdown[pos]; - if (c == '|' && (pos == 0 || markdown[pos - 1] != '\\')) - { - lineHasVerticalBar = true; - endOfLineFound = false; - break; - } - - if (c == '\n') - { - break; - } - - if (c == '\r') - { - if (pos < maxEndingPos && markdown[pos + 1] == '\n') - { - pos++; // Swallow the complete linefeed. - } - - break; - } - - pos++; - } - - int endOfCell = pos; - - // If a vertical bar is required, and none was found, then exit early. - if (endOfLineFound && !lineHasVerticalBar && requireVerticalBar) - { - return startingPos; - } - - // Ignore any whitespace at the end of the cell. - if (endOfCell > startOfCellContent) - { - while (ParseHelpers.IsMarkdownWhiteSpace(markdown[pos - 1])) - { - pos--; - } - } - - int endOfCellContent = pos; - - if (endOfLineFound == false || endOfCellContent > startOfCellContent) - { - // Parse the contents of the cell. - contentParser(startOfCellContent, endOfCellContent); - } - - // End of input? - if (pos == maxEndingPos) - { - break; - } - - // Move to the next cell, or the next line. - pos = endOfCell + 1; - - // End of the line? - if (endOfLineFound) - { - break; - } - } - - return pos; - } - - /// <summary> - /// Called when this block type should parse out the goods. Given the markdown, a starting point, and a max ending point - /// the block should find the start of the block, find the end and parse out the middle. The end most of the time will not be - /// the max ending pos, but it sometimes can be. The function will return where it ended parsing the block in the markdown. - /// </summary> - /// <returns>the postiion parsed to</returns> - internal int Parse(string markdown, int startingPos, int maxEndingPos, int quoteDepth) - { - Cells = new List<TableCell>(); - return ParseContents( - markdown, - startingPos, - maxEndingPos, - quoteDepth, - requireVerticalBar: true, - contentParser: (startingPos2, maxEndingPos2) => - { - var cell = new TableCell - { - Inlines = Common.ParseInlineChildren(markdown, startingPos2, maxEndingPos2) - }; - Cells.Add(cell); - }); - } - } - - /// <summary> - /// Represents a cell in the table. - /// </summary> - public class TableCell - { - /// <summary> - /// Gets or sets the cell contents. - /// </summary> - public IList<MarkdownInline> Inlines { get; set; } - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/YamlHeaderBlock.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/YamlHeaderBlock.cs deleted file mode 100644 index d4e979033..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Blocks/YamlHeaderBlock.cs +++ /dev/null @@ -1,164 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Blocks - -namespace Notepads.Controls.Markdown -{ - using System; - using System.Collections.Generic; - - /// <summary> - /// Yaml Header. use for blog. - /// e.g. - /// --- - /// title: something - /// tag: something - /// --- - /// </summary> - public class YamlHeaderBlock : MarkdownBlock - { - /// <summary> - /// Initializes a new instance of the <see cref="YamlHeaderBlock"/> class. - /// </summary> - public YamlHeaderBlock() - : base(MarkdownBlockType.YamlHeader) - { - } - - /// <summary> - /// Gets or sets yaml header properties - /// </summary> - public Dictionary<string, string> Children { get; set; } - - /// <summary> - /// Parse yaml header - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location of the first hash character. </param> - /// <param name="end"> The location of the end of the line. </param> - /// <param name="realEndIndex"> The location of the actual end of the aprse. </param> - /// <returns>Parsed <see cref="YamlHeaderBlock"/> class</returns> - internal static YamlHeaderBlock Parse(string markdown, int start, int end, out int realEndIndex) - { - // As yaml header, must be start a line with "---" - // and end with a line "---" - realEndIndex = start; - int lineStart = start; - if (end - start < 3) - { - return null; - } - - if (lineStart != 0 || markdown.Substring(start, 3) != "---") - { - return null; - } - - int startUnderlineIndex = Common.FindNextSingleNewLine(markdown, lineStart, end, out int startOfNextLine); - if (startUnderlineIndex - lineStart != 3) - { - return null; - } - - bool lockedFinalUnderline = false; - - // if current line not contain the ": ", check it is end of parse, if not, exit - // if next line is the end, exit - int pos = startOfNextLine; - List<string> elements = new List<string>(); - while (pos < end) - { - int nextUnderLineIndex = Common.FindNextSingleNewLine(markdown, pos, end, out startOfNextLine); - bool haveSeparator = markdown.Substring(pos, nextUnderLineIndex - pos).Contains(": ", StringComparison.Ordinal); - if (haveSeparator) - { - elements.Add(markdown.Substring(pos, nextUnderLineIndex - pos)); - } - else if (end - pos >= 3 && markdown.Substring(pos, 3) == "---") - { - lockedFinalUnderline = true; - realEndIndex = pos + 3; - break; - } - else if (startOfNextLine == pos + 1) - { - pos = startOfNextLine; - continue; - } - else - { - return null; - } - - pos = startOfNextLine; - } - - // if not have the end, return - if (!lockedFinalUnderline) - { - return null; - } - - // parse yaml header properties - if (elements.Count < 1) - { - return null; - } - - var result = new YamlHeaderBlock - { - Children = new Dictionary<string, string>() - }; - foreach (var item in elements) - { - string[] splits = item.Split(new string[] { ": " }, StringSplitOptions.None); - if (splits.Length < 2) - { - continue; - } - else - { - string key = splits[0]; - string value = splits[1]; - if (key.Trim().Length == 0) - { - continue; - } - - value = string.IsNullOrEmpty(value.Trim()) ? string.Empty : value; - result.Children.Add(key, value); - } - } - - if (result.Children == null) - { - return null; - } - - return result; - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - if (Children == null) - { - return base.ToString(); - } - else - { - string result = string.Empty; - foreach (KeyValuePair<string, string> item in Children) - { - result += item.Key + ": " + item.Value + "\n"; - } - - return result.TrimEnd('\n'); - } - } - } -} diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Core/IParser.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Core/IParser.cs deleted file mode 100644 index c43875485..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Core/IParser.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Parsers/Core - -namespace Notepads.Controls.Markdown -{ - using System.Collections.Generic; - - /// <summary> - /// Parser interface. - /// </summary> - /// <typeparam name="T">Type to parse into.</typeparam> - public interface IParser<out T> - where T : SchemaBase - { - /// <summary> - /// Parse method which all classes must implement. - /// </summary> - /// <param name="data">Data to parse.</param> - /// <returns>Strong typed parsed data.</returns> - IEnumerable<T> Parse(string data); - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Core/ParseHelpers.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Core/ParseHelpers.cs deleted file mode 100644 index 5c9e63f0a..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Core/ParseHelpers.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Parsers/Core - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// This class offers helpers for Parsing. - /// </summary> - public static class ParseHelpers - { - /// <summary> - /// Determines if a Markdown string is blank or comprised entirely of whitespace characters. - /// </summary> - /// <returns>true if blank or white space</returns> - public static bool IsMarkdownBlankOrWhiteSpace(string str) - { - for (int i = 0; i < str.Length; i++) - { - if (!IsMarkdownWhiteSpace(str[i])) - { - return false; - } - } - - return true; - } - - /// <summary> - /// Determines if a character is a Markdown whitespace character. - /// </summary> - /// <returns>true if is white space</returns> - public static bool IsMarkdownWhiteSpace(char c) - { - return c == ' ' || c == '\t' || c == '\r' || c == '\n'; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Core/SchemaBase.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Core/SchemaBase.cs deleted file mode 100644 index 84a3baade..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Core/SchemaBase.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Parsers/Core - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// Strong typed schema base class. - /// </summary> - public abstract class SchemaBase - { - /// <summary> - /// Gets or sets identifier for strong typed record. - /// </summary> - public string InternalID { get; set; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Core/StringValueAttribute.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Core/StringValueAttribute.cs deleted file mode 100644 index 766dfc0b5..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Core/StringValueAttribute.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Parsers/Core - -namespace Notepads.Controls.Markdown -{ - using System; - - /// <summary> - /// The StringValue attribute is used as a helper to decorate enum values with string representations. - /// </summary> - [AttributeUsage(AttributeTargets.Field)] - public sealed class StringValueAttribute : Attribute - { - /// <summary> - /// Initializes a new instance of the <see cref="StringValueAttribute"/> class. - /// Constructor accepting string value. - /// </summary> - /// <param name="value">String value</param> - public StringValueAttribute(string value) - { - Value = value; - } - - /// <summary> - /// Gets property for string value. - /// </summary> - public string Value { get; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/ColumnAlignment.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/ColumnAlignment.cs deleted file mode 100644 index 216a590ed..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/ColumnAlignment.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Enums - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// The alignment of content in a table column. - /// </summary> - public enum ColumnAlignment - { - /// <summary> - /// The alignment was not specified. - /// </summary> - Unspecified, - - /// <summary> - /// Content should be left aligned. - /// </summary> - Left, - - /// <summary> - /// Content should be right aligned. - /// </summary> - Right, - - /// <summary> - /// Content should be centered. - /// </summary> - Center, - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/HyperlinkType.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/HyperlinkType.cs deleted file mode 100644 index de1ce31d5..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/HyperlinkType.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Enums - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// Specifies the type of Hyperlink that is used. - /// </summary> - public enum HyperlinkType - { - /// <summary> - /// A hyperlink surrounded by angle brackets (e.g. "http://www.reddit.com"). - /// </summary> - BracketedUrl, - - /// <summary> - /// A fully qualified hyperlink (e.g. "http://www.reddit.com"). - /// </summary> - FullUrl, - - /// <summary> - /// A URL without a scheme (e.g. "www.reddit.com"). - /// </summary> - PartialUrl, - - /// <summary> - /// An email address (e.g. "test@reddit.com"). - /// </summary> - Email, - - /// <summary> - /// A subreddit link (e.g. "/r/news"). - /// </summary> - Subreddit, - - /// <summary> - /// A user link (e.g. "/u/quinbd"). - /// </summary> - User, - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/InlineParseMethod.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/InlineParseMethod.cs deleted file mode 100644 index d3c7fd8cb..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/InlineParseMethod.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Enums - -namespace Notepads.Controls.Markdown -{ - internal enum InlineParseMethod - { - /// <summary> - /// A Comment text - /// </summary> - Comment, - - /// <summary> - /// A Link Reference - /// </summary> - LinkReference, - - /// <summary> - /// A bold element - /// </summary> - Bold, - - /// <summary> - /// An bold and italic block - /// </summary> - BoldItalic, - - /// <summary> - /// A code element - /// </summary> - Code, - - /// <summary> - /// An italic block - /// </summary> - Italic, - - /// <summary> - /// A link block - /// </summary> - MarkdownLink, - - /// <summary> - /// An angle bracket link. - /// </summary> - AngleBracketLink, - - /// <summary> - /// A url block - /// </summary> - Url, - - /// <summary> - /// A reddit style link - /// </summary> - RedditLink, - - /// <summary> - /// An in line text link - /// </summary> - PartialLink, - - /// <summary> - /// An email element - /// </summary> - Email, - - /// <summary> - /// strike through element - /// </summary> - Strikethrough, - - /// <summary> - /// Super script element. - /// </summary> - Superscript, - - /// <summary> - /// Sub script element. - /// </summary> - Subscript, - - /// <summary> - /// Image element. - /// </summary> - Image, - - /// <summary> - /// Emoji element. - /// </summary> - Emoji - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/ListStyle.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/ListStyle.cs deleted file mode 100644 index 9bbaf1156..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/ListStyle.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Enums - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// This specifies the type of style the List will be. - /// </summary> - public enum ListStyle - { - /// <summary> - /// A list with bullets - /// </summary> - Bulleted, - - /// <summary> - /// A numbered list - /// </summary> - Numbered, - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/MarkdownBlockType.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/MarkdownBlockType.cs deleted file mode 100644 index 439fa9360..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/MarkdownBlockType.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Enums - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// Determines the type of Block the Block element is. - /// </summary> - public enum MarkdownBlockType - { - /// <summary> - /// The root element - /// </summary> - Root, - - /// <summary> - /// A paragraph element. - /// </summary> - Paragraph, - - /// <summary> - /// A quote block - /// </summary> - Quote, - - /// <summary> - /// A code block - /// </summary> - Code, - - /// <summary> - /// A header block - /// </summary> - Header, - - /// <summary> - /// A list block - /// </summary> - List, - - /// <summary> - /// A list item block - /// </summary> - ListItemBuilder, - - /// <summary> - /// a horizontal rule block - /// </summary> - HorizontalRule, - - /// <summary> - /// A table block - /// </summary> - Table, - - /// <summary> - /// A link block - /// </summary> - LinkReference, - - /// <summary> - /// A Yaml header block - /// </summary> - YamlHeader - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/MarkdownInlineType.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/MarkdownInlineType.cs deleted file mode 100644 index ee2427e9f..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Enums/MarkdownInlineType.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Enums - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// Determines the type of Inline the Inline Element is. - /// </summary> - public enum MarkdownInlineType - { - /// <summary> - /// A comment - /// </summary> - Comment, - - /// <summary> - /// A text run - /// </summary> - TextRun, - - /// <summary> - /// A bold run - /// </summary> - Bold, - - /// <summary> - /// An italic run - /// </summary> - Italic, - - /// <summary> - /// A link in markdown syntax - /// </summary> - MarkdownLink, - - /// <summary> - /// A raw hyper link - /// </summary> - RawHyperlink, - - /// <summary> - /// A raw subreddit link - /// </summary> - RawSubreddit, - - /// <summary> - /// A strike through run - /// </summary> - Strikethrough, - - /// <summary> - /// A superscript run - /// </summary> - Superscript, - - /// <summary> - /// A subscript run - /// </summary> - Subscript, - - /// <summary> - /// A code run - /// </summary> - Code, - - /// <summary> - /// An image - /// </summary> - Image, - - /// <summary> - /// Emoji - /// </summary> - Emoji, - - /// <summary> - /// Link Reference - /// </summary> - LinkReference - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/Common.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/Common.cs deleted file mode 100644 index 04afb131b..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/Common.cs +++ /dev/null @@ -1,535 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Helpers - -namespace Notepads.Controls.Markdown -{ - using System; - using System.Collections.Generic; - using System.Linq; - - /// <summary> - /// Helpers for Markdown. - /// </summary> - internal class Common - { - private static readonly List<InlineTripCharHelper> _triggerList = new List<InlineTripCharHelper>(); - private static readonly char[] _tripCharacters; - - static Common() - { - BoldItalicTextInline.AddTripChars(_triggerList); - BoldTextInline.AddTripChars(_triggerList); - ItalicTextInline.AddTripChars(_triggerList); - MarkdownLinkInline.AddTripChars(_triggerList); - HyperlinkInline.AddTripChars(_triggerList); - CommentInline.AddTripChars(_triggerList); - StrikethroughTextInline.AddTripChars(_triggerList); - SuperscriptTextInline.AddTripChars(_triggerList); - SubscriptTextInline.AddTripChars(_triggerList); - CodeInline.AddTripChars(_triggerList); - ImageInline.AddTripChars(_triggerList); - EmojiInline.AddTripChars(_triggerList); - LinkAnchorInline.AddTripChars(_triggerList); - - // Create an array of characters to search against using IndexOfAny. - _tripCharacters = _triggerList.Select(trigger => trigger.FirstChar).Distinct().ToArray(); - } - - /// <summary> - /// This function can be called by any element parsing. Given a start and stopping point this will - /// parse all found elements out of the range. - /// </summary> - /// <returns> A list of parsed inlines. </returns> - public static List<MarkdownInline> ParseInlineChildren(string markdown, int startingPos, int maxEndingPos, bool ignoreLinks = false) - { - int currentParsePosition = startingPos; - - var inlines = new List<MarkdownInline>(); - while (currentParsePosition < maxEndingPos) - { - // Find the next inline element. - var parseResult = FindNextInlineElement(markdown, currentParsePosition, maxEndingPos, ignoreLinks); - - // If the element we found doesn't start at the position we are looking for there - // is text between the element and the start of the parsed element. We need to wrap - // it into a text run. - if (parseResult.Start != currentParsePosition) - { - var textRun = TextRunInline.Parse(markdown, currentParsePosition, parseResult.Start); - inlines.Add(textRun); - } - - // Add the parsed element. - inlines.Add(parseResult.ParsedElement); - - // Update the current position. - currentParsePosition = parseResult.End; - } - - return inlines; - } - - /// <summary> - /// Finds the next inline element by matching trip chars and verifying the match. - /// </summary> - /// <param name="markdown"> The markdown text to parse. </param> - /// <param name="start"> The position to start parsing. </param> - /// <param name="end"> The position to stop parsing. </param> - /// <param name="ignoreLinks"> Indicates whether to parse links. </param> - /// <returns>Returns the next element</returns> - private static InlineParseResult FindNextInlineElement(string markdown, int start, int end, bool ignoreLinks) - { - // Search for the next inline sequence. - for (int pos = start; pos < end; pos++) - { - // IndexOfAny should be the fastest way to skip characters we don't care about. - pos = markdown.IndexOfAny(_tripCharacters, pos, end - pos); - if (pos < 0) - { - break; - } - - // Find the trigger(s) that matched. - char currentChar = markdown[pos]; - foreach (InlineTripCharHelper currentTripChar in _triggerList) - { - // Check if our current char matches the suffix char. - if (currentChar == currentTripChar.FirstChar) - { - // Don't match if the previous character was a backslash. - if (pos > start && markdown[pos - 1] == '\\') - { - continue; - } - - // If we are here we have a possible match. Call into the inline class to verify. - InlineParseResult parseResult = null; - switch (currentTripChar.Method) - { - case InlineParseMethod.BoldItalic: - parseResult = BoldItalicTextInline.Parse(markdown, pos, end); - break; - - case InlineParseMethod.Comment: - parseResult = CommentInline.Parse(markdown, pos, end); - break; - - case InlineParseMethod.LinkReference: - parseResult = LinkAnchorInline.Parse(markdown, pos, end); - break; - - case InlineParseMethod.Bold: - parseResult = BoldTextInline.Parse(markdown, pos, end); - break; - - case InlineParseMethod.Italic: - parseResult = ItalicTextInline.Parse(markdown, pos, end); - break; - - case InlineParseMethod.MarkdownLink: - if (!ignoreLinks) - { - parseResult = MarkdownLinkInline.Parse(markdown, pos, end); - } - - break; - - case InlineParseMethod.AngleBracketLink: - if (!ignoreLinks) - { - parseResult = HyperlinkInline.ParseAngleBracketLink(markdown, pos, end); - } - - break; - - case InlineParseMethod.Url: - if (!ignoreLinks) - { - parseResult = HyperlinkInline.ParseUrl(markdown, pos, end); - } - - break; - - case InlineParseMethod.RedditLink: - if (!ignoreLinks) - { - parseResult = HyperlinkInline.ParseRedditLink(markdown, pos, end); - } - - break; - - case InlineParseMethod.PartialLink: - if (!ignoreLinks) - { - parseResult = HyperlinkInline.ParsePartialLink(markdown, pos, end); - } - - break; - - case InlineParseMethod.Email: - if (!ignoreLinks) - { - parseResult = HyperlinkInline.ParseEmailAddress(markdown, start, pos, end); - } - - break; - - case InlineParseMethod.Strikethrough: - parseResult = StrikethroughTextInline.Parse(markdown, pos, end); - break; - - case InlineParseMethod.Superscript: - parseResult = SuperscriptTextInline.Parse(markdown, pos, end); - break; - - case InlineParseMethod.Subscript: - parseResult = SubscriptTextInline.Parse(markdown, pos, end); - break; - - case InlineParseMethod.Code: - parseResult = CodeInline.Parse(markdown, pos, end); - break; - - case InlineParseMethod.Image: - parseResult = ImageInline.Parse(markdown, pos, end); - break; - - case InlineParseMethod.Emoji: - parseResult = EmojiInline.Parse(markdown, pos, end); - break; - } - - if (parseResult != null) - { - return parseResult; - } - } - } - } - - // If we didn't find any elements we have a normal text block. - // Let us consume the entire range. - return new InlineParseResult(TextRunInline.Parse(markdown, start, end), start, end); - } - - /// <summary> - /// Returns the next \n or \r\n in the markdown. - /// </summary> - /// <returns>the next single line</returns> - public static int FindNextSingleNewLine(string markdown, int startingPos, int endingPos, out int startOfNextLine) - { - // A line can end with CRLF (\r\n) or just LF (\n). - int lineFeedPos = markdown.IndexOf('\n', startingPos); - if (lineFeedPos == -1) - { - // Trying with /r now - lineFeedPos = markdown.IndexOf('\r', startingPos); - if (lineFeedPos == -1) - { - startOfNextLine = endingPos; - return endingPos; - } - } - - startOfNextLine = lineFeedPos + 1; - - // Check if it was a CRLF. - if (lineFeedPos > startingPos && markdown[lineFeedPos - 1] == '\r') - { - return lineFeedPos - 1; - } - - return lineFeedPos; - } - - /// <summary> - /// Helper function for index of with a start and an ending. - /// </summary> - /// <returns>Pos of the searched for item</returns> - public static int IndexOf(string markdown, string search, int startingPos, int endingPos, bool reverseSearch = false) - { - // Check the ending isn't out of bounds. - if (endingPos > markdown.Length) - { - endingPos = markdown.Length; - DebuggingReporter.ReportCriticalError("IndexOf endingPos > string length"); - } - - // Figure out how long to go - int count = endingPos - startingPos; - if (count < 0) - { - return -1; - } - - // Make sure we don't go too far. - int remainingCount = markdown.Length - startingPos; - if (count > remainingCount) - { - DebuggingReporter.ReportCriticalError("IndexOf count > remaing count"); - count = remainingCount; - } - - // Check the ending. Since we use inclusive ranges we need to -1 from this for - // reverses searches. - if (reverseSearch && endingPos > 0) - { - endingPos -= 1; - } - - return reverseSearch ? markdown.LastIndexOf(search, endingPos, count, StringComparison.OrdinalIgnoreCase) : markdown.IndexOf(search, startingPos, count, StringComparison.OrdinalIgnoreCase); - } - - /// <summary> - /// Helper function for index of with a start and an ending. - /// </summary> - /// <returns>Pos of the searched for item</returns> - public static int IndexOf(string markdown, char search, int startingPos, int endingPos, bool reverseSearch = false) - { - // Check the ending isn't out of bounds. - if (endingPos > markdown.Length) - { - endingPos = markdown.Length; - DebuggingReporter.ReportCriticalError("IndexOf endingPos > string length"); - } - - // Figure out how long to go - int count = endingPos - startingPos; - if (count < 0) - { - return -1; - } - - // Make sure we don't go too far. - int remainingCount = markdown.Length - startingPos; - if (count > remainingCount) - { - DebuggingReporter.ReportCriticalError("IndexOf count > remaing count"); - count = remainingCount; - } - - // Check the ending. Since we use inclusive ranges we need to -1 from this for - // reverses searches. - if (reverseSearch && endingPos > 0) - { - endingPos -= 1; - } - - return reverseSearch ? markdown.LastIndexOf(search, endingPos, count) : markdown.IndexOf(search, startingPos, count); - } - - /// <summary> - /// Finds the next whitespace in a range. - /// </summary> - /// <returns>pos of the white space</returns> - public static int FindNextWhiteSpace(string markdown, int startingPos, int endingPos, bool ifNotFoundReturnLength) - { - int currentPos = startingPos; - while (currentPos < markdown.Length && currentPos < endingPos) - { - if (char.IsWhiteSpace(markdown[currentPos])) - { - return currentPos; - } - - currentPos++; - } - - return ifNotFoundReturnLength ? endingPos : -1; - } - - /// <summary> - /// Parses lines. - /// </summary> - /// <returns>LineInfo</returns> - public static IEnumerable<LineInfo> ParseLines(string markdown, int start, int end, int quoteDepth) - { - int pos = start; - bool lineStartsNewParagraph = true; - - while (pos < end) - { - int startOfLine = pos; - int expectedQuotesRemaining = quoteDepth; - int nonSpacePos = pos; - char nonSpaceChar = '\0'; - while (true) - { - // Find the next non-space char. - while (nonSpacePos < end) - { - char c = markdown[nonSpacePos]; - if (c == '\r' || c == '\n') - { - // The line is either entirely whitespace, or is empty. - break; - } - - if (c != ' ' && c != '\t') - { - // The line has content. - nonSpaceChar = c; - break; - } - - nonSpacePos++; - } - - // When parsing blocks in a blockquote context, we need to count the number of - // quote characters ('>'). If there are less than expected AND this is the - // start of a new paragraph, then stop parsing. - if (expectedQuotesRemaining == 0) - { - break; - } - - if (nonSpaceChar == '>') - { - // Expected block quote characters should be ignored. - expectedQuotesRemaining--; - nonSpacePos++; - nonSpaceChar = '\0'; - startOfLine = nonSpacePos; - - // Ignore the first space after the quote character, if there is one. - if (startOfLine < end && markdown[startOfLine] == ' ') - { - startOfLine++; - nonSpacePos++; - } - } - else - { - // There were less block quote characters than expected. - // But it doesn't matter if this is not the start of a new paragraph. - if (!lineStartsNewParagraph || nonSpaceChar == '\0') - { - break; - } - - // This must be the end of the blockquote. End the current paragraph, if any. - yield break; - } - } - - // Find the end of the current line. - int endOfLine = FindNextSingleNewLine(markdown, nonSpacePos, end, out int startOfNextLine); - - // Return the line info to the caller. - yield return new LineInfo - { - StartOfLine = startOfLine, - FirstNonWhitespaceChar = nonSpacePos, - EndOfLine = endOfLine, - StartOfNextLine = startOfNextLine, - }; - - if (nonSpaceChar == '\0') - { - // The line is empty or nothing but whitespace. - lineStartsNewParagraph = true; - } - - // Repeat. - pos = startOfNextLine; - } - } - - /// <summary> - /// Skips a certain number of quote characters (>). - /// </summary> - /// <returns>Skip Quote Chars</returns> - public static int SkipQuoteCharacters(string markdown, int start, int end, int quoteDepth) - { - if (quoteDepth == 0) - { - return start; - } - - int startOfLine = start; - int nonSpacePos = start; - char nonSpaceChar = '\0'; - - while (true) - { - // Find the next non-space char. - while (nonSpacePos < end) - { - char c = markdown[nonSpacePos]; - if (c == '\r' || c == '\n') - { - // The line is either entirely whitespace, or is empty. - break; - } - - if (c != ' ' && c != '\t') - { - // The line has content. - nonSpaceChar = c; - break; - } - - nonSpacePos++; - } - - // When parsing blocks in a blockquote context, we need to count the number of - // quote characters ('>'). If there are less than expected AND this is the - // start of a new paragraph, then stop parsing. - if (quoteDepth == 0) - { - break; - } - - if (nonSpaceChar == '>') - { - // Expected block quote characters should be ignored. - quoteDepth--; - nonSpacePos++; - nonSpaceChar = '\0'; - startOfLine = nonSpacePos; - - // Ignore the first space after the quote character, if there is one. - if (startOfLine < end && markdown[startOfLine] == ' ') - { - startOfLine++; - nonSpacePos++; - } - } - else - { - // There were less block quote characters than expected. - break; - } - } - - return startOfLine; - } - - /// <summary> - /// Checks if the given URL is allowed in a markdown link. - /// </summary> - /// <param name="url"> The URL to check. </param> - /// <returns> <c>true</c> if the URL is valid; <c>false</c> otherwise. </returns> - public static bool IsUrlValid(string url) - { - // URLs can be relative. - if (!Uri.TryCreate(url, UriKind.Absolute, out Uri result)) - { - return true; - } - - // Check the scheme is allowed. - foreach (var scheme in MarkdownDocument.KnownSchemes) - { - if (result.Scheme.Equals(scheme, StringComparison.Ordinal)) - { - return true; - } - } - - return false; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/DebuggingReporter.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/DebuggingReporter.cs deleted file mode 100644 index 671717452..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/DebuggingReporter.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Helpers - -namespace Notepads.Controls.Markdown -{ - using System.Diagnostics; - - /// <summary> - /// Reports an error during debugging. - /// </summary> - internal class DebuggingReporter - { - /// <summary> - /// Reports a critical error. - /// </summary> - public static void ReportCriticalError(string errorText) - { - Debug.WriteLine(errorText); - if (Debugger.IsAttached) - { - Debugger.Break(); - } - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/InlineParseResult.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/InlineParseResult.cs deleted file mode 100644 index 1a799ddee..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/InlineParseResult.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Helpers - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// Represents the result of parsing an inline element. - /// </summary> - internal class InlineParseResult - { - public InlineParseResult(MarkdownInline parsedElement, int start, int end) - { - ParsedElement = parsedElement; - Start = start; - End = end; - } - - /// <summary> - /// Gets the element that was parsed (can be <c>null</c>). - /// </summary> - public MarkdownInline ParsedElement { get; } - - /// <summary> - /// Gets the position of the first character in the parsed element. - /// </summary> - public int Start { get; } - - /// <summary> - /// Gets the position of the character after the last character in the parsed element. - /// </summary> - public int End { get; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/InlineTripCharHelper.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/InlineTripCharHelper.cs deleted file mode 100644 index 3aff1f7bb..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/InlineTripCharHelper.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Helpers - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// A helper class for the trip chars. This is an optimization. If we ask each class to go - /// through the rage and look for itself we end up looping through the range n times, once - /// for each inline. This class represent a character that an inline needs to have a - /// possible match. We will go through the range once and look for everyone's trip chars, - /// and if they can make a match from the trip char then we will commit to them. - /// </summary> - internal class InlineTripCharHelper - { - // Note! Everything in first char and suffix should be lower case! - public char FirstChar { get; set; } - - public InlineParseMethod Method { get; set; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/LineInfo.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/LineInfo.cs deleted file mode 100644 index 914250bc6..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Helpers/LineInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Helpers - -namespace Notepads.Controls.Markdown -{ - internal class LineInfo - { - public int StartOfLine { get; set; } - - public int FirstNonWhitespaceChar { get; set; } - - public int EndOfLine { get; set; } - - public bool IsLineBlank => FirstNonWhitespaceChar == EndOfLine; - - public int StartOfNextLine { get; set; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/BoldItalicTextInline.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/BoldItalicTextInline.cs deleted file mode 100644 index 2937346e2..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/BoldItalicTextInline.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - using System.Collections.Generic; - - /// <summary> - /// Represents a span containing bold italic text. - /// </summary> - internal class BoldItalicTextInline : MarkdownInline, IInlineContainer - { - /// <summary> - /// Initializes a new instance of the <see cref="BoldItalicTextInline"/> class. - /// </summary> - public BoldItalicTextInline() - : base(MarkdownInlineType.Bold) - { - } - - /// <summary> - /// Gets or sets the contents of the inline. - /// </summary> - public IList<MarkdownInline> Inlines { get; set; } - - /// <summary> - /// Returns the chars that if found means we might have a match. - /// </summary> - internal static void AddTripChars(List<InlineTripCharHelper> tripCharHelpers) - { - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '*', Method = InlineParseMethod.BoldItalic }); - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '_', Method = InlineParseMethod.BoldItalic }); - } - - /// <summary> - /// Attempts to parse a bold text span. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <returns> A parsed bold text span, or <c>null</c> if this is not a bold text span. </returns> - internal static InlineParseResult Parse(string markdown, int start, int maxEnd) - { - if (start >= maxEnd - 1) - { - return null; - } - - if (markdown == null || markdown.Length < 6 || start + 6 >= maxEnd) - { - return null; - } - - // Check the start sequence. - string startSequence = markdown.Substring(start, 3); - if (startSequence != "***" && startSequence != "___") - { - return null; - } - - // Find the end of the span. The end sequence (either '***' or '___') must be the same - // as the start sequence. - var innerStart = start + 3; - int innerEnd = Common.IndexOf(markdown, startSequence, innerStart, maxEnd); - if (innerEnd == -1) - { - return null; - } - - // The span must contain at least one character. - if (innerStart == innerEnd) - { - return null; - } - - // The first character inside the span must NOT be a space. - if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerStart])) - { - return null; - } - - // The last character inside the span must NOT be a space. - if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerEnd - 1])) - { - return null; - } - - // We found something! - var bold = new BoldTextInline - { - Inlines = new List<MarkdownInline> - { - new ItalicTextInline - { - Inlines = Common.ParseInlineChildren(markdown, innerStart, innerEnd) - } - } - }; - return new InlineParseResult(bold, start, innerEnd + 3); - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - if (Inlines == null) - { - return base.ToString(); - } - - return "***" + string.Join(string.Empty, Inlines) + "***"; - } - } -} diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/BoldTextInline.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/BoldTextInline.cs deleted file mode 100644 index 314d6d2bc..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/BoldTextInline.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - using System.Collections.Generic; - - /// <summary> - /// Represents a span that contains bold text. - /// </summary> - public class BoldTextInline : MarkdownInline, IInlineContainer - { - /// <summary> - /// Initializes a new instance of the <see cref="BoldTextInline"/> class. - /// </summary> - public BoldTextInline() - : base(MarkdownInlineType.Bold) - { - } - - /// <summary> - /// Gets or sets the contents of the inline. - /// </summary> - public IList<MarkdownInline> Inlines { get; set; } - - /// <summary> - /// Returns the chars that if found means we might have a match. - /// </summary> - internal static void AddTripChars(List<InlineTripCharHelper> tripCharHelpers) - { - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '*', Method = InlineParseMethod.Bold }); - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '_', Method = InlineParseMethod.Bold }); - } - - /// <summary> - /// Attempts to parse a bold text span. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <returns> A parsed bold text span, or <c>null</c> if this is not a bold text span. </returns> - internal static InlineParseResult Parse(string markdown, int start, int maxEnd) - { - if (start >= maxEnd - 1) - { - return null; - } - - // Check the start sequence. - string startSequence = markdown.Substring(start, 2); - if (startSequence != "**" && startSequence != "__") - { - return null; - } - - // Find the end of the span. The end sequence (either '**' or '__') must be the same - // as the start sequence. - var innerStart = start + 2; - int innerEnd = Common.IndexOf(markdown, startSequence, innerStart, maxEnd); - if (innerEnd == -1) - { - return null; - } - - // The span must contain at least one character. - if (innerStart == innerEnd) - { - return null; - } - - // The first character inside the span must NOT be a space. - if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerStart])) - { - return null; - } - - // The last character inside the span must NOT be a space. - if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerEnd - 1])) - { - return null; - } - - // We found something! - var result = new BoldTextInline - { - Inlines = Common.ParseInlineChildren(markdown, innerStart, innerEnd) - }; - return new InlineParseResult(result, start, innerEnd + 2); - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - if (Inlines == null) - { - return base.ToString(); - } - - return "**" + string.Join(string.Empty, Inlines) + "**"; - } - } -} diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/CodeInline.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/CodeInline.cs deleted file mode 100644 index c5b8ffabb..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/CodeInline.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - using System.Collections.Generic; - - /// <summary> - /// Represents a span containing code, or other text that is to be displayed using a - /// fixed-width font. - /// </summary> - public class CodeInline : MarkdownInline, IInlineLeaf - { - /// <summary> - /// Initializes a new instance of the <see cref="CodeInline"/> class. - /// </summary> - public CodeInline() - : base(MarkdownInlineType.Code) - { - } - - /// <summary> - /// Gets or sets the text to display as code. - /// </summary> - public string Text { get; set; } - - /// <summary> - /// Returns the chars that if found means we might have a match. - /// </summary> - internal static void AddTripChars(List<InlineTripCharHelper> tripCharHelpers) - { - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '`', Method = InlineParseMethod.Code }); - } - - /// <summary> - /// Attempts to parse an inline code span. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <returns> A parsed inline code span, or <c>null</c> if this is not an inline code span. </returns> - internal static InlineParseResult Parse(string markdown, int start, int maxEnd) - { - // Check the first char. - if (start == maxEnd || markdown[start] != '`') - { - return null; - } - - // There is an alternate syntax that starts and ends with two backticks. - // e.g. ``sdf`sdf`` would be "sdf`sdf". - int innerStart = start + 1; - int innerEnd, end; - if (innerStart < maxEnd && markdown[innerStart] == '`') - { - // Alternate double back-tick syntax. - innerStart++; - - // Find the end of the span. - innerEnd = Common.IndexOf(markdown, "``", innerStart, maxEnd); - if (innerEnd == -1) - { - return null; - } - - end = innerEnd + 2; - } - else - { - // Standard single backtick syntax. - - // Find the end of the span. - innerEnd = Common.IndexOf(markdown, '`', innerStart, maxEnd); - if (innerEnd == -1) - { - return null; - } - - end = innerEnd + 1; - } - - // The span must contain at least one character. - if (innerStart == innerEnd) - { - return null; - } - - // We found something! - var result = new CodeInline - { - Text = markdown.Substring(innerStart, innerEnd - innerStart).Trim(' ', '\t', '\r', '\n') - }; - return new InlineParseResult(result, start, end); - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - if (Text == null) - { - return base.ToString(); - } - - return "`" + Text + "`"; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/CommentInline.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/CommentInline.cs deleted file mode 100644 index c2cb6b3b6..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/CommentInline.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - using System; - using System.Collections.Generic; - - /// <summary> - /// Represents a span that contains comment. - /// </summary> - internal class CommentInline : MarkdownInline, IInlineLeaf - { - /// <summary> - /// Initializes a new instance of the <see cref="CommentInline"/> class. - /// </summary> - public CommentInline() - : base(MarkdownInlineType.Comment) - { - } - - /// <summary> - /// Gets or sets the Content of the Comment. - /// </summary> - public string Text { get; set; } - - /// <summary> - /// Returns the chars that if found means we might have a match. - /// </summary> - internal static void AddTripChars(List<InlineTripCharHelper> tripCharHelpers) - { - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '<', Method = InlineParseMethod.Comment }); - } - - /// <summary> - /// Attempts to parse a comment span. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <returns> A parsed bold text span, or <c>null</c> if this is not a bold text span. </returns> - internal static InlineParseResult Parse(string markdown, int start, int maxEnd) - { - if (start >= maxEnd - 1) - { - return null; - } - - string startSequence = markdown.Substring(start); - if (!startSequence.StartsWith("<!--", StringComparison.Ordinal)) - { - return null; - } - - // Find the end of the span. The end sequence ('-->') - var innerStart = start + 4; - int innerEnd = Common.IndexOf(markdown, "-->", innerStart, maxEnd); - if (innerEnd == -1) - { - return null; - } - - var length = innerEnd - innerStart; - var contents = markdown.Substring(innerStart, length); - - var result = new CommentInline - { - Text = contents - }; - - return new InlineParseResult(result, start, innerEnd + 3); - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - return "<!--" + Text + "-->"; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/EmojiInline.EmojiCodes.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/EmojiInline.EmojiCodes.cs deleted file mode 100644 index 40d08da48..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/EmojiInline.EmojiCodes.cs +++ /dev/null @@ -1,846 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - using System.Collections.Generic; - - /// <summary> - /// Represents a span containing emoji symbol. - /// </summary> - public partial class EmojiInline - { - // Codes taken from https://gist.github.com/rxaviers/7360908 - // Ignoring not implented symbols in Segoe UI Emoji font (e.g. :bowtie:) - private static readonly Dictionary<string, int> _emojiCodesDictionary = new Dictionary<string, int> - { - { "smile", 0x1f604 }, - { "laughing", 0x1f606 }, - { "blush", 0x1f60a }, - { "smiley", 0x1f603 }, - { "relaxed", 0x263a }, - { "smirk", 0x1f60f }, - { "heart_eyes", 0x1f60d }, - { "kissing_heart", 0x1f618 }, - { "kissing_closed_eyes", 0x1f61a }, - { "flushed", 0x1f633 }, - { "relieved", 0x1f60c }, - { "satisfied", 0x1f606 }, - { "grin", 0x1f601 }, - { "wink", 0x1f609 }, - { "stuck_out_tongue_winking_eye", 0x1f61c }, - { "stuck_out_tongue_closed_eyes", 0x1f61d }, - { "grinning", 0x1f600 }, - { "kissing", 0x1f617 }, - { "kissing_smiling_eyes", 0x1f619 }, - { "stuck_out_tongue", 0x1f61b }, - { "sleeping", 0x1f634 }, - { "worried", 0x1f61f }, - { "frowning", 0x1f626 }, - { "anguished", 0x1f627 }, - { "open_mouth", 0x1f62e }, - { "grimacing", 0x1f62c }, - { "confused", 0x1f615 }, - { "hushed", 0x1f62f }, - { "expressionless", 0x1f611 }, - { "unamused", 0x1f612 }, - { "sweat_smile", 0x1f605 }, - { "sweat", 0x1f613 }, - { "disappointed_relieved", 0x1f625 }, - { "weary", 0x1f629 }, - { "pensive", 0x1f614 }, - { "disappointed", 0x1f61e }, - { "confounded", 0x1f616 }, - { "fearful", 0x1f628 }, - { "cold_sweat", 0x1f630 }, - { "persevere", 0x1f623 }, - { "cry", 0x1f622 }, - { "sob", 0x1f62d }, - { "joy", 0x1f602 }, - { "astonished", 0x1f632 }, - { "scream", 0x1f631 }, - { "tired_face", 0x1f62b }, - { "angry", 0x1f620 }, - { "rage", 0x1f621 }, - { "triumph", 0x1f624 }, - { "sleepy", 0x1f62a }, - { "yum", 0x1f60b }, - { "mask", 0x1f637 }, - { "sunglasses", 0x1f60e }, - { "dizzy_face", 0x1f635 }, - { "imp", 0x1f47f }, - { "smiling_imp", 0x1f608 }, - { "neutral_face", 0x1f610 }, - { "no_mouth", 0x1f636 }, - { "innocent", 0x1f607 }, - { "alien", 0x1f47d }, - { "yellow_heart", 0x1f49b }, - { "blue_heart", 0x1f499 }, - { "purple_heart", 0x1f49c }, - { "heart", 0x2764 }, - { "green_heart", 0x1f49a }, - { "broken_heart", 0x1f494 }, - { "heartbeat", 0x1f493 }, - { "heartpulse", 0x1f497 }, - { "two_hearts", 0x1f495 }, - { "revolving_hearts", 0x1f49e }, - { "cupid", 0x1f498 }, - { "sparkling_heart", 0x1f496 }, - { "sparkles", 0x2728 }, - { "star", 0x2b50 }, - { "star2", 0x1f31f }, - { "dizzy", 0x1f4ab }, - { "boom", 0x1f4a5 }, - { "collision", 0x1f4a5 }, - { "anger", 0x1f4a2 }, - { "exclamation", 0x2757 }, - { "question", 0x2753 }, - { "grey_exclamation", 0x2755 }, - { "grey_question", 0x2754 }, - { "zzz", 0x1f4a4 }, - { "dash", 0x1f4a8 }, - { "sweat_drops", 0x1f4a6 }, - { "notes", 0x1f3b6 }, - { "musical_note", 0x1f3b5 }, - { "fire", 0x1f525 }, - { "hankey", 0x1f4a9 }, - { "poop", 0x1f4a9 }, - { "+1", 0x1f44d }, - { "thumbsup", 0x1f44d }, - { "-1", 0x1f44e }, - { "thumbsdown", 0x1f44e }, - { "ok_hand", 0x1f44c }, - { "punch", 0x1f44a }, - { "facepunch", 0x1f44a }, - { "fist", 0x270a }, - { "v", 0x270c }, - { "wave", 0x1f44b }, - { "hand", 0x270b }, - { "raised_hand", 0x270b }, - { "open_hands", 0x1f450 }, - { "point_up", 0x261d }, - { "point_down", 0x1f447 }, - { "point_left", 0x1f448 }, - { "point_right", 0x1f449 }, - { "raised_hands", 0x1f64c }, - { "pray", 0x1f64f }, - { "point_up_2", 0x1f446 }, - { "clap", 0x1f44f }, - { "muscle", 0x1f4aa }, - { "metal", 0x1f918 }, - { "walking", 0x1f6b6 }, - { "runner", 0x1f3c3 }, - { "running", 0x1f3c3 }, - { "couple", 0x1f46b }, - { "family", 0x1f46a }, - { "two_men_holding_hands", 0x1f46c }, - { "two_women_holding_hands", 0x1f46d }, - { "dancer", 0x1f483 }, - { "dancers", 0x1f46f }, - { "ok_woman", 0x1f646 }, - { "no_good", 0x1f645 }, - { "information_desk_person", 0x1f481 }, - { "raising_hand", 0x1f64b }, - { "bride_with_veil", 0x1f470 }, - { "person_with_pouting_face", 0x1f64e }, - { "person_frowning", 0x1f64d }, - { "bow", 0x1f647 }, - { "couple_with_heart", 0x1f491 }, - { "massage", 0x1f486 }, - { "haircut", 0x1f487 }, - { "nail_care", 0x1f485 }, - { "boy", 0x1f466 }, - { "girl", 0x1f467 }, - { "woman", 0x1f469 }, - { "man", 0x1f468 }, - { "baby", 0x1f476 }, - { "older_woman", 0x1f475 }, - { "older_man", 0x1f474 }, - { "person_with_blond_hair", 0x1f471 }, - { "man_with_gua_pi_mao", 0x1f472 }, - { "man_with_turban", 0x1f473 }, - { "construction_worker", 0x1f477 }, - { "cop", 0x1f46e }, - { "angel", 0x1f47c }, - { "princess", 0x1f478 }, - { "smiley_cat", 0x1f63a }, - { "smile_cat", 0x1f638 }, - { "heart_eyes_cat", 0x1f63b }, - { "kissing_cat", 0x1f63d }, - { "smirk_cat", 0x1f63c }, - { "scream_cat", 0x1f640 }, - { "crying_cat_face", 0x1f63f }, - { "joy_cat", 0x1f639 }, - { "pouting_cat", 0x1f63e }, - { "japanese_ogre", 0x1f479 }, - { "japanese_goblin", 0x1f47a }, - { "see_no_evil", 0x1f648 }, - { "hear_no_evil", 0x1f649 }, - { "speak_no_evil", 0x1f64a }, - { "guardsman", 0x1f482 }, - { "skull", 0x1f480 }, - { "feet", 0x1f43e }, - { "lips", 0x1f444 }, - { "kiss", 0x1f48b }, - { "droplet", 0x1f4a7 }, - { "ear", 0x1f442 }, - { "eyes", 0x1f440 }, - { "nose", 0x1f443 }, - { "tongue", 0x1f445 }, - { "love_letter", 0x1f48c }, - { "bust_in_silhouette", 0x1f464 }, - { "busts_in_silhouette", 0x1f465 }, - { "speech_balloon", 0x1f4ac }, - { "thought_balloon", 0x1f4ad }, - { "sunny", 0x2600 }, - { "umbrella", 0x2614 }, - { "cloud", 0x2601 }, - { "snowflake", 0x2744 }, - { "snowman", 0x26c4 }, - { "zap", 0x26a1 }, - { "cyclone", 0x1f300 }, - { "foggy", 0x1f301 }, - { "ocean", 0x1f30a }, - { "cat", 0x1f431 }, - { "dog", 0x1f436 }, - { "mouse", 0x1f42d }, - { "hamster", 0x1f439 }, - { "rabbit", 0x1f430 }, - { "wolf", 0x1f43a }, - { "frog", 0x1f438 }, - { "tiger", 0x1f42f }, - { "koala", 0x1f428 }, - { "bear", 0x1f43b }, - { "pig", 0x1f437 }, - { "pig_nose", 0x1f43d }, - { "cow", 0x1f42e }, - { "boar", 0x1f417 }, - { "monkey_face", 0x1f435 }, - { "monkey", 0x1f412 }, - { "horse", 0x1f434 }, - { "racehorse", 0x1f40e }, - { "camel", 0x1f42b }, - { "sheep", 0x1f411 }, - { "elephant", 0x1f418 }, - { "panda_face", 0x1f43c }, - { "snake", 0x1f40d }, - { "bird", 0x1f426 }, - { "baby_chick", 0x1f424 }, - { "hatched_chick", 0x1f425 }, - { "hatching_chick", 0x1f423 }, - { "chicken", 0x1f414 }, - { "penguin", 0x1f427 }, - { "turtle", 0x1f422 }, - { "bug", 0x1f41b }, - { "honeybee", 0x1f41d }, - { "ant", 0x1f41c }, - { "beetle", 0x1f41e }, - { "snail", 0x1f40c }, - { "octopus", 0x1f419 }, - { "tropical_fish", 0x1f420 }, - { "fish", 0x1f41f }, - { "whale", 0x1f433 }, - { "whale2", 0x1f40b }, - { "dolphin", 0x1f42c }, - { "cow2", 0x1f404 }, - { "ram", 0x1f40f }, - { "rat", 0x1f400 }, - { "water_buffalo", 0x1f403 }, - { "tiger2", 0x1f405 }, - { "rabbit2", 0x1f407 }, - { "dragon", 0x1f409 }, - { "goat", 0x1f410 }, - { "rooster", 0x1f413 }, - { "dog2", 0x1f415 }, - { "pig2", 0x1f416 }, - { "mouse2", 0x1f401 }, - { "ox", 0x1f402 }, - { "dragon_face", 0x1f432 }, - { "blowfish", 0x1f421 }, - { "crocodile", 0x1f40a }, - { "dromedary_camel", 0x1f42a }, - { "leopard", 0x1f406 }, - { "cat2", 0x1f408 }, - { "poodle", 0x1f429 }, - { "paw_prints", 0x1f43e }, - { "bouquet", 0x1f490 }, - { "cherry_blossom", 0x1f338 }, - { "tulip", 0x1f337 }, - { "four_leaf_clover", 0x1f340 }, - { "rose", 0x1f339 }, - { "sunflower", 0x1f33b }, - { "hibiscus", 0x1f33a }, - { "maple_leaf", 0x1f341 }, - { "leaves", 0x1f343 }, - { "fallen_leaf", 0x1f342 }, - { "herb", 0x1f33f }, - { "mushroom", 0x1f344 }, - { "cactus", 0x1f335 }, - { "palm_tree", 0x1f334 }, - { "evergreen_tree", 0x1f332 }, - { "deciduous_tree", 0x1f333 }, - { "chestnut", 0x1f330 }, - { "seedling", 0x1f331 }, - { "blossom", 0x1f33c }, - { "ear_of_rice", 0x1f33e }, - { "shell", 0x1f41a }, - { "globe_with_meridians", 0x1f310 }, - { "sun_with_face", 0x1f31e }, - { "full_moon_with_face", 0x1f31d }, - { "new_moon_with_face", 0x1f31a }, - { "new_moon", 0x1f311 }, - { "waxing_crescent_moon", 0x1f312 }, - { "first_quarter_moon", 0x1f313 }, - { "waxing_gibbous_moon", 0x1f314 }, - { "full_moon", 0x1f315 }, - { "waning_gibbous_moon", 0x1f316 }, - { "last_quarter_moon", 0x1f317 }, - { "waning_crescent_moon", 0x1f318 }, - { "last_quarter_moon_with_face", 0x1f31c }, - { "first_quarter_moon_with_face", 0x1f31b }, - { "moon", 0x1f314 }, - { "earth_africa", 0x1f30d }, - { "earth_americas", 0x1f30e }, - { "earth_asia", 0x1f30f }, - { "volcano", 0x1f30b }, - { "milky_way", 0x1f30c }, - { "partly_sunny", 0x26c5 }, - { "bamboo", 0x1f38d }, - { "gift_heart", 0x1f49d }, - { "dolls", 0x1f38e }, - { "school_satchel", 0x1f392 }, - { "mortar_board", 0x1f393 }, - { "flags", 0x1f38f }, - { "fireworks", 0x1f386 }, - { "sparkler", 0x1f387 }, - { "wind_chime", 0x1f390 }, - { "rice_scene", 0x1f391 }, - { "jack_o_lantern", 0x1f383 }, - { "ghost", 0x1f47b }, - { "santa", 0x1f385 }, - { "christmas_tree", 0x1f384 }, - { "gift", 0x1f381 }, - { "bell", 0x1f514 }, - { "no_bell", 0x1f515 }, - { "tanabata_tree", 0x1f38b }, - { "tada", 0x1f389 }, - { "confetti_ball", 0x1f38a }, - { "balloon", 0x1f388 }, - { "crystal_ball", 0x1f52e }, - { "cd", 0x1f4bf }, - { "dvd", 0x1f4c0 }, - { "floppy_disk", 0x1f4be }, - { "camera", 0x1f4f7 }, - { "video_camera", 0x1f4f9 }, - { "movie_camera", 0x1f3a5 }, - { "computer", 0x1f4bb }, - { "tv", 0x1f4fa }, - { "iphone", 0x1f4f1 }, - { "phone", 0x260e }, - { "telephone", 0x260e }, - { "telephone_receiver", 0x1f4de }, - { "pager", 0x1f4df }, - { "fax", 0x1f4e0 }, - { "minidisc", 0x1f4bd }, - { "vhs", 0x1f4fc }, - { "sound", 0x1f509 }, - { "speaker", 0x1f508 }, - { "mute", 0x1f507 }, - { "loudspeaker", 0x1f4e2 }, - { "mega", 0x1f4e3 }, - { "hourglass", 0x231b }, - { "hourglass_flowing_sand", 0x23f3 }, - { "alarm_clock", 0x23f0 }, - { "watch", 0x231a }, - { "radio", 0x1f4fb }, - { "satellite", 0x1f4e1 }, - { "loop", 0x27bf }, - { "mag", 0x1f50d }, - { "mag_right", 0x1f50e }, - { "unlock", 0x1f513 }, - { "lock", 0x1f512 }, - { "lock_with_ink_pen", 0x1f50f }, - { "closed_lock_with_key", 0x1f510 }, - { "key", 0x1f511 }, - { "bulb", 0x1f4a1 }, - { "flashlight", 0x1f526 }, - { "high_brightness", 0x1f506 }, - { "low_brightness", 0x1f505 }, - { "electric_plug", 0x1f50c }, - { "battery", 0x1f50b }, - { "calling", 0x1f4f2 }, - { "email", 0x2709 }, - { "mailbox", 0x1f4eb }, - { "postbox", 0x1f4ee }, - { "bath", 0x1f6c0 }, - { "bathtub", 0x1f6c1 }, - { "shower", 0x1f6bf }, - { "toilet", 0x1f6bd }, - { "wrench", 0x1f527 }, - { "nut_and_bolt", 0x1f529 }, - { "hammer", 0x1f528 }, - { "seat", 0x1f4ba }, - { "moneybag", 0x1f4b0 }, - { "yen", 0x1f4b4 }, - { "dollar", 0x1f4b5 }, - { "pound", 0x1f4b7 }, - { "euro", 0x1f4b6 }, - { "credit_card", 0x1f4b3 }, - { "money_with_wings", 0x1f4b8 }, - { "e-mail", 0x1f4e7 }, - { "inbox_tray", 0x1f4e5 }, - { "outbox_tray", 0x1f4e4 }, - { "envelope", 0x2709 }, - { "incoming_envelope", 0x1f4e8 }, - { "postal_horn", 0x1f4ef }, - { "mailbox_closed", 0x1f4ea }, - { "mailbox_with_mail", 0x1f4ec }, - { "mailbox_with_no_mail", 0x1f4ed }, - { "door", 0x1f6aa }, - { "smoking", 0x1f6ac }, - { "bomb", 0x1f4a3 }, - { "gun", 0x1f52b }, - { "hocho", 0x1f52a }, - { "pill", 0x1f48a }, - { "syringe", 0x1f489 }, - { "page_facing_up", 0x1f4c4 }, - { "page_with_curl", 0x1f4c3 }, - { "bookmark_tabs", 0x1f4d1 }, - { "bar_chart", 0x1f4ca }, - { "chart_with_upwards_trend", 0x1f4c8 }, - { "chart_with_downwards_trend", 0x1f4c9 }, - { "scroll", 0x1f4dc }, - { "clipboard", 0x1f4cb }, - { "calendar", 0x1f4c6 }, - { "date", 0x1f4c5 }, - { "card_index", 0x1f4c7 }, - { "file_folder", 0x1f4c1 }, - { "open_file_folder", 0x1f4c2 }, - { "scissors", 0x2702 }, - { "pushpin", 0x1f4cc }, - { "paperclip", 0x1f4ce }, - { "black_nib", 0x2712 }, - { "pencil2", 0x270f }, - { "straight_ruler", 0x1f4cf }, - { "triangular_ruler", 0x1f4d0 }, - { "closed_book", 0x1f4d5 }, - { "green_book", 0x1f4d7 }, - { "blue_book", 0x1f4d8 }, - { "orange_book", 0x1f4d9 }, - { "notebook", 0x1f4d3 }, - { "notebook_with_decorative_cover", 0x1f4d4 }, - { "ledger", 0x1f4d2 }, - { "books", 0x1f4da }, - { "bookmark", 0x1f516 }, - { "name_badge", 0x1f4db }, - { "microscope", 0x1f52c }, - { "telescope", 0x1f52d }, - { "newspaper", 0x1f4f0 }, - { "football", 0x1f3c8 }, - { "basketball", 0x1f3c0 }, - { "soccer", 0x26bd }, - { "baseball", 0x26be }, - { "tennis", 0x1f3be }, - { "8ball", 0x1f3b1 }, - { "rugby_football", 0x1f3c9 }, - { "bowling", 0x1f3b3 }, - { "golf", 0x26f3 }, - { "mountain_bicyclist", 0x1f6b5 }, - { "bicyclist", 0x1f6b4 }, - { "horse_racing", 0x1f3c7 }, - { "snowboarder", 0x1f3c2 }, - { "swimmer", 0x1f3ca }, - { "surfer", 0x1f3c4 }, - { "ski", 0x1f3bf }, - { "spades", 0x2660 }, - { "hearts", 0x2665 }, - { "clubs", 0x2663 }, - { "diamonds", 0x2666 }, - { "gem", 0x1f48e }, - { "ring", 0x1f48d }, - { "trophy", 0x1f3c6 }, - { "musical_score", 0x1f3bc }, - { "musical_keyboard", 0x1f3b9 }, - { "violin", 0x1f3bb }, - { "space_invader", 0x1f47e }, - { "video_game", 0x1f3ae }, - { "black_joker", 0x1f0cf }, - { "flower_playing_cards", 0x1f3b4 }, - { "game_die", 0x1f3b2 }, - { "dart", 0x1f3af }, - { "mahjong", 0x1f004 }, - { "clapper", 0x1f3ac }, - { "memo", 0x1f4dd }, - { "pencil", 0x1f4dd }, - { "book", 0x1f4d6 }, - { "art", 0x1f3a8 }, - { "microphone", 0x1f3a4 }, - { "headphones", 0x1f3a7 }, - { "trumpet", 0x1f3ba }, - { "saxophone", 0x1f3b7 }, - { "guitar", 0x1f3b8 }, - { "shoe", 0x1f45e }, - { "sandal", 0x1f461 }, - { "high_heel", 0x1f460 }, - { "lipstick", 0x1f484 }, - { "boot", 0x1f462 }, - { "shirt", 0x1f455 }, - { "tshirt", 0x1f455 }, - { "necktie", 0x1f454 }, - { "womans_clothes", 0x1f45a }, - { "dress", 0x1f457 }, - { "running_shirt_with_sash", 0x1f3bd }, - { "jeans", 0x1f456 }, - { "kimono", 0x1f458 }, - { "bikini", 0x1f459 }, - { "ribbon", 0x1f380 }, - { "tophat", 0x1f3a9 }, - { "crown", 0x1f451 }, - { "womans_hat", 0x1f452 }, - { "mans_shoe", 0x1f45e }, - { "closed_umbrella", 0x1f302 }, - { "briefcase", 0x1f4bc }, - { "handbag", 0x1f45c }, - { "pouch", 0x1f45d }, - { "purse", 0x1f45b }, - { "eyeglasses", 0x1f453 }, - { "fishing_pole_and_fish", 0x1f3a3 }, - { "coffee", 0x2615 }, - { "tea", 0x1f375 }, - { "sake", 0x1f376 }, - { "baby_bottle", 0x1f37c }, - { "beer", 0x1f37a }, - { "beers", 0x1f37b }, - { "cocktail", 0x1f378 }, - { "tropical_drink", 0x1f379 }, - { "wine_glass", 0x1f377 }, - { "fork_and_knife", 0x1f374 }, - { "pizza", 0x1f355 }, - { "hamburger", 0x1f354 }, - { "fries", 0x1f35f }, - { "poultry_leg", 0x1f357 }, - { "meat_on_bone", 0x1f356 }, - { "spaghetti", 0x1f35d }, - { "curry", 0x1f35b }, - { "fried_shrimp", 0x1f364 }, - { "bento", 0x1f371 }, - { "sushi", 0x1f363 }, - { "fish_cake", 0x1f365 }, - { "rice_ball", 0x1f359 }, - { "rice_cracker", 0x1f358 }, - { "rice", 0x1f35a }, - { "ramen", 0x1f35c }, - { "stew", 0x1f372 }, - { "oden", 0x1f362 }, - { "dango", 0x1f361 }, - { "egg", 0x1f95a }, - { "bread", 0x1f35e }, - { "doughnut", 0x1f369 }, - { "custard", 0x1f36e }, - { "icecream", 0x1f366 }, - { "ice_cream", 0x1f368 }, - { "shaved_ice", 0x1f367 }, - { "birthday", 0x1f382 }, - { "cake", 0x1f370 }, - { "cookie", 0x1f36a }, - { "chocolate_bar", 0x1f36b }, - { "candy", 0x1f36c }, - { "lollipop", 0x1f36d }, - { "honey_pot", 0x1f36f }, - { "apple", 0x1f34e }, - { "green_apple", 0x1f34f }, - { "tangerine", 0x1f34a }, - { "lemon", 0x1f34b }, - { "cherries", 0x1f352 }, - { "grapes", 0x1f347 }, - { "watermelon", 0x1f349 }, - { "strawberry", 0x1f353 }, - { "peach", 0x1f351 }, - { "melon", 0x1f348 }, - { "banana", 0x1f34c }, - { "pear", 0x1f350 }, - { "pineapple", 0x1f34d }, - { "sweet_potato", 0x1f360 }, - { "eggplant", 0x1f346 }, - { "tomato", 0x1f345 }, - { "corn", 0x1f33d }, - { "house", 0x1f3e0 }, - { "house_with_garden", 0x1f3e1 }, - { "school", 0x1f3eb }, - { "office", 0x1f3e2 }, - { "post_office", 0x1f3e3 }, - { "hospital", 0x1f3e5 }, - { "bank", 0x1f3e6 }, - { "convenience_store", 0x1f3ea }, - { "love_hotel", 0x1f3e9 }, - { "hotel", 0x1f3e8 }, - { "wedding", 0x1f492 }, - { "church", 0x26ea }, - { "department_store", 0x1f3ec }, - { "european_post_office", 0x1f3e4 }, - { "city_sunrise", 0x1f307 }, - { "city_sunset", 0x1f306 }, - { "japanese_castle", 0x1f3ef }, - { "european_castle", 0x1f3f0 }, - { "tent", 0x26fa }, - { "factory", 0x1f3ed }, - { "tokyo_tower", 0x1f5fc }, - { "japan", 0x1f5fe }, - { "mount_fuji", 0x1f5fb }, - { "sunrise_over_mountains", 0x1f304 }, - { "sunrise", 0x1f305 }, - { "stars", 0x1f320 }, - { "statue_of_liberty", 0x1f5fd }, - { "bridge_at_night", 0x1f309 }, - { "carousel_horse", 0x1f3a0 }, - { "rainbow", 0x1f308 }, - { "ferris_wheel", 0x1f3a1 }, - { "fountain", 0x26f2 }, - { "roller_coaster", 0x1f3a2 }, - { "ship", 0x1f6a2 }, - { "speedboat", 0x1f6a4 }, - { "boat", 0x26f5 }, - { "sailboat", 0x26f5 }, - { "rowboat", 0x1f6a3 }, - { "anchor", 0x2693 }, - { "rocket", 0x1f680 }, - { "airplane", 0x2708 }, - { "helicopter", 0x1f681 }, - { "steam_locomotive", 0x1f682 }, - { "tram", 0x1f68a }, - { "mountain_railway", 0x1f69e }, - { "bike", 0x1f6b2 }, - { "aerial_tramway", 0x1f6a1 }, - { "suspension_railway", 0x1f69f }, - { "mountain_cableway", 0x1f6a0 }, - { "tractor", 0x1f69c }, - { "blue_car", 0x1f699 }, - { "oncoming_automobile", 0x1f698 }, - { "car", 0x1f697 }, - { "red_car", 0x1f697 }, - { "taxi", 0x1f695 }, - { "oncoming_taxi", 0x1f696 }, - { "articulated_lorry", 0x1f69b }, - { "bus", 0x1f68c }, - { "oncoming_bus", 0x1f68d }, - { "rotating_light", 0x1f6a8 }, - { "police_car", 0x1f693 }, - { "oncoming_police_car", 0x1f694 }, - { "fire_engine", 0x1f692 }, - { "ambulance", 0x1f691 }, - { "minibus", 0x1f690 }, - { "truck", 0x1f69a }, - { "train", 0x1f68b }, - { "station", 0x1f689 }, - { "train2", 0x1f686 }, - { "bullettrain_front", 0x1f685 }, - { "bullettrain_side", 0x1f684 }, - { "light_rail", 0x1f688 }, - { "monorail", 0x1f69d }, - { "railway_car", 0x1f683 }, - { "trolleybus", 0x1f68e }, - { "ticket", 0x1f3ab }, - { "fuelpump", 0x26fd }, - { "vertical_traffic_light", 0x1f6a6 }, - { "traffic_light", 0x1f6a5 }, - { "warning", 0x26a0 }, - { "construction", 0x1f6a7 }, - { "beginner", 0x1f530 }, - { "atm", 0x1f3e7 }, - { "slot_machine", 0x1f3b0 }, - { "busstop", 0x1f68f }, - { "barber", 0x1f488 }, - { "hotsprings", 0x2668 }, - { "checkered_flag", 0x1f3c1 }, - { "crossed_flags", 0x1f38c }, - { "izakaya_lantern", 0x1f3ee }, - { "moyai", 0x1f5ff }, - { "circus_tent", 0x1f3aa }, - { "performing_arts", 0x1f3ad }, - { "round_pushpin", 0x1f4cd }, - { "triangular_flag_on_post", 0x1f6a9 }, - { "keycap_ten", 0x1f51f }, - { "1234", 0x1f522 }, - { "symbols", 0x1f523 }, - { "arrow_backward", 0x25c0 }, - { "arrow_down", 0x2b07 }, - { "arrow_forward", 0x25b6 }, - { "arrow_left", 0x2b05 }, - { "capital_abcd", 0x1f520 }, - { "abcd", 0x1f521 }, - { "abc", 0x1f524 }, - { "arrow_lower_left", 0x2199 }, - { "arrow_lower_right", 0x2198 }, - { "arrow_right", 0x27a1 }, - { "arrow_up", 0x2b06 }, - { "arrow_upper_left", 0x2196 }, - { "arrow_upper_right", 0x2197 }, - { "arrow_double_down", 0x23ec }, - { "arrow_double_up", 0x23eb }, - { "arrow_down_small", 0x1f53d }, - { "arrow_heading_down", 0x2935 }, - { "arrow_heading_up", 0x2934 }, - { "leftwards_arrow_with_hook", 0x21a9 }, - { "arrow_right_hook", 0x21aa }, - { "left_right_arrow", 0x2194 }, - { "arrow_up_down", 0x2195 }, - { "arrow_up_small", 0x1f53c }, - { "arrows_clockwise", 0x1f503 }, - { "arrows_counterclockwise", 0x1f504 }, - { "rewind", 0x23ea }, - { "fast_forward", 0x23e9 }, - { "information_source", 0x2139 }, - { "ok", 0x1f197 }, - { "twisted_rightwards_arrows", 0x1f500 }, - { "repeat", 0x1f501 }, - { "repeat_one", 0x1f502 }, - { "new", 0x1f195 }, - { "top", 0x1f51d }, - { "up", 0x1f199 }, - { "cool", 0x1f192 }, - { "free", 0x1f193 }, - { "ng", 0x1f196 }, - { "cinema", 0x1f3a6 }, - { "koko", 0x1f201 }, - { "signal_strength", 0x1f4f6 }, - { "u5272", 0x1f239 }, - { "u5408", 0x1f234 }, - { "u55b6", 0x1f23a }, - { "u6307", 0x1f22f }, - { "u6708", 0x1f237 }, - { "u6709", 0x1f236 }, - { "u6e80", 0x1f235 }, - { "u7121", 0x1f21a }, - { "u7533", 0x1f238 }, - { "u7a7a", 0x1f233 }, - { "u7981", 0x1f232 }, - { "sa", 0x1f202 }, - { "restroom", 0x1f6bb }, - { "mens", 0x1f6b9 }, - { "womens", 0x1f6ba }, - { "baby_symbol", 0x1f6bc }, - { "no_smoking", 0x1f6ad }, - { "parking", 0x1f17f }, - { "wheelchair", 0x267f }, - { "metro", 0x1f687 }, - { "baggage_claim", 0x1f6c4 }, - { "accept", 0x1f251 }, - { "wc", 0x1f6be }, - { "potable_water", 0x1f6b0 }, - { "put_litter_in_its_place", 0x1f6ae }, - { "secret", 0x3299 }, - { "congratulations", 0x3297 }, - { "m", 0x24c2 }, - { "passport_control", 0x1f6c2 }, - { "left_luggage", 0x1f6c5 }, - { "customs", 0x1f6c3 }, - { "ideograph_advantage", 0x1f250 }, - { "cl", 0x1f191 }, - { "sos", 0x1f198 }, - { "id", 0x1f194 }, - { "no_entry_sign", 0x1f6ab }, - { "underage", 0x1f51e }, - { "no_mobile_phones", 0x1f4f5 }, - { "do_not_litter", 0x1f6af }, - { "non-potable_water", 0x1f6b1 }, - { "no_bicycles", 0x1f6b3 }, - { "no_pedestrians", 0x1f6b7 }, - { "children_crossing", 0x1f6b8 }, - { "no_entry", 0x26d4 }, - { "eight_spoked_asterisk", 0x2733 }, - { "eight_pointed_black_star", 0x2734 }, - { "heart_decoration", 0x1f49f }, - { "vs", 0x1f19a }, - { "vibration_mode", 0x1f4f3 }, - { "mobile_phone_off", 0x1f4f4 }, - { "chart", 0x1f4b9 }, - { "currency_exchange", 0x1f4b1 }, - { "aries", 0x2648 }, - { "taurus", 0x2649 }, - { "gemini", 0x264a }, - { "cancer", 0x264b }, - { "leo", 0x264c }, - { "virgo", 0x264d }, - { "libra", 0x264e }, - { "scorpius", 0x264f }, - { "sagittarius", 0x2650 }, - { "capricorn", 0x2651 }, - { "aquarius", 0x2652 }, - { "pisces", 0x2653 }, - { "ophiuchus", 0x26ce }, - { "six_pointed_star", 0x1f52f }, - { "negative_squared_cross_mark", 0x274e }, - { "a", 0x1f170 }, - { "b", 0x1f171 }, - { "ab", 0x1f18e }, - { "o2", 0x1f17e }, - { "diamond_shape_with_a_dot_inside", 0x1f4a0 }, - { "recycle", 0x267b }, - { "end", 0x1f51a }, - { "on", 0x1f51b }, - { "soon", 0x1f51c }, - { "clock1", 0x1f550 }, - { "clock130", 0x1f55c }, - { "clock10", 0x1f559 }, - { "clock1030", 0x1f565 }, - { "clock11", 0x1f55a }, - { "clock1130", 0x1f566 }, - { "clock12", 0x1f55b }, - { "clock1230", 0x1f567 }, - { "clock2", 0x1f551 }, - { "clock230", 0x1f55d }, - { "clock3", 0x1f552 }, - { "clock330", 0x1f55e }, - { "clock4", 0x1f553 }, - { "clock430", 0x1f55f }, - { "clock5", 0x1f554 }, - { "clock530", 0x1f560 }, - { "clock6", 0x1f555 }, - { "clock630", 0x1f561 }, - { "clock7", 0x1f556 }, - { "clock730", 0x1f562 }, - { "clock8", 0x1f557 }, - { "clock830", 0x1f563 }, - { "clock9", 0x1f558 }, - { "clock930", 0x1f564 }, - { "heavy_dollar_sign", 0x1f4b2 }, - { "copyright", 0x00a9 }, - { "registered", 0x00ae }, - { "tm", 0x2122 }, - { "x", 0x274c }, - { "heavy_exclamation_mark", 0x2757 }, - { "bangbang", 0x203c }, - { "interrobang", 0x2049 }, - { "o", 0x2b55 }, - { "heavy_multiplication_x", 0x2716 }, - { "heavy_plus_sign", 0x2795 }, - { "heavy_minus_sign", 0x2796 }, - { "heavy_division_sign", 0x2797 }, - { "white_flower", 0x1f4ae }, - { "100", 0x1f4af }, - { "heavy_check_mark", 0x2714 }, - { "ballot_box_with_check", 0x2611 }, - { "radio_button", 0x1f518 }, - { "link", 0x1f517 }, - { "curly_loop", 0x27b0 }, - { "wavy_dash", 0x3030 }, - { "part_alternation_mark", 0x303d }, - { "trident", 0x1f531 }, - { "white_check_mark", 0x2705 }, - { "black_square_button", 0x1f532 }, - { "white_square_button", 0x1f533 }, - { "black_circle", 0x26ab }, - { "white_circle", 0x26aa }, - { "red_circle", 0x1f534 }, - { "large_blue_circle", 0x1f535 }, - { "large_blue_diamond", 0x1f537 }, - { "large_orange_diamond", 0x1f536 }, - { "small_blue_diamond", 0x1f539 }, - { "small_orange_diamond", 0x1f538 }, - { "small_red_triangle", 0x1f53a }, - { "small_red_triangle_down", 0x1f53b }, - }; - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/EmojiInline.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/EmojiInline.cs deleted file mode 100644 index e79011132..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/EmojiInline.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - using System.Collections.Generic; - - /// <summary> - /// Represents a span containing emoji symbol. - /// </summary> - public partial class EmojiInline : MarkdownInline, IInlineLeaf - { - /// <summary> - /// Initializes a new instance of the <see cref="EmojiInline"/> class. - /// </summary> - public EmojiInline() - : base(MarkdownInlineType.Emoji) - { - } - - /// <summary> - /// Returns the chars that if found means we might have a match. - /// </summary> - internal static void AddTripChars(List<InlineTripCharHelper> tripCharHelpers) - { - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = ':', Method = InlineParseMethod.Emoji }); - } - - internal static InlineParseResult Parse(string markdown, int start, int maxEnd) - { - if (start >= maxEnd - 1) - { - return null; - } - - // Check the start sequence. - string startSequence = markdown.Substring(start, 1); - if (startSequence != ":") - { - return null; - } - - // Find the end of the span. - var innerStart = start + 1; - int innerEnd = Common.IndexOf(markdown, startSequence, innerStart, maxEnd); - if (innerEnd == -1) - { - return null; - } - - // The span must contain at least one character. - if (innerStart == innerEnd) - { - return null; - } - - // The first character inside the span must NOT be a space. - if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerStart])) - { - return null; - } - - // The last character inside the span must NOT be a space. - if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerEnd - 1])) - { - return null; - } - - var emojiName = markdown.Substring(innerStart, innerEnd - innerStart); - - if (_emojiCodesDictionary.TryGetValue(emojiName, out var emojiCode)) - { - var result = new EmojiInline { Text = char.ConvertFromUtf32(emojiCode), Type = MarkdownInlineType.Emoji }; - return new InlineParseResult(result, start, innerEnd + 1); - } - - return null; - } - - /// <inheritdoc/> - public string Text { get; set; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/HyperlinkInline.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/HyperlinkInline.cs deleted file mode 100644 index 9ccb5b442..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/HyperlinkInline.cs +++ /dev/null @@ -1,477 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - using System; - using System.Collections.Generic; - using System.Linq; - - /// <summary> - /// Represents a type of hyperlink where the text and the target URL cannot be controlled - /// independently. - /// </summary> - public class HyperlinkInline : MarkdownInline, IInlineLeaf, ILinkElement - { - /// <summary> - /// Initializes a new instance of the <see cref="HyperlinkInline"/> class. - /// </summary> - public HyperlinkInline() - : base(MarkdownInlineType.RawHyperlink) - { - } - - /// <summary> - /// Gets or sets the text to display. - /// </summary> - public string Text { get; set; } - - /// <summary> - /// Gets or sets the URL to link to. - /// </summary> - public string Url { get; set; } - - /// <summary> - /// Gets this type of hyperlink does not have a tooltip. - /// </summary> - string ILinkElement.Tooltip => null; - - /// <summary> - /// Gets or sets the type of hyperlink. - /// </summary> - public HyperlinkType LinkType { get; set; } - - /// <summary> - /// Returns the chars that if found means we might have a match. - /// </summary> - internal static void AddTripChars(List<InlineTripCharHelper> tripCharHelpers) - { - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '<', Method = InlineParseMethod.AngleBracketLink }); - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = ':', Method = InlineParseMethod.Url }); - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '/', Method = InlineParseMethod.RedditLink }); - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '.', Method = InlineParseMethod.PartialLink }); - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '@', Method = InlineParseMethod.Email }); - } - - /// <summary> - /// Attempts to parse a URL within angle brackets e.g. "http://www.reddit.com". - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <returns> A parsed URL, or <c>null</c> if this is not a URL. </returns> - internal static InlineParseResult ParseAngleBracketLink(string markdown, int start, int maxEnd) - { - int innerStart = start + 1; - - // Check for a known scheme e.g. "https://". - int pos = -1; - foreach (var scheme in MarkdownDocument.KnownSchemes) - { - if (maxEnd - innerStart >= scheme.Length && string.Equals(markdown.Substring(innerStart, scheme.Length), scheme, StringComparison.OrdinalIgnoreCase)) - { - // URL scheme found. - pos = innerStart + scheme.Length; - break; - } - } - - if (pos == -1) - { - return null; - } - - // Angle bracket links should not have any whitespace. - int innerEnd = markdown.IndexOfAny(new char[] { ' ', '\t', '\r', '\n', '>' }, pos, maxEnd - pos); - if (innerEnd == -1 || markdown[innerEnd] != '>') - { - return null; - } - - // There should be at least one character after the http://. - if (innerEnd == pos) - { - return null; - } - - var url = markdown.Substring(innerStart, innerEnd - innerStart); - return new InlineParseResult(new HyperlinkInline { Url = url, Text = url, LinkType = HyperlinkType.BracketedUrl }, start, innerEnd + 1); - } - - /// <summary> - /// Attempts to parse a URL e.g. "http://www.reddit.com". - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="tripPos"> The location of the colon character. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <returns> A parsed URL, or <c>null</c> if this is not a URL. </returns> - internal static InlineParseResult ParseUrl(string markdown, int tripPos, int maxEnd) - { - int start = -1; - - // Check for a known scheme e.g. "https://". - foreach (var scheme in MarkdownDocument.KnownSchemes) - { - int schemeStart = tripPos - scheme.Length; - if (schemeStart >= 0 && schemeStart <= maxEnd - scheme.Length && string.Equals(markdown.Substring(schemeStart, scheme.Length), scheme, StringComparison.OrdinalIgnoreCase)) - { - // URL scheme found. - start = schemeStart; - break; - } - } - - if (start == -1) - { - return null; - } - - // The previous character must be non-alphanumeric i.e. "ahttp://t.co" is not a valid URL. - if (start > 0 && char.IsLetter(markdown[start - 1])) - { - return null; - } - - // The URL must have at least one character after the http:// and at least one dot. - int pos = tripPos + 3; - if (pos > maxEnd) - { - return null; - } - - int dotIndex = markdown.IndexOf('.', pos, maxEnd - pos); - if (dotIndex == -1 || dotIndex == pos) - { - return null; - } - - // Find the end of the URL. - int end = FindUrlEnd(markdown, dotIndex + 1, maxEnd); - - var url = markdown.Substring(start, end - start); - return new InlineParseResult(new HyperlinkInline { Url = url, Text = url, LinkType = HyperlinkType.FullUrl }, start, end); - } - - /// <summary> - /// Attempts to parse a subreddit link e.g. "/r/news" or "r/news". - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <returns> A parsed subreddit or user link, or <c>null</c> if this is not a subreddit link. </returns> - internal static InlineParseResult ParseRedditLink(string markdown, int start, int maxEnd) - { - var result = ParseDoubleSlashLink(markdown, start, maxEnd); - if (result != null) - { - return result; - } - - return ParseSingleSlashLink(markdown, start, maxEnd); - } - - /// <summary> - /// Parse a link of the form "/r/news" or "/u/quinbd". - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <returns> A parsed subreddit or user link, or <c>null</c> if this is not a subreddit link. </returns> - private static InlineParseResult ParseDoubleSlashLink(string markdown, int start, int maxEnd) - { - // The minimum length is 4 characters ("/u/u"). - if (start > maxEnd - 4) - { - return null; - } - - // Determine the type of link (subreddit or user). - HyperlinkType linkType; - if (markdown[start + 1] == 'r') - { - linkType = HyperlinkType.Subreddit; - } - else if (markdown[start + 1] == 'u') - { - linkType = HyperlinkType.User; - } - else - { - return null; - } - - // Check that there is another slash. - if (markdown[start + 2] != '/') - { - return null; - } - - // Find the end of the link. - int end = FindEndOfRedditLink(markdown, start + 3, maxEnd); - - // Subreddit names must be at least two characters long, users at least one. - if (end - start < (linkType == HyperlinkType.User ? 4 : 5)) - { - return null; - } - - // We found something! - var text = markdown.Substring(start, end - start); - return new InlineParseResult(new HyperlinkInline { Text = text, Url = text, LinkType = linkType }, start, end); - } - - /// <summary> - /// Parse a link of the form "r/news" or "u/quinbd". - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <returns> A parsed subreddit or user link, or <c>null</c> if this is not a subreddit link. </returns> - private static InlineParseResult ParseSingleSlashLink(string markdown, int start, int maxEnd) - { - // The minimum length is 3 characters ("u/u"). - start--; - if (start < 0 || start > maxEnd - 3) - { - return null; - } - - // Determine the type of link (subreddit or user). - HyperlinkType linkType; - if (markdown[start] == 'r') - { - linkType = HyperlinkType.Subreddit; - } - else if (markdown[start] == 'u') - { - linkType = HyperlinkType.User; - } - else - { - return null; - } - - // If the link doesn't start with '/', then the previous character must be - // non-alphanumeric i.e. "bear/trap" is not a valid subreddit link. - if (start >= 1 && (char.IsLetterOrDigit(markdown[start - 1]) || markdown[start - 1] == '/')) - { - return null; - } - - // Find the end of the link. - int end = FindEndOfRedditLink(markdown, start + 2, maxEnd); - - // Subreddit names must be at least two characters long, users at least one. - if (end - start < (linkType == HyperlinkType.User ? 3 : 4)) - { - return null; - } - - // We found something! - var text = markdown.Substring(start, end - start); - return new InlineParseResult(new HyperlinkInline { Text = text, Url = "/" + text, LinkType = linkType }, start, end); - } - - /// <summary> - /// Attempts to parse a URL without a scheme e.g. "www.reddit.com". - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="tripPos"> The location of the dot character. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <returns> A parsed URL, or <c>null</c> if this is not a URL. </returns> - internal static InlineParseResult ParsePartialLink(string markdown, int tripPos, int maxEnd) - { - int start = tripPos - 3; - if (start < 0 || markdown[start] != 'w' || markdown[start + 1] != 'w' || markdown[start + 2] != 'w') - { - return null; - } - - // The character before the "www" must be non-alphanumeric i.e. "bwww.reddit.com" is not a valid URL. - if (start >= 1 && (char.IsLetterOrDigit(markdown[start - 1]) || markdown[start - 1] == '<')) - { - return null; - } - - // The URL must have at least one character after the www. - if (start >= maxEnd - 4) - { - return null; - } - - // Find the end of the URL. - int end = FindUrlEnd(markdown, start + 4, maxEnd); - - var url = markdown.Substring(start, end - start); - return new InlineParseResult(new HyperlinkInline { Url = "http://" + url, Text = url, LinkType = HyperlinkType.PartialUrl }, start, end); - } - - /// <summary> - /// Attempts to parse an email address e.g. "test@reddit.com". - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="minStart"> The minimum start position to return. </param> - /// <param name="tripPos"> The location of the at character. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <returns> A parsed URL, or <c>null</c> if this is not a URL. </returns> - internal static InlineParseResult ParseEmailAddress(string markdown, int minStart, int tripPos, int maxEnd) - { - // Search backwards until we find a character which is not a letter, digit, or one of - // these characters: '+', '-', '_', '.'. - // Note: it is intended that this code match the reddit.com markdown parser; there are - // many characters which are legal in email addresses but which aren't picked up by - // reddit (for example: '$' and '!'). - - // Special characters as per https://en.wikipedia.org/wiki/Email_address#Local-part allowed - char[] allowedchars = new char[] { '!', '#', '$', '%', '&', '\'', '*', '+', '-', '/', '=', '?', '^', '_', '`', '{', '|', '}', '~' }; - - int start = tripPos; - while (start > minStart) - { - char c = markdown[start - 1]; - if ((c < 'a' || c > 'z') && - (c < 'A' || c > 'Z') && - (c < '0' || c > '9') && - !allowedchars.Contains(c)) - { - break; - } - - start--; - } - - // There must be at least one character before the '@'. - if (start == tripPos) - { - return null; - } - - // Search forwards until we find a character which is not a letter, digit, or one of - // these characters: '-', '_'. - // Note: it is intended that this code match the reddit.com markdown parser; - // technically underscores ('_') aren't allowed in a host name. - int dotIndex = tripPos + 1; - while (dotIndex < maxEnd) - { - char c = markdown[dotIndex]; - if ((c < 'a' || c > 'z') && - (c < 'A' || c > 'Z') && - (c < '0' || c > '9') && - c != '-' && c != '_') - { - break; - } - - dotIndex++; - } - - // We are expecting a dot. - if (dotIndex == maxEnd || markdown[dotIndex] != '.') - { - return null; - } - - // Search forwards until we find a character which is not a letter, digit, or one of - // these characters: '.', '-', '_'. - // Note: it is intended that this code match the reddit.com markdown parser; - // technically underscores ('_') aren't allowed in a host name. - int end = dotIndex + 1; - while (end < maxEnd) - { - char c = markdown[end]; - if ((c < 'a' || c > 'z') && - (c < 'A' || c > 'Z') && - (c < '0' || c > '9') && - c != '.' && c != '-' && c != '_') - { - break; - } - - end++; - } - - // There must be at least one character after the dot. - if (end == dotIndex + 1) - { - return null; - } - - // We found an email address! - var emailAddress = markdown.Substring(start, end - start); - return new InlineParseResult(new HyperlinkInline { Url = "mailto:" + emailAddress, Text = emailAddress, LinkType = HyperlinkType.Email }, start, end); - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - if (Text == null) - { - return base.ToString(); - } - - return Text; - } - - /// <summary> - /// Finds the next character that is not a letter, digit or underscore in a range. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start searching. </param> - /// <param name="end"> The location to stop searching. </param> - /// <returns> The location of the next character that is not a letter, digit or underscore. </returns> - private static int FindEndOfRedditLink(string markdown, int start, int end) - { - int pos = start; - while (pos < markdown.Length && pos < end) - { - char c = markdown[pos]; - if ((c < 'a' || c > 'z') && - (c < 'A' || c > 'Z') && - (c < '0' || c > '9') && - c != '_' && c != '/') - { - return pos; - } - - pos++; - } - - return end; - } - - /// <summary> - /// Finds the end of a URL. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start searching. </param> - /// <param name="maxEnd"> The location to stop searching. </param> - /// <returns> The location of the end of the URL. </returns> - private static int FindUrlEnd(string markdown, int start, int maxEnd) - { - // For some reason a less than character ends a URL... - int end = markdown.IndexOfAny(new char[] { ' ', '\t', '\r', '\n', '<' }, start, maxEnd - start); - if (end == -1) - { - end = maxEnd; - } - - // URLs can't end on a punctuation character. - while (end - 1 > start) - { - if (Array.IndexOf(new char[] { ')', '}', ']', '!', ';', '.', '?', ',' }, markdown[end - 1]) < 0) - { - break; - } - - end--; - } - - return end; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/IInlineContainer.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/IInlineContainer.cs deleted file mode 100644 index 88fa2e3f1..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/IInlineContainer.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - using System.Collections.Generic; - - /// <summary> - /// Initializes a new instance of the <see cref="IInlineContainer"/> class. - /// </summary> - public interface IInlineContainer - { - /// <summary> - /// Gets or sets the contents of the inline. - /// </summary> - IList<MarkdownInline> Inlines { get; set; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/IInlineLeaf.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/IInlineLeaf.cs deleted file mode 100644 index adeaea01d..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/IInlineLeaf.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// Initializes a new instance of the <see cref="IInlineLeaf"/> class. - /// </summary> - public interface IInlineLeaf - { - /// <summary> - /// Gets or sets the text for this run. - /// </summary> - string Text { get; set; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/ILinkElement.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/ILinkElement.cs deleted file mode 100644 index 5dabbadd7..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/ILinkElement.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// Implemented by all inline link elements. - /// </summary> - internal interface ILinkElement - { - /// <summary> - /// Gets the link URL. This can be a relative URL, but note that subreddit links will always - /// have the leading slash (i.e. the Url will be "/r/baconit" even if the text is - /// "r/baconit"). - /// </summary> - string Url { get; } - - /// <summary> - /// Gets a tooltip to display on hover. Can be <c>null</c>. - /// </summary> - string Tooltip { get; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/ImageInline.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/ImageInline.cs deleted file mode 100644 index bec1687b9..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/ImageInline.cs +++ /dev/null @@ -1,258 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - using System; - using System.Collections.Generic; - - /// <summary> - /// Represents an embedded image. - /// </summary> - public class ImageInline : MarkdownInline, IInlineLeaf - { - /// <summary> - /// Initializes a new instance of the <see cref="ImageInline"/> class. - /// </summary> - public ImageInline() - : base(MarkdownInlineType.Image) - { - } - - /// <summary> - /// Gets or sets the image URL. - /// </summary> - public string Url { get; set; } - - /// <summary> - /// Gets or sets the image Render URL. - /// </summary> - public string RenderUrl { get; set; } - - /// <summary> - /// Gets or sets a text to display on hover. - /// </summary> - public string Tooltip { get; set; } - - /// <inheritdoc/> - public string Text { get; set; } = string.Empty; - - /// <summary> - /// Gets or sets the ID of a reference, if this is a reference-style link. - /// </summary> - public string ReferenceId { get; set; } - - /// <summary> - /// Gets image width - /// If value is greater than 0, ImageStretch is set to UniformToFill - /// If both ImageWidth and ImageHeight are greater than 0, ImageStretch is set to Fill - /// </summary> - public int ImageWidth { get; internal set; } - - /// <summary> - /// Gets image height - /// If value is greater than 0, ImageStretch is set to UniformToFill - /// If both ImageWidth and ImageHeight are greater than 0, ImageStretch is set to Fill - /// </summary> - public int ImageHeight { get; internal set; } - - internal static void AddTripChars(List<InlineTripCharHelper> tripCharHelpers) - { - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '!', Method = InlineParseMethod.Image }); - } - - /// <summary> - /// Attempts to parse an image e.g. "". - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="end"> The location to stop parsing. </param> - /// <returns> A parsed markdown image, or <c>null</c> if this is not a markdown image. </returns> - internal static InlineParseResult Parse(string markdown, int start, int end) - { - // Expect a '!' character. - if (start >= end || markdown[start] != '!') - { - return null; - } - - int pos = start + 1; - - // Then a '[' character - if (pos >= end || markdown[pos] != '[') - { - return null; - } - - pos++; - - // Find the ']' character - while (pos < end) - { - if (markdown[pos] == ']') - { - break; - } - - pos++; - } - - if (pos == end) - { - return null; - } - - // Extract the alt. - string tooltip = markdown.Substring(start + 2, pos - (start + 2)); - - // Expect the '(' character. - pos++; - - string reference = string.Empty; - string url = string.Empty; - int imageWidth = 0; - int imageHeight = 0; - - if (pos < end && markdown[pos] == '[') - { - int refstart = pos; - - // Find the reference ']' character - while (pos < end) - { - if (markdown[pos] == ']') - { - break; - } - - pos++; - } - - reference = markdown.Substring(refstart + 1, pos - refstart - 1); - } - else if (pos < end && markdown[pos] == '(') - { - while (pos < end && ParseHelpers.IsMarkdownWhiteSpace(markdown[pos])) - { - pos++; - } - - // Extract the URL. - int urlStart = pos; - while (pos < end && markdown[pos] != ')') - { - pos++; - } - - var imageDimensionsPos = markdown.IndexOf(" =", urlStart, pos - urlStart, StringComparison.Ordinal); - - url = imageDimensionsPos > 0 - ? TextRunInline.ResolveEscapeSequences(markdown, urlStart + 1, imageDimensionsPos) - : TextRunInline.ResolveEscapeSequences(markdown, urlStart + 1, pos); - - if (imageDimensionsPos > 0) - { - // trying to find 'x' which separates image width and height - var dimensionsSepatorPos = markdown.IndexOf("x", imageDimensionsPos + 2, pos - imageDimensionsPos - 1, StringComparison.Ordinal); - - // didn't find separator, trying to parse value as imageWidth - if (dimensionsSepatorPos == -1) - { - var imageWidthStr = markdown.Substring(imageDimensionsPos + 2, pos - imageDimensionsPos - 2); - - _ = int.TryParse(imageWidthStr, out imageWidth); - } - else - { - var dimensions = markdown.Substring(imageDimensionsPos + 2, pos - imageDimensionsPos - 2).Split('x'); - - // got width and height - if (dimensions.Length == 2) - { - _ = int.TryParse(dimensions[0], out imageWidth); - _ = int.TryParse(dimensions[1], out imageHeight); - } - } - } - } - - if (pos == end) - { - return null; - } - - // We found something! - var result = new ImageInline - { - Tooltip = tooltip, - RenderUrl = url, - ReferenceId = reference, - Url = url, - Text = markdown.Substring(start, pos + 1 - start), - ImageWidth = imageWidth, - ImageHeight = imageHeight - }; - return new InlineParseResult(result, start, pos + 1); - } - - /// <summary> - /// If this is a reference-style link, attempts to converts it to a regular link. - /// </summary> - /// <param name="document"> The document containing the list of references. </param> - internal void ResolveReference(MarkdownDocument document) - { - if (document == null) - { - throw new ArgumentNullException(nameof(document)); - } - - if (ReferenceId == null) - { - return; - } - - // Look up the reference ID. - var reference = document.LookUpReference(ReferenceId); - if (reference == null) - { - return; - } - - // The reference was found. Check the URL is valid. - if (!Common.IsUrlValid(reference.Url)) - { - return; - } - - // Everything is cool when you're part of a team. - RenderUrl = reference.Url; - ReferenceId = null; - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - if (ImageWidth > 0 && ImageHeight > 0) - { - return $"![{Tooltip}]: {Url} (Width: {ImageWidth}, Height: {ImageHeight})"; - } - - if (ImageWidth > 0) - { - return $"![{Tooltip}]: {Url} (Width: {ImageWidth})"; - } - - if (ImageHeight > 0) - { - return $"![{Tooltip}]: {Url} (Height: {ImageHeight})"; - } - - return $"![{Tooltip}]: {Url}"; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/ItalicTextInline.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/ItalicTextInline.cs deleted file mode 100644 index fa7a26b09..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/ItalicTextInline.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - using System.Collections.Generic; - - /// <summary> - /// Represents a span containing italic text. - /// </summary> - public class ItalicTextInline : MarkdownInline, IInlineContainer - { - /// <summary> - /// Initializes a new instance of the <see cref="ItalicTextInline"/> class. - /// </summary> - public ItalicTextInline() - : base(MarkdownInlineType.Italic) - { - } - - /// <summary> - /// Gets or sets the contents of the inline. - /// </summary> - public IList<MarkdownInline> Inlines { get; set; } - - /// <summary> - /// Returns the chars that if found means we might have a match. - /// </summary> - internal static void AddTripChars(List<InlineTripCharHelper> tripCharHelpers) - { - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '*', Method = InlineParseMethod.Italic }); - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '_', Method = InlineParseMethod.Italic }); - } - - /// <summary> - /// Attempts to parse a italic text span. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <returns> A parsed italic text span, or <c>null</c> if this is not a italic text span. </returns> - internal static InlineParseResult Parse(string markdown, int start, int maxEnd) - { - // Check the first char. - char startChar = markdown[start]; - if (start == maxEnd || (startChar != '*' && startChar != '_')) - { - return null; - } - - // Find the end of the span. The end character (either '*' or '_') must be the same as - // the start character. - var innerStart = start + 1; - int innerEnd = Common.IndexOf(markdown, startChar, start + 1, maxEnd); - if (innerEnd == -1) - { - return null; - } - - // The span must contain at least one character. - if (innerStart == innerEnd) - { - return null; - } - - // The first character inside the span must NOT be a space. - if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerStart])) - { - return null; - } - - // The last character inside the span must NOT be a space. - if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerEnd - 1])) - { - return null; - } - - // We found something! - var result = new ItalicTextInline - { - Inlines = Common.ParseInlineChildren(markdown, innerStart, innerEnd) - }; - return new InlineParseResult(result, start, innerEnd + 1); - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - if (Inlines == null) - { - return base.ToString(); - } - - return "*" + string.Join(string.Empty, Inlines) + "*"; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/LinkAnchorInline.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/LinkAnchorInline.cs deleted file mode 100644 index 30310d0b6..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/LinkAnchorInline.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - using System.Collections.Generic; - using System.Xml.Linq; - - /// <summary> - /// Represents a span that contains a reference for links to point to. - /// </summary> - public class LinkAnchorInline : MarkdownInline - { - internal LinkAnchorInline() - : base(MarkdownInlineType.LinkReference) - { - } - - /// <summary> - /// Gets or sets the Name of this Link Reference. - /// </summary> - public string Link { get; set; } - - /// <summary> - /// Gets or sets the raw Link Reference. - /// </summary> - public string Raw { get; set; } - - /// <summary> - /// Returns the chars that if found means we might have a match. - /// </summary> - internal static void AddTripChars(List<InlineTripCharHelper> tripCharHelpers) - { - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '<', Method = InlineParseMethod.LinkReference }); - } - - /// <summary> - /// Attempts to parse a comment span. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <returns> A parsed bold text span, or <c>null</c> if this is not a bold text span. </returns> - internal static InlineParseResult Parse(string markdown, int start, int maxEnd) - { - if (start >= maxEnd - 1) - { - return null; - } - - // Check the start sequence. - string startSequence = markdown.Substring(start, 2); - if (startSequence != "<a") - { - return null; - } - - // Find the end of the span. The end sequence ('-->') - var innerStart = start + 2; - int innerEnd = Common.IndexOf(markdown, "</a>", innerStart, maxEnd); - int trueEnd = innerEnd + 4; - if (innerEnd == -1) - { - innerEnd = Common.IndexOf(markdown, "/>", innerStart, maxEnd); - trueEnd = innerEnd + 2; - if (innerEnd == -1) - { - return null; - } - } - - // This link Reference wasn't closed properly if the next link starts before a close. - var nextLink = Common.IndexOf(markdown, "<a", innerStart, maxEnd); - if (nextLink > -1 && nextLink < innerEnd) - { - return null; - } - - var length = trueEnd - start; - var contents = markdown.Substring(start, length); - - string link = null; - - try - { - var xml = XElement.Parse(contents); - var attr = xml.Attribute("name"); - if (attr != null) - { - link = attr.Value; - } - } - catch - { - // Attempting to fetch link failed, ignore and continue. - } - - // Remove whitespace if it exists. - if (trueEnd + 1 <= maxEnd && markdown[trueEnd] == ' ') - { - trueEnd += 1; - } - - // We found something! - var result = new LinkAnchorInline - { - Raw = contents, - Link = link - }; - return new InlineParseResult(result, start, trueEnd); - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - return Raw; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/MarkdownLinkInline.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/MarkdownLinkInline.cs deleted file mode 100644 index c706325a0..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/MarkdownLinkInline.cs +++ /dev/null @@ -1,290 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - using Microsoft.Toolkit; - using System; - using System.Collections.Generic; - - /// <summary> - /// Represents a type of hyperlink where the text can be different from the target URL. - /// </summary> - public class MarkdownLinkInline : MarkdownInline, IInlineContainer, ILinkElement - { - /// <summary> - /// Initializes a new instance of the <see cref="MarkdownLinkInline"/> class. - /// </summary> - public MarkdownLinkInline() - : base(MarkdownInlineType.MarkdownLink) - { - } - - /// <summary> - /// Gets or sets the contents of the inline. - /// </summary> - public IList<MarkdownInline> Inlines { get; set; } - - /// <summary> - /// Gets or sets the link URL. - /// </summary> - public string Url { get; set; } - - /// <summary> - /// Gets or sets a tooltip to display on hover. - /// </summary> - public string Tooltip { get; set; } - - /// <summary> - /// Gets or sets the ID of a reference, if this is a reference-style link. - /// </summary> - public string ReferenceId { get; set; } - - /// <summary> - /// Returns the chars that if found means we might have a match. - /// </summary> - internal static void AddTripChars(List<InlineTripCharHelper> tripCharHelpers) - { - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '[', Method = InlineParseMethod.MarkdownLink }); - } - - /// <summary> - /// Attempts to parse a markdown link e.g. "[](http://www.reddit.com)". - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <returns> A parsed markdown link, or <c>null</c> if this is not a markdown link. </returns> - internal static InlineParseResult Parse(string markdown, int start, int maxEnd) - { - // Expect a '[' character. - if (start == maxEnd || markdown[start] != '[') - { - return null; - } - - // Find the ']' character, keeping in mind that [test [0-9]](http://www.test.com) is allowed. - int linkTextOpen = start + 1; - int pos = linkTextOpen; - int linkTextClose; - int openSquareBracketCount = 0; - while (true) - { - linkTextClose = markdown.IndexOfAny(new char[] { '[', ']' }, pos, maxEnd - pos); - if (linkTextClose == -1) - { - return null; - } - - if (markdown[linkTextClose] == '[') - { - openSquareBracketCount++; - } - else if (openSquareBracketCount > 0) - { - openSquareBracketCount--; - } - else - { - break; - } - - pos = linkTextClose + 1; - } - - // Skip whitespace. - pos = linkTextClose + 1; - while (pos < maxEnd && ParseHelpers.IsMarkdownWhiteSpace(markdown[pos])) - { - pos++; - } - - if (pos == maxEnd) - { - return null; - } - - // Expect the '(' character or the '[' character. - int linkOpen = pos; - if (markdown[pos] == '(') - { - // Skip whitespace. - linkOpen++; - while (linkOpen < maxEnd && ParseHelpers.IsMarkdownWhiteSpace(markdown[linkOpen])) - { - linkOpen++; - } - - // Find the ')' character. - pos = linkOpen; - int linkClose = -1; - var openParenthesis = 0; - while (pos < maxEnd) - { - if (markdown[pos] == ')') - { - if (openParenthesis == 0) - { - linkClose = pos; - break; - } - else - { - openParenthesis--; - } - } - - if (markdown[pos] == '(') - { - openParenthesis++; - } - - pos++; - } - - if (pos >= maxEnd) - { - return null; - } - - int end = linkClose + 1; - - // Skip whitespace backwards. - while (linkClose > linkOpen && ParseHelpers.IsMarkdownWhiteSpace(markdown[linkClose - 1])) - { - linkClose--; - } - - // If there is no text whatsoever, then this is not a valid link. - if (linkOpen == linkClose) - { - return null; - } - - // Check if there is tooltip text. - string url; - string tooltip = null; - bool lastUrlCharIsDoubleQuote = markdown[linkClose - 1] == '"'; - int tooltipStart = Common.IndexOf(markdown, " \"", linkOpen, linkClose - 1); - if (tooltipStart == linkOpen) - { - return null; - } - - if (lastUrlCharIsDoubleQuote && tooltipStart != -1) - { - // Extract the URL (resolving any escape sequences). - url = TextRunInline.ResolveEscapeSequences(markdown, linkOpen, tooltipStart).TrimEnd(' ', '\t', '\r', '\n'); - tooltip = markdown.Substring(tooltipStart + 2, (linkClose - 1) - (tooltipStart + 2)); - } - else - { - // Extract the URL (resolving any escape sequences). - url = TextRunInline.ResolveEscapeSequences(markdown, linkOpen, linkClose); - } - - // Check the URL is okay. - if (!url.IsEmail()) - { - if (!Common.IsUrlValid(url)) - { - return null; - } - } - else - { - tooltip = url = $"mailto:{url}"; - } - - // We found a regular stand-alone link. - var result = new MarkdownLinkInline - { - Inlines = Common.ParseInlineChildren(markdown, linkTextOpen, linkTextClose, ignoreLinks: true), - Url = url.Replace(" ", "%20", StringComparison.Ordinal), - Tooltip = tooltip - }; - return new InlineParseResult(result, start, end); - } - else if (markdown[pos] == '[') - { - // Find the ']' character. - int linkClose = Common.IndexOf(markdown, ']', pos + 1, maxEnd); - if (linkClose == -1) - { - return null; - } - - // We found a reference-style link. - var result = new MarkdownLinkInline - { - Inlines = Common.ParseInlineChildren(markdown, linkTextOpen, linkTextClose, ignoreLinks: true), - ReferenceId = markdown.Substring(linkOpen + 1, linkClose - (linkOpen + 1)) - }; - if (string.IsNullOrEmpty(result.ReferenceId)) - { - result.ReferenceId = markdown.Substring(linkTextOpen, linkTextClose - linkTextOpen); - } - - return new InlineParseResult(result, start, linkClose + 1); - } - - return null; - } - - /// <summary> - /// If this is a reference-style link, attempts to converts it to a regular link. - /// </summary> - /// <param name="document"> The document containing the list of references. </param> - internal void ResolveReference(MarkdownDocument document) - { - if (document == null) - { - throw new ArgumentNullException(nameof(document)); - } - - if (ReferenceId == null) - { - return; - } - - // Look up the reference ID. - var reference = document.LookUpReference(ReferenceId); - if (reference == null) - { - return; - } - - // The reference was found. Check the URL is valid. - if (!Common.IsUrlValid(reference.Url)) - { - return; - } - - // Everything is cool when you're part of a team. - Url = reference.Url; - Tooltip = reference.Tooltip; - ReferenceId = null; - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - if (Inlines == null || Url == null) - { - return base.ToString(); - } - - if (ReferenceId != null) - { - return $"[{string.Join(string.Empty, Inlines)}][{ReferenceId}]"; - } - - return $"[{string.Join(string.Empty, Inlines)}]({Url})"; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/StrikethroughTextInline.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/StrikethroughTextInline.cs deleted file mode 100644 index e99719405..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/StrikethroughTextInline.cs +++ /dev/null @@ -1,99 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - using System.Collections.Generic; - - /// <summary> - /// Represents a span containing strikethrough text. - /// </summary> - public class StrikethroughTextInline : MarkdownInline, IInlineContainer - { - /// <summary> - /// Initializes a new instance of the <see cref="StrikethroughTextInline"/> class. - /// </summary> - public StrikethroughTextInline() - : base(MarkdownInlineType.Strikethrough) - { - } - - /// <summary> - /// Gets or sets The contents of the inline. - /// </summary> - public IList<MarkdownInline> Inlines { get; set; } - - /// <summary> - /// Returns the chars that if found means we might have a match. - /// </summary> - internal static void AddTripChars(List<InlineTripCharHelper> tripCharHelpers) - { - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '~', Method = InlineParseMethod.Strikethrough }); - } - - /// <summary> - /// Attempts to parse a strikethrough text span. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <returns> A parsed strikethrough text span, or <c>null</c> if this is not a strikethrough text span. </returns> - internal static InlineParseResult Parse(string markdown, int start, int maxEnd) - { - // Check the start sequence. - if (start >= maxEnd - 1 || markdown.Substring(start, 2) != "~~") - { - return null; - } - - // Find the end of the span. - var innerStart = start + 2; - int innerEnd = Common.IndexOf(markdown, "~~", innerStart, maxEnd); - if (innerEnd == -1) - { - return null; - } - - // The span must contain at least one character. - if (innerStart == innerEnd) - { - return null; - } - - // The first character inside the span must NOT be a space. - if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerStart])) - { - return null; - } - - // The last character inside the span must NOT be a space. - if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerEnd - 1])) - { - return null; - } - - // We found something! - var result = new StrikethroughTextInline - { - Inlines = Common.ParseInlineChildren(markdown, innerStart, innerEnd) - }; - return new InlineParseResult(result, start, innerEnd + 2); - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - if (Inlines == null) - { - return base.ToString(); - } - - return "~~" + string.Join(string.Empty, Inlines) + "~~"; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/SubscriptTextInline.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/SubscriptTextInline.cs deleted file mode 100644 index c20d79c40..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/SubscriptTextInline.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - using System.Collections.Generic; - - /// <summary> - /// Represents a span containing subscript text. - /// </summary> - public class SubscriptTextInline : MarkdownInline, IInlineContainer - { - /// <summary> - /// Initializes a new instance of the <see cref="SubscriptTextInline"/> class. - /// </summary> - public SubscriptTextInline() - : base(MarkdownInlineType.Subscript) - { - } - - /// <summary> - /// Gets or sets the contents of the inline. - /// </summary> - public IList<MarkdownInline> Inlines { get; set; } - - /// <summary> - /// Returns the chars that if found means we might have a match. - /// </summary> - internal static void AddTripChars(List<InlineTripCharHelper> tripCharHelpers) - { - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '<', Method = InlineParseMethod.Subscript }); - } - - /// <summary> - /// Attempts to parse a subscript text span. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <returns> A parsed subscript text span, or <c>null</c> if this is not a subscript text span. </returns> - internal static InlineParseResult Parse(string markdown, int start, int maxEnd) - { - // Check the first character. - // e.g. "<sub>……</sub>" - if (maxEnd - start < 5) - { - return null; - } - - if (markdown.Substring(start, 5) != "<sub>") - { - return null; - } - - int innerStart = start + 5; - int innerEnd = Common.IndexOf(markdown, "</sub>", innerStart, maxEnd); - - // if don't have the end character or no character between start and end - if (innerEnd == -1 || innerEnd == innerStart) - { - return null; - } - - // No match if the character after the caret is a space. - if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerStart]) || ParseHelpers.IsMarkdownWhiteSpace(markdown[innerEnd - 1])) - { - return null; - } - - // We found something! - var result = new SubscriptTextInline - { - Inlines = Common.ParseInlineChildren(markdown, innerStart, innerEnd) - }; - return new InlineParseResult(result, start, innerEnd + 6); - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - if (Inlines == null) - { - return base.ToString(); - } - - return "<sub>" + string.Join(string.Empty, Inlines) + "</sub>"; - } - } -} diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/SuperscriptTextInline.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/SuperscriptTextInline.cs deleted file mode 100644 index d9c4ba858..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/SuperscriptTextInline.cs +++ /dev/null @@ -1,150 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - using System.Collections.Generic; - - /// <summary> - /// Represents a span containing superscript text. - /// </summary> - public class SuperscriptTextInline : MarkdownInline, IInlineContainer - { - /// <summary> - /// Initializes a new instance of the <see cref="SuperscriptTextInline"/> class. - /// </summary> - public SuperscriptTextInline() - : base(MarkdownInlineType.Superscript) - { - } - - /// <summary> - /// Gets or sets the contents of the inline. - /// </summary> - public IList<MarkdownInline> Inlines { get; set; } - - /// <summary> - /// Returns the chars that if found means we might have a match. - /// </summary> - internal static void AddTripChars(List<InlineTripCharHelper> tripCharHelpers) - { - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '^', Method = InlineParseMethod.Superscript }); - tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '<', Method = InlineParseMethod.Superscript }); - } - - /// <summary> - /// Attempts to parse a superscript text span. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="maxEnd"> The location to stop parsing. </param> - /// <returns> A parsed superscript text span, or <c>null</c> if this is not a superscript text span. </returns> - internal static InlineParseResult Parse(string markdown, int start, int maxEnd) - { - // Check the first character. - bool isHTMLSequence = false; - if (start == maxEnd || (markdown[start] != '^' && markdown[start] != '<')) - { - return null; - } - - if (markdown[start] != '^') - { - if (maxEnd - start < 5) - { - return null; - } - else if (markdown.Substring(start, 5) != "<sup>") - { - return null; - } - else - { - isHTMLSequence = true; - } - } - - if (isHTMLSequence) - { - int innerStart = start + 5; - int innerEnd, end; - innerEnd = Common.IndexOf(markdown, "</sup>", innerStart, maxEnd); - if (innerEnd == -1) - { - return null; - } - - if (innerEnd == innerStart) - { - return null; - } - - if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerStart]) || ParseHelpers.IsMarkdownWhiteSpace(markdown[innerEnd - 1])) - { - return null; - } - - // We found something! - end = innerEnd + 6; - var result = new SuperscriptTextInline - { - Inlines = Common.ParseInlineChildren(markdown, innerStart, innerEnd) - }; - return new InlineParseResult(result, start, end); - } - else - { - // The content might be enclosed in parentheses. - int innerStart = start + 1; - int innerEnd, end; - if (innerStart < maxEnd && markdown[innerStart] == '(') - { - // Find the end parenthesis. - innerStart++; - innerEnd = Common.IndexOf(markdown, ')', innerStart, maxEnd); - if (innerEnd == -1) - { - return null; - } - - end = innerEnd + 1; - } - else - { - // Search for the next whitespace character. - innerEnd = Common.FindNextWhiteSpace(markdown, innerStart, maxEnd, ifNotFoundReturnLength: true); - if (innerEnd == innerStart) - { - // No match if the character after the caret is a space. - return null; - } - - end = innerEnd; - } - - // We found something! - var result = new SuperscriptTextInline - { - Inlines = Common.ParseInlineChildren(markdown, innerStart, innerEnd) - }; - return new InlineParseResult(result, start, end); - } - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - if (Inlines == null) - { - return base.ToString(); - } - - return "^(" + string.Join(string.Empty, Inlines) + ")"; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/TextRunInline.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/TextRunInline.cs deleted file mode 100644 index 786c9daef..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Inlines/TextRunInline.cs +++ /dev/null @@ -1,470 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Inlines - -namespace Notepads.Controls.Markdown -{ - using System; - using System.Collections.Generic; - using System.Text; - - /// <summary> - /// Represents a span containing plain text. - /// </summary> - public class TextRunInline : MarkdownInline, IInlineLeaf - { - /// <summary> - /// Initializes a new instance of the <see cref="TextRunInline"/> class. - /// </summary> - public TextRunInline() - : base(MarkdownInlineType.TextRun) - { - } - - /// <summary> - /// Gets or sets the text for this run. - /// </summary> - public string Text { get; set; } - - // A list of supported HTML entity names, along with their corresponding code points. - private static readonly Dictionary<string, int> _entities = new Dictionary<string, int> - { - { "quot", 0x0022 }, // " - { "amp", 0x0026 }, // & - { "apos", 0x0027 }, // ' - { "lt", 0x003C }, // < - { "gt", 0x003E }, // > - { "nbsp", 0x00A0 }, // <space> - { "#160", 0x00A0 }, // ? - { "iexcl", 0x00A1 }, // ¡ - { "cent", 0x00A2 }, // ¢ - { "pound", 0x00A3 }, // £ - { "curren", 0x00A4 }, // ¤ - { "yen", 0x00A5 }, // ¥ - { "brvbar", 0x00A6 }, // ¦ - { "sect", 0x00A7 }, // § - { "uml", 0x00A8 }, // ¨ - { "copy", 0x00A9 }, // © - { "ordf", 0x00AA }, // ª - { "laquo", 0x00AB }, // « - { "not", 0x00AC }, // ¬ - { "shy", 0x00AD }, // ? - { "reg", 0x00AE }, // ® - { "macr", 0x00AF }, // ¯ - { "deg", 0x00B0 }, // ° - { "plusmn", 0x00B1 }, // ± - { "sup2", 0x00B2 }, // ² - { "sup3", 0x00B3 }, // ³ - { "acute", 0x00B4 }, // ´ - { "micro", 0x00B5 }, // µ - { "para", 0x00B6 }, // ¶ - { "middot", 0x00B7 }, // · - { "cedil", 0x00B8 }, // ¸ - { "sup1", 0x00B9 }, // ¹ - { "ordm", 0x00BA }, // º - { "raquo", 0x00BB }, // » - { "frac14", 0x00BC }, // ¼ - { "frac12", 0x00BD }, // ½ - { "frac34", 0x00BE }, // ¾ - { "iquest", 0x00BF }, // ¿ - { "Agrave", 0x00C0 }, // À - { "Aacute", 0x00C1 }, // Á - { "Acirc", 0x00C2 }, //  - { "Atilde", 0x00C3 }, // à - { "Auml", 0x00C4 }, // Ä - { "Aring", 0x00C5 }, // Å - { "AElig", 0x00C6 }, // Æ - { "Ccedil", 0x00C7 }, // Ç - { "Egrave", 0x00C8 }, // È - { "Eacute", 0x00C9 }, // É - { "Ecirc", 0x00CA }, // Ê - { "Euml", 0x00CB }, // Ë - { "Igrave", 0x00CC }, // Ì - { "Iacute", 0x00CD }, // Í - { "Icirc", 0x00CE }, // Î - { "Iuml", 0x00CF }, // Ï - { "ETH", 0x00D0 }, // Ð - { "Ntilde", 0x00D1 }, // Ñ - { "Ograve", 0x00D2 }, // Ò - { "Oacute", 0x00D3 }, // Ó - { "Ocirc", 0x00D4 }, // Ô - { "Otilde", 0x00D5 }, // Õ - { "Ouml", 0x00D6 }, // Ö - { "times", 0x00D7 }, // × - { "Oslash", 0x00D8 }, // Ø - { "Ugrave", 0x00D9 }, // Ù - { "Uacute", 0x00DA }, // Ú - { "Ucirc", 0x00DB }, // Û - { "Uuml", 0x00DC }, // Ü - { "Yacute", 0x00DD }, // Ý - { "THORN", 0x00DE }, // Þ - { "szlig", 0x00DF }, // ß - { "agrave", 0x00E0 }, // à - { "aacute", 0x00E1 }, // á - { "acirc", 0x00E2 }, // â - { "atilde", 0x00E3 }, // ã - { "auml", 0x00E4 }, // ä - { "aring", 0x00E5 }, // å - { "aelig", 0x00E6 }, // æ - { "ccedil", 0x00E7 }, // ç - { "egrave", 0x00E8 }, // è - { "eacute", 0x00E9 }, // é - { "ecirc", 0x00EA }, // ê - { "euml", 0x00EB }, // ë - { "igrave", 0x00EC }, // ì - { "iacute", 0x00ED }, // í - { "icirc", 0x00EE }, // î - { "iuml", 0x00EF }, // ï - { "eth", 0x00F0 }, // ð - { "ntilde", 0x00F1 }, // ñ - { "ograve", 0x00F2 }, // ò - { "oacute", 0x00F3 }, // ó - { "ocirc", 0x00F4 }, // ô - { "otilde", 0x00F5 }, // õ - { "ouml", 0x00F6 }, // ö - { "divide", 0x00F7 }, // ÷ - { "oslash", 0x00F8 }, // ø - { "ugrave", 0x00F9 }, // ù - { "uacute", 0x00FA }, // ú - { "ucirc", 0x00FB }, // û - { "uuml", 0x00FC }, // ü - { "yacute", 0x00FD }, // ý - { "thorn", 0x00FE }, // þ - { "yuml", 0x00FF }, // ÿ - { "OElig", 0x0152 }, // Œ - { "oelig", 0x0153 }, // œ - { "Scaron", 0x0160 }, // Š - { "scaron", 0x0161 }, // š - { "Yuml", 0x0178 }, // Ÿ - { "fnof", 0x0192 }, // ƒ - { "circ", 0x02C6 }, // ˆ - { "tilde", 0x02DC }, // ˜ - { "Alpha", 0x0391 }, // Α - { "Beta", 0x0392 }, // Β - { "Gamma", 0x0393 }, // Γ - { "Delta", 0x0394 }, // Δ - { "Epsilon", 0x0395 }, // Ε - { "Zeta", 0x0396 }, // Ζ - { "Eta", 0x0397 }, // Η - { "Theta", 0x0398 }, // Θ - { "Iota", 0x0399 }, // Ι - { "Kappa", 0x039A }, // Κ - { "Lambda", 0x039B }, // Λ - { "Mu", 0x039C }, // Μ - { "Nu", 0x039D }, // Ν - { "Xi", 0x039E }, // Ξ - { "Omicron", 0x039F }, // Ο - { "Pi", 0x03A0 }, // Π - { "Rho", 0x03A1 }, // Ρ - { "Sigma", 0x03A3 }, // Σ - { "Tau", 0x03A4 }, // Τ - { "Upsilon", 0x03A5 }, // Υ - { "Phi", 0x03A6 }, // Φ - { "Chi", 0x03A7 }, // Χ - { "Psi", 0x03A8 }, // Ψ - { "Omega", 0x03A9 }, // Ω - { "alpha", 0x03B1 }, // α - { "beta", 0x03B2 }, // β - { "gamma", 0x03B3 }, // γ - { "delta", 0x03B4 }, // δ - { "epsilon", 0x03B5 }, // ε - { "zeta", 0x03B6 }, // ζ - { "eta", 0x03B7 }, // η - { "theta", 0x03B8 }, // θ - { "iota", 0x03B9 }, // ι - { "kappa", 0x03BA }, // κ - { "lambda", 0x03BB }, // λ - { "mu", 0x03BC }, // μ - { "nu", 0x03BD }, // ν - { "xi", 0x03BE }, // ξ - { "omicron", 0x03BF }, // ο - { "pi", 0x03C0 }, // π - { "rho", 0x03C1 }, // ρ - { "sigmaf", 0x03C2 }, // ς - { "sigma", 0x03C3 }, // σ - { "tau", 0x03C4 }, // τ - { "upsilon", 0x03C5 }, // υ - { "phi", 0x03C6 }, // φ - { "chi", 0x03C7 }, // χ - { "psi", 0x03C8 }, // ψ - { "omega", 0x03C9 }, // ω - { "thetasym", 0x03D1 }, // ϑ - { "upsih", 0x03D2 }, // ϒ - { "piv", 0x03D6 }, // ϖ - { "ensp", 0x2002 }, // ? - { "emsp", 0x2003 }, // ? - { "thinsp", 0x2009 }, // ? - { "zwnj", 0x200C }, // ? - { "zwj", 0x200D }, // ? - { "lrm", 0x200E }, // ? - { "rlm", 0x200F }, // ? - { "ndash", 0x2013 }, // – - { "mdash", 0x2014 }, // — - { "lsquo", 0x2018 }, // ‘ - { "rsquo", 0x2019 }, // ’ - { "sbquo", 0x201A }, // ‚ - { "ldquo", 0x201C }, // “ - { "rdquo", 0x201D }, // ” - { "bdquo", 0x201E }, // „ - { "dagger", 0x2020 }, // † - { "Dagger", 0x2021 }, // ‡ - { "bull", 0x2022 }, // • - { "hellip", 0x2026 }, // … - { "permil", 0x2030 }, // ‰ - { "prime", 0x2032 }, // ′ - { "Prime", 0x2033 }, // ″ - { "lsaquo", 0x2039 }, // ‹ - { "rsaquo", 0x203A }, // › - { "oline", 0x203E }, // ‾ - { "frasl", 0x2044 }, // ⁄ - { "euro", 0x20AC }, // € - { "image", 0x2111 }, // ℑ - { "weierp", 0x2118 }, // ℘ - { "real", 0x211C }, // ℜ - { "trade", 0x2122 }, // ™ - { "alefsym", 0x2135 }, // ℵ - { "larr", 0x2190 }, // ← - { "uarr", 0x2191 }, // ↑ - { "rarr", 0x2192 }, // → - { "darr", 0x2193 }, // ↓ - { "harr", 0x2194 }, // ↔ - { "crarr", 0x21B5 }, // ↵ - { "lArr", 0x21D0 }, // ⇐ - { "uArr", 0x21D1 }, // ⇑ - { "rArr", 0x21D2 }, // ⇒ - { "dArr", 0x21D3 }, // ⇓ - { "hArr", 0x21D4 }, // ⇔ - { "forall", 0x2200 }, // ∀ - { "part", 0x2202 }, // ∂ - { "exist", 0x2203 }, // ∃ - { "empty", 0x2205 }, // ∅ - { "nabla", 0x2207 }, // ∇ - { "isin", 0x2208 }, // ∈ - { "notin", 0x2209 }, // ∉ - { "ni", 0x220B }, // ∋ - { "prod", 0x220F }, // ∏ - { "sum", 0x2211 }, // ∑ - { "minus", 0x2212 }, // − - { "lowast", 0x2217 }, // ∗ - { "radic", 0x221A }, // √ - { "prop", 0x221D }, // ∝ - { "infin", 0x221E }, // ∞ - { "ang", 0x2220 }, // ∠ - { "and", 0x2227 }, // ∧ - { "or", 0x2228 }, // ∨ - { "cap", 0x2229 }, // ∩ - { "cup", 0x222A }, // ∪ - { "int", 0x222B }, // ∫ - { "there4", 0x2234 }, // ∴ - { "sim", 0x223C }, // ∼ - { "cong", 0x2245 }, // ≅ - { "asymp", 0x2248 }, // ≈ - { "ne", 0x2260 }, // ≠ - { "equiv", 0x2261 }, // ≡ - { "le", 0x2264 }, // ≤ - { "ge", 0x2265 }, // ≥ - { "sub", 0x2282 }, // ⊂ - { "sup", 0x2283 }, // ⊃ - { "nsub", 0x2284 }, // ⊄ - { "sube", 0x2286 }, // ⊆ - { "supe", 0x2287 }, // ⊇ - { "oplus", 0x2295 }, // ⊕ - { "otimes", 0x2297 }, // ⊗ - { "perp", 0x22A5 }, // ⊥ - { "sdot", 0x22C5 }, // ⋅ - { "lceil", 0x2308 }, // ⌈ - { "rceil", 0x2309 }, // ⌉ - { "lfloor", 0x230A }, // ⌊ - { "rfloor", 0x230B }, // ⌋ - { "lang", 0x2329 }, // 〈 - { "rang", 0x232A }, // 〉 - { "loz", 0x25CA }, // ◊ - { "spades", 0x2660 }, // ♠ - { "clubs", 0x2663 }, // ♣ - { "hearts", 0x2665 }, // ♥ - { "diams", 0x2666 }, // ♦ - }; - - // A list of characters that can be escaped. - private static readonly char[] _escapeCharacters = new char[] { '\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '#', '+', '-', '.', '!', '|', '~', '^', '&', ':', '<', '>', '/' }; - - /// <summary> - /// Parses unformatted text. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="end"> The location to stop parsing. </param> - /// <returns> A parsed text span. </returns> - internal static TextRunInline Parse(string markdown, int start, int end) - { - // Handle escape sequences and entities. - // Note: this code is designed to be as fast as possible in the case where there are no - // escape sequences and no entities (expected to be the common case). - StringBuilder result = null; - int textPos = start; - int searchPos = start; - while (searchPos < end) - { - // Look for the next backslash. - int sequenceStartIndex = markdown.IndexOfAny(new char[] { '\\', '&' }, searchPos, end - searchPos); - if (sequenceStartIndex == -1) - { - break; - } - - searchPos = sequenceStartIndex + 1; - - char decodedChar; - if (markdown[sequenceStartIndex] == '\\') - { - // This is an escape sequence, with one more character expected. - if (sequenceStartIndex >= end - 1) - { - break; - } - - // Check if the character after the backslash can be escaped. - decodedChar = markdown[sequenceStartIndex + 1]; - if (Array.IndexOf(_escapeCharacters, decodedChar) < 0) - { - // This character cannot be escaped. - continue; - } - - // This here's an escape sequence! - if (result == null) - { - result = new StringBuilder(end - start); - } - - result.Append(markdown.Substring(textPos, sequenceStartIndex - textPos)); - result.Append(decodedChar); - searchPos = textPos = sequenceStartIndex + 2; - } - else if (markdown[sequenceStartIndex] == '&') - { - // This is an entity e.g. " ". - - // Look for the semicolon. - int semicolonIndex = markdown.IndexOf(';', sequenceStartIndex + 1, end - (sequenceStartIndex + 1)); - - // Unterminated entity. - if (semicolonIndex == -1) - { - continue; - } - - // Okay, we have an entity, but is it one we recognize? - string entityName = markdown.Substring(sequenceStartIndex + 1, semicolonIndex - (sequenceStartIndex + 1)); - - // Unrecognized entity. - if (_entities.ContainsKey(entityName) == false) - { - continue; - } - - // This here's an escape sequence! - if (result == null) - { - result = new StringBuilder(end - start); - } - - result.Append(markdown.Substring(textPos, sequenceStartIndex - textPos)); - result.Append((char)_entities[entityName]); - searchPos = textPos = semicolonIndex + 1; - } - } - - if (result != null) - { - result.Append(markdown.Substring(textPos, end - textPos)); - return new TextRunInline { Text = result.ToString() }; - } - - var length = end - start; - - // HACK: in case end < start happens - if (length <= 0) - { - return new TextRunInline { Text = string.Empty }; - } - - return new TextRunInline { Text = markdown.Substring(start, length) }; - } - - /// <summary> - /// Parses unformatted text. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The location to start parsing. </param> - /// <param name="end"> The location to stop parsing. </param> - /// <returns> A parsed text span. </returns> - internal static string ResolveEscapeSequences(string markdown, int start, int end) - { - // Handle escape sequences only. - // Note: this code is designed to be as fast as possible in the case where there are no - // escape sequences (expected to be the common case). - StringBuilder result = null; - int textPos = start; - int searchPos = start; - while (searchPos < end) - { - // Look for the next backslash. - int sequenceStartIndex = markdown.IndexOf('\\', searchPos, end - searchPos); - if (sequenceStartIndex == -1) - { - break; - } - - searchPos = sequenceStartIndex + 1; - - // This is an escape sequence, with one more character expected. - if (sequenceStartIndex >= end - 1) - { - break; - } - - // Check if the character after the backslash can be escaped. - char decodedChar = markdown[sequenceStartIndex + 1]; - if (Array.IndexOf(_escapeCharacters, decodedChar) < 0) - { - // This character cannot be escaped. - continue; - } - - // This here's an escape sequence! - if (result == null) - { - result = new StringBuilder(end - start); - } - - result.Append(markdown.Substring(textPos, sequenceStartIndex - textPos)); - result.Append(decodedChar); - searchPos = textPos = sequenceStartIndex + 2; - } - - if (result != null) - { - result.Append(markdown.Substring(textPos, end - textPos)); - return result.ToString(); - } - - return markdown.Substring(start, end - start); - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - if (Text == null) - { - return base.ToString(); - } - - return Text; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/MarkdownBlock.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/MarkdownBlock.cs deleted file mode 100644 index 2b5d3342d..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/MarkdownBlock.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// A Block Element is an element that is a container for other structures. - /// </summary> - public abstract class MarkdownBlock : MarkdownElement - { - /// <summary> - /// Gets or sets tells us what type this element is. - /// </summary> - public MarkdownBlockType Type { get; set; } - - /// <summary> - /// Initializes a new instance of the <see cref="MarkdownBlock"/> class. - /// </summary> - internal MarkdownBlock(MarkdownBlockType type) - { - Type = type; - } - - /// <summary> - /// Determines whether the specified object is equal to the current object. - /// </summary> - /// <param name="obj"> The object to compare with the current object. </param> - /// <returns> <c>true</c> if the specified object is equal to the current object; otherwise, <c>false.</c> </returns> - public override bool Equals(object obj) - { - if (!base.Equals(obj) || !(obj is MarkdownBlock)) - { - return false; - } - - return Type == ((MarkdownBlock)obj).Type; - } - - /// <summary> - /// Serves as the default hash function. - /// </summary> - /// <returns> A hash code for the current object. </returns> - public override int GetHashCode() - { - return base.GetHashCode() ^ Type.GetHashCode(); - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/MarkdownDocument.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/MarkdownDocument.cs deleted file mode 100644 index 934780aab..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/MarkdownDocument.cs +++ /dev/null @@ -1,417 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown - -namespace Notepads.Controls.Markdown -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Text; - - /// <summary> - /// Represents a Markdown Document. <para/> - /// Initialize an instance and call <see cref="Parse(string)"/> to parse the Raw Markdown Text. - /// </summary> - public class MarkdownDocument : MarkdownBlock - { - /// <summary> - /// Gets a list of URL schemes. - /// </summary> - public static List<string> KnownSchemes { get; private set; } = new List<string>() - { - "http", - "https", - "ftp", - "steam", - "irc", - "news", - "mumble", - "ssh", - "ms-windows-store", - "sip" - }; - - private Dictionary<string, LinkReferenceBlock> _references; - - /// <summary> - /// Initializes a new instance of the <see cref="MarkdownDocument"/> class. - /// </summary> - public MarkdownDocument() - : base(MarkdownBlockType.Root) - { - } - - /// <summary> - /// Gets or sets the list of block elements. - /// </summary> - public IList<MarkdownBlock> Blocks { get; set; } - - /// <summary> - /// Parses markdown document text. - /// </summary> - /// <param name="markdownText"> The markdown text. </param> - public void Parse(string markdownText) - { - Blocks = Parse(markdownText, 0, markdownText.Length, quoteDepth: 0, actualEnd: out _); - - // Remove any references from the list of blocks, and add them to a dictionary. - for (int i = Blocks.Count - 1; i >= 0; i--) - { - if (Blocks[i].Type == MarkdownBlockType.LinkReference) - { - var reference = (LinkReferenceBlock)Blocks[i]; - if (_references == null) - { - _references = new Dictionary<string, LinkReferenceBlock>(StringComparer.OrdinalIgnoreCase); - } - - if (!_references.ContainsKey(reference.Id)) - { - _references.Add(reference.Id, reference); - } - - Blocks.RemoveAt(i); - } - } - } - - /// <summary> - /// Parses a markdown document. - /// </summary> - /// <param name="markdown"> The markdown text. </param> - /// <param name="start"> The position to start parsing. </param> - /// <param name="end"> The position to stop parsing. </param> - /// <param name="quoteDepth"> The current nesting level for block quoting. </param> - /// <param name="actualEnd"> Set to the position at which parsing ended. This can be - /// different from <paramref name="end"/> when the parser is being called recursively. - /// </param> - /// <returns> A list of parsed blocks. </returns> - internal static List<MarkdownBlock> Parse(string markdown, int start, int end, int quoteDepth, out int actualEnd) - { - // We need to parse out the list of blocks. - // Some blocks need to start on a new paragraph (code, lists and tables) while other - // blocks can start on any line (headers, horizontal rules and quotes). - // Text that is outside of any other block becomes a paragraph. - var blocks = new List<MarkdownBlock>(); - int startOfLine = start; - bool lineStartsNewParagraph = true; - var paragraphText = new StringBuilder(); - - // These are needed to parse underline-style header blocks. - int previousRealtStartOfLine = start; - int previousStartOfLine = start; - int previousEndOfLine = start; - - // Go line by line. - while (startOfLine < end) - { - // Find the first non-whitespace character. - int nonSpacePos = startOfLine; - char nonSpaceChar = '\0'; - int realStartOfLine = startOfLine; // i.e. including quotes. - int expectedQuotesRemaining = quoteDepth; - while (true) - { - while (nonSpacePos < end) - { - char c = markdown[nonSpacePos]; - if (c == '\r' || c == '\n') - { - // The line is either entirely whitespace, or is empty. - break; - } - - if (c != ' ' && c != '\t') - { - // The line has content. - nonSpaceChar = c; - break; - } - - nonSpacePos++; - } - - // When parsing blocks in a blockquote context, we need to count the number of - // quote characters ('>'). If there are less than expected AND this is the - // start of a new paragraph, then stop parsing. - if (expectedQuotesRemaining == 0) - { - break; - } - - if (nonSpaceChar == '>') - { - // Expected block quote characters should be ignored. - expectedQuotesRemaining--; - nonSpacePos++; - nonSpaceChar = '\0'; - startOfLine = nonSpacePos; - - // Ignore the first space after the quote character, if there is one. - if (startOfLine < end && markdown[startOfLine] == ' ') - { - startOfLine++; - nonSpacePos++; - } - } - else - { - int lastIndentation = 0; - string lastline = null; - - // Determines how many Quote levels were in the last line. - if (realStartOfLine > 0) - { - lastline = markdown.Substring(previousRealtStartOfLine, previousEndOfLine - previousRealtStartOfLine); - lastIndentation = lastline.Count(c => c == '>'); - } - - var currentEndOfLine = Common.FindNextSingleNewLine(markdown, nonSpacePos, end, out _); - var currentline = markdown.Substring(realStartOfLine, currentEndOfLine - realStartOfLine); - var currentIndentation = currentline.Count(c => c == '>'); - var firstChar = markdown[realStartOfLine]; - - // This is a quote that doesn't start with a Quote marker, but carries on from the last line. - if (lastIndentation == 1) - { - if (nonSpaceChar != '\0' && firstChar != '>') - { - break; - } - } - - // Collapse down a level of quotes if the current indentation is greater than the last indentation. - // Only if the last indentation is greater than 1, and the current indentation is greater than 0 - if (lastIndentation > 1 && currentIndentation > 0 && currentIndentation < lastIndentation) - { - break; - } - - // This must be the end of the blockquote. End the current paragraph, if any. - actualEnd = realStartOfLine; - - if (paragraphText.Length > 0) - { - blocks.Add(ParagraphBlock.Parse(paragraphText.ToString())); - } - - return blocks; - } - } - - // Find the end of the current line. - int endOfLine = Common.FindNextSingleNewLine(markdown, nonSpacePos, end, out int startOfNextLine); - - if (nonSpaceChar == '\0') - { - // The line is empty or nothing but whitespace. - lineStartsNewParagraph = true; - - // End the current paragraph. - if (paragraphText.Length > 0) - { - blocks.Add(ParagraphBlock.Parse(paragraphText.ToString())); - paragraphText.Clear(); - } - } - else - { - // This is a header if the line starts with a hash character, - // or if the line starts with '-' or a '=' character and has no other characters. - // Or a quote if the line starts with a greater than character (optionally preceded by whitespace). - // Or a horizontal rule if the line contains nothing but 3 '*', '-' or '_' characters (with optional whitespace). - MarkdownBlock newBlockElement = null; - if (nonSpaceChar == '-' && nonSpacePos == startOfLine) - { - // Yaml Header - newBlockElement = YamlHeaderBlock.Parse(markdown, startOfLine, markdown.Length, out startOfLine); - if (newBlockElement != null) - { - realStartOfLine = startOfLine; - endOfLine = startOfLine + 3; - startOfNextLine = Common.FindNextSingleNewLine(markdown, startOfLine, end, out startOfNextLine); - - paragraphText.Clear(); - } - } - - if (newBlockElement == null && nonSpaceChar == '#' && nonSpacePos == startOfLine) - { - // Hash-prefixed header. - newBlockElement = HeaderBlock.ParseHashPrefixedHeader(markdown, startOfLine, endOfLine); - } - else if ((nonSpaceChar == '-' || nonSpaceChar == '=') && nonSpacePos == startOfLine && paragraphText.Length > 0) - { - // Underline style header. These are weird because you don't know you've - // got one until you've gone past it. - // Note: we intentionally deviate from reddit here in that we only - // recognize this type of header if the previous line is part of a - // paragraph. For example if you have this, the header at the bottom is - // ignored: - // a|b - // -|- - // 1|2 - // === - newBlockElement = HeaderBlock.ParseUnderlineStyleHeader(markdown, previousStartOfLine, previousEndOfLine, startOfLine, endOfLine); - - if (newBlockElement != null) - { - // We're going to have to remove the header text from the pending - // paragraph by prematurely ending the current paragraph. - // We already made sure that there is a paragraph in progress. - paragraphText.Length -= (previousEndOfLine - previousStartOfLine); - } - } - - // These characters overlap with the underline-style header - this check should go after that one. - if (newBlockElement == null && (nonSpaceChar == '*' || nonSpaceChar == '-' || nonSpaceChar == '_')) - { - newBlockElement = HorizontalRuleBlock.Parse(markdown, startOfLine, endOfLine); - } - - if (newBlockElement == null && lineStartsNewParagraph) - { - // Some block elements must start on a new paragraph (tables, lists and code). - int endOfBlock = startOfNextLine; - if (nonSpaceChar == '*' || nonSpaceChar == '+' || nonSpaceChar == '-' || (nonSpaceChar >= '0' && nonSpaceChar <= '9')) - { - newBlockElement = ListBlock.Parse(markdown, realStartOfLine, end, quoteDepth, out endOfBlock); - } - - if (newBlockElement == null && (nonSpacePos > startOfLine || nonSpaceChar == '`')) - { - newBlockElement = CodeBlock.Parse(markdown, realStartOfLine, end, quoteDepth, out endOfBlock); - } - - if (newBlockElement == null) - { - newBlockElement = TableBlock.Parse(markdown, realStartOfLine, endOfLine, end, quoteDepth, out endOfBlock); - } - - if (newBlockElement != null) - { - startOfNextLine = endOfBlock; - } - } - - // This check needs to go after the code block check. - if (newBlockElement == null && nonSpaceChar == '>') - { - newBlockElement = QuoteBlock.Parse(markdown, realStartOfLine, end, quoteDepth, out startOfNextLine); - } - - // This check needs to go after the code block check. - if (newBlockElement == null && nonSpaceChar == '[') - { - newBlockElement = LinkReferenceBlock.Parse(markdown, startOfLine, endOfLine); - } - - // Block elements start new paragraphs. - lineStartsNewParagraph = newBlockElement != null; - - if (newBlockElement == null) - { - // The line contains paragraph text. - if (paragraphText.Length > 0) - { - // If the previous two characters were both spaces, then append a line break. - if (paragraphText.Length > 2 && paragraphText[paragraphText.Length - 1] == ' ' && paragraphText[paragraphText.Length - 2] == ' ') - { - // Replace the two spaces with a line break. - paragraphText[paragraphText.Length - 2] = '\r'; - paragraphText[paragraphText.Length - 1] = '\n'; - } - else - { - paragraphText.Append(" "); - } - } - - // Add the last paragraph if we are at the end of the input text. - if (startOfNextLine >= end) - { - if (paragraphText.Length == 0) - { - // Optimize for single line paragraphs. - blocks.Add(ParagraphBlock.Parse(markdown.Substring(startOfLine, endOfLine - startOfLine))); - } - else - { - // Slow path. - paragraphText.Append(markdown.Substring(startOfLine, endOfLine - startOfLine)); - blocks.Add(ParagraphBlock.Parse(paragraphText.ToString())); - } - } - else - { - paragraphText.Append(markdown.Substring(startOfLine, endOfLine - startOfLine)); - } - } - else - { - // The line contained a block. End the current paragraph, if any. - if (paragraphText.Length > 0) - { - blocks.Add(ParagraphBlock.Parse(paragraphText.ToString())); - paragraphText.Clear(); - } - - blocks.Add(newBlockElement); - } - } - - // Repeat. - previousRealtStartOfLine = realStartOfLine; - previousStartOfLine = startOfLine; - previousEndOfLine = endOfLine; - startOfLine = startOfNextLine; - } - - actualEnd = startOfLine; - return blocks; - } - - /// <summary> - /// Looks up a reference using the ID. - /// A reference is a line that looks like this: - /// [foo]: http://example.com/ - /// </summary> - /// <param name="id"> The ID of the reference (case insensitive). </param> - /// <returns> The reference details, or <c>null</c> if the reference wasn't found. </returns> - public LinkReferenceBlock LookUpReference(string id) - { - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - - if (_references == null) - { - return null; - } - - if (_references.TryGetValue(id, out LinkReferenceBlock result)) - { - return result; - } - - return null; - } - - /// <summary> - /// Converts the object into it's textual representation. - /// </summary> - /// <returns> The textual representation of this object. </returns> - public override string ToString() - { - if (Blocks == null) - { - return base.ToString(); - } - - return string.Join("\r\n", Blocks); - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/MarkdownElement.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/MarkdownElement.cs deleted file mode 100644 index d01e7fa2f..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/MarkdownElement.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// This is a class used as the base class of all markdown elements. - /// </summary> - public abstract class MarkdownElement - { - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/MarkdownInline.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/MarkdownInline.cs deleted file mode 100644 index 29cff9116..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/MarkdownInline.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// An internal class that is the base class for all inline elements. - /// </summary> - public abstract class MarkdownInline : MarkdownElement - { - /// <summary> - /// Gets or sets this element is. - /// </summary> - public MarkdownInlineType Type { get; set; } - - /// <summary> - /// Initializes a new instance of the <see cref="MarkdownInline"/> class. - /// </summary> - internal MarkdownInline(MarkdownInlineType type) - { - Type = type; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/ICodeBlockResolver.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/ICodeBlockResolver.cs deleted file mode 100644 index 1b6dbaf27..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/ICodeBlockResolver.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock/Render - -namespace Notepads.Controls.Markdown -{ - using Windows.UI.Xaml.Documents; - - /// <summary> - /// A Parser to parse code strings into Syntax Highlighted text. - /// </summary> - public interface ICodeBlockResolver - { - /// <summary> - /// Parses Code Block text into Rich text. - /// </summary> - /// <param name="inlineCollection">Block to add formatted Text to.</param> - /// <param name="text">The raw code block text</param> - /// <param name="codeLanguage">The language of the Code Block, as specified by ```{Language} on the first line of the block, - /// e.g. <para/> - /// ```C# <para/> - /// public void Method();<para/> - /// ```<para/> - /// </param> - /// <returns>Parsing was handled Successfully</returns> - bool ParseSyntax(InlineCollection inlineCollection, string text, string codeLanguage); - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/IImageResolver.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/IImageResolver.cs deleted file mode 100644 index df6913498..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/IImageResolver.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock/Render - -namespace Notepads.Controls.Markdown -{ - using System.Threading.Tasks; - using Windows.UI.Xaml.Media; - - /// <summary> - /// An interface used to resolve images in the markdown. - /// </summary> - public interface IImageResolver - { - /// <summary> - /// Resolves an Image from a Url. - /// </summary> - /// <param name="url">Url to Resolve.</param> - /// <param name="tooltip">Tooltip for Image.</param> - /// <returns>Image</returns> - Task<ImageSource> ResolveImageAsync(string url, string tooltip); - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/ILinkRegister.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/ILinkRegister.cs deleted file mode 100644 index 61ba9362a..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/ILinkRegister.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock/Render - -namespace Notepads.Controls.Markdown -{ - using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Documents; - - /// <summary> - /// An interface used to handle links in the markdown. - /// </summary> - public interface ILinkRegister - { - /// <summary> - /// Registers a Hyperlink with a LinkUrl. - /// </summary> - /// <param name="newHyperlink">Hyperlink to Register.</param> - /// <param name="linkUrl">Url to Register.</param> - void RegisterNewHyperLink(Hyperlink newHyperlink, string linkUrl); - - /// <summary> - /// Registers a Hyperlink with a LinkUrl. - /// </summary> - /// <param name="newImagelink">ImageLink to Register.</param> - /// <param name="linkUrl">Url to Register.</param> - /// <param name="isHyperLink">Is Image an IsHyperlink.</param> - void RegisterNewHyperLink(Image newImagelink, string linkUrl, bool isHyperLink); - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/IRenderContext.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/IRenderContext.cs deleted file mode 100644 index 0ab994b18..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/IRenderContext.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Render - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// Helper for holding persistent state of Renderer. - /// </summary> - public interface IRenderContext - { - /// <summary> - /// Gets or sets a value indicating whether to trim whitespace. - /// </summary> - bool TrimLeadingWhitespace { get; set; } - - /// <summary> - /// Gets or sets the parent Element for this Context. - /// </summary> - object Parent { get; set; } - - /// <summary> - /// Clones the Context. - /// </summary> - /// <returns>Clone</returns> - IRenderContext Clone(); - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/InlineRenderContext.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/InlineRenderContext.cs deleted file mode 100644 index 4961f01a2..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/InlineRenderContext.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock/Render - -namespace Notepads.Controls.Markdown -{ - using Windows.UI.Xaml.Documents; - - /// <summary> - /// The Context of the Current Document Rendering. - /// </summary> - public class InlineRenderContext : RenderContext - { - internal InlineRenderContext(InlineCollection inlineCollection, IRenderContext context) - { - InlineCollection = inlineCollection; - TrimLeadingWhitespace = context.TrimLeadingWhitespace; - Parent = context.Parent; - - if (context is RenderContext localcontext) - { - Foreground = localcontext.Foreground; - OverrideForeground = localcontext.OverrideForeground; - } - - if (context is InlineRenderContext inlinecontext) - { - WithinBold = inlinecontext.WithinBold; - WithinItalics = inlinecontext.WithinItalics; - WithinHyperlink = inlinecontext.WithinHyperlink; - } - } - - /// <summary> - /// Gets or sets a value indicating whether the Current Element is being rendered inside an Italics Run. - /// </summary> - public bool WithinItalics { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether the Current Element is being rendered inside a Bold Run. - /// </summary> - public bool WithinBold { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether the Current Element is being rendered inside a Link. - /// </summary> - public bool WithinHyperlink { get; set; } - - /// <summary> - /// Gets or sets the list to add to. - /// </summary> - public InlineCollection InlineCollection { get; set; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.Blocks.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.Blocks.cs deleted file mode 100644 index b1fcae1d0..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.Blocks.cs +++ /dev/null @@ -1,475 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock/Render - -namespace Notepads.Controls.Markdown -{ - using System; - using System.Collections.Generic; - using Windows.UI.Text; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Documents; - using Windows.UI.Xaml.Shapes; - - /// <summary> - /// Block UI Methods for UWP UI Creation. - /// </summary> - public partial class MarkdownRenderer - { - /// <summary> - /// Renders a list of block elements. - /// </summary> - protected override void RenderBlocks(IEnumerable<MarkdownBlock> blockElements, IRenderContext context) - { - if (!(context is UIElementCollectionRenderContext localContext)) - { - throw new RenderContextIncorrectException(); - } - - var blockUIElementCollection = localContext.BlockUIElementCollection; - - base.RenderBlocks(blockElements, context); - - // Remove the top margin from the first block element, the bottom margin from the last block element, - // and collapse adjacent margins. - FrameworkElement previousFrameworkElement = null; - for (int i = 0; i < blockUIElementCollection.Count; i++) - { - var frameworkElement = blockUIElementCollection[i] as FrameworkElement; - if (frameworkElement != null) - { - if (i == 0) - { - // Remove the top margin. - frameworkElement.Margin = new Thickness( - frameworkElement.Margin.Left, - 0, - frameworkElement.Margin.Right, - frameworkElement.Margin.Bottom); - } - else if (previousFrameworkElement != null) - { - // Remove the bottom margin. - frameworkElement.Margin = new Thickness( - frameworkElement.Margin.Left, - Math.Max(frameworkElement.Margin.Top, previousFrameworkElement.Margin.Bottom), - frameworkElement.Margin.Right, - frameworkElement.Margin.Bottom); - previousFrameworkElement.Margin = new Thickness( - previousFrameworkElement.Margin.Left, - previousFrameworkElement.Margin.Top, - previousFrameworkElement.Margin.Right, - 0); - } - } - - previousFrameworkElement = frameworkElement; - } - } - - /// <summary> - /// Renders a paragraph element. - /// </summary> - protected override void RenderParagraph(ParagraphBlock element, IRenderContext context) - { - var paragraph = new Paragraph - { - Margin = ParagraphMargin, - LineHeight = ParagraphLineHeight - }; - - var childContext = new InlineRenderContext(paragraph.Inlines, context) - { - Parent = paragraph - }; - - RenderInlineChildren(element.Inlines, childContext); - - var textBlock = CreateOrReuseRichTextBlock(context); - textBlock.Blocks.Add(paragraph); - } - - /// <summary> - /// Renders a yaml header element. - /// </summary> - protected override void RenderYamlHeader(YamlHeaderBlock element, IRenderContext context) - { - if (!(context is UIElementCollectionRenderContext localContext)) - { - throw new RenderContextIncorrectException(); - } - - var blockUIElementCollection = localContext.BlockUIElementCollection; - - var table = new MarkdownTable(element.Children.Count, 2, YamlBorderThickness, YamlBorderBrush) - { - HorizontalAlignment = HorizontalAlignment.Left, - Margin = TableMargin - }; - - // Split key and value - string[] childrenKeys = new string[element.Children.Count]; - string[] childrenValues = new string[element.Children.Count]; - element.Children.Keys.CopyTo(childrenKeys, 0); - element.Children.Values.CopyTo(childrenValues, 0); - - // Add each column - for (int i = 0; i < element.Children.Count; i++) - { - // Add each cell - var keyCell = new TextBlock - { - Text = childrenKeys[i], - Foreground = Foreground, - TextAlignment = TextAlignment.Center, - FontWeight = FontWeights.Bold, - Margin = TableCellPadding - }; - var valueCell = new TextBlock - { - Text = childrenValues[i], - Foreground = Foreground, - TextAlignment = TextAlignment.Left, - Margin = TableCellPadding, - TextWrapping = TextWrapping.Wrap - }; - Grid.SetRow(keyCell, 0); - Grid.SetColumn(keyCell, i); - Grid.SetRow(valueCell, 1); - Grid.SetColumn(valueCell, i); - table.Children.Add(keyCell); - table.Children.Add(valueCell); - } - - blockUIElementCollection.Add(table); - } - - /// <summary> - /// Renders a header element. - /// </summary> - protected override void RenderHeader(HeaderBlock element, IRenderContext context) - { - var textBlock = CreateOrReuseRichTextBlock(context); - - var paragraph = new Paragraph(); - var childInlines = paragraph.Inlines; - switch (element.HeaderLevel) - { - case 1: - paragraph.Margin = Header1Margin; - paragraph.FontSize = Header1FontSize; - paragraph.FontWeight = Header1FontWeight; - paragraph.Foreground = Header1Foreground; - break; - - case 2: - paragraph.Margin = Header2Margin; - paragraph.FontSize = Header2FontSize; - paragraph.FontWeight = Header2FontWeight; - paragraph.Foreground = Header2Foreground; - break; - - case 3: - paragraph.Margin = Header3Margin; - paragraph.FontSize = Header3FontSize; - paragraph.FontWeight = Header3FontWeight; - paragraph.Foreground = Header3Foreground; - break; - - case 4: - paragraph.Margin = Header4Margin; - paragraph.FontSize = Header4FontSize; - paragraph.FontWeight = Header4FontWeight; - paragraph.Foreground = Header4Foreground; - break; - - case 5: - paragraph.Margin = Header5Margin; - paragraph.FontSize = Header5FontSize; - paragraph.FontWeight = Header5FontWeight; - paragraph.Foreground = Header5Foreground; - break; - - case 6: - paragraph.Margin = Header6Margin; - paragraph.FontSize = Header6FontSize; - paragraph.FontWeight = Header6FontWeight; - paragraph.Foreground = Header6Foreground; - - var underline = new Underline(); - childInlines = underline.Inlines; - paragraph.Inlines.Add(underline); - break; - } - - // Render the children into the para inline. - var childContext = new InlineRenderContext(childInlines, context) - { - Parent = paragraph, - TrimLeadingWhitespace = true - }; - - RenderInlineChildren(element.Inlines, childContext); - - // Add it to the blocks - textBlock.Blocks.Add(paragraph); - } - - /// <summary> - /// Renders a list element. - /// </summary> - protected override void RenderListElement(ListBlock element, IRenderContext context) - { - if (!(context is UIElementCollectionRenderContext localContext)) - { - throw new RenderContextIncorrectException(); - } - - var blockUIElementCollection = localContext.BlockUIElementCollection; - - // Create a grid with two columns. - Grid grid = new Grid - { - Margin = ListMargin - }; - - // The first column for the bullet (or number) and the second for the text. - grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(ListGutterWidth) }); - grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }); - - for (int rowIndex = 0; rowIndex < element.Items.Count; rowIndex++) - { - var listItem = element.Items[rowIndex]; - - // Add a row definition. - grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); - - // Add the bullet or number. - var bullet = CreateTextBlock(localContext); - bullet.Margin = ParagraphMargin; - switch (element.Style) - { - case ListStyle.Bulleted: - bullet.Text = "•"; - break; - - case ListStyle.Numbered: - bullet.Text = $"{rowIndex + 1}."; - break; - } - - bullet.HorizontalAlignment = HorizontalAlignment.Right; - bullet.Margin = new Thickness(0, 0, ListBulletSpacing, 0); - Grid.SetRow(bullet, rowIndex); - grid.Children.Add(bullet); - - // Add the list item content. - var content = new StackPanel(); - var childContext = new UIElementCollectionRenderContext(content.Children, localContext); - RenderBlocks(listItem.Blocks, childContext); - Grid.SetColumn(content, 1); - Grid.SetRow(content, rowIndex); - grid.Children.Add(content); - } - - blockUIElementCollection.Add(grid); - } - - /// <summary> - /// Renders a horizontal rule element. - /// </summary> - protected override void RenderHorizontalRule(IRenderContext context) - { - if (!(context is UIElementCollectionRenderContext localContext)) - { - throw new RenderContextIncorrectException(); - } - - var blockUIElementCollection = localContext.BlockUIElementCollection; - - var brush = localContext.Foreground; - if (HorizontalRuleBrush != null && !localContext.OverrideForeground) - { - brush = HorizontalRuleBrush; - } - - var rectangle = new Rectangle - { - HorizontalAlignment = HorizontalAlignment.Stretch, - Height = HorizontalRuleThickness, - Fill = brush, - Margin = HorizontalRuleMargin - }; - - blockUIElementCollection.Add(rectangle); - } - - /// <summary> - /// Renders a quote element. - /// </summary> - protected override void RenderQuote(QuoteBlock element, IRenderContext context) - { - if (!(context is UIElementCollectionRenderContext localContext)) - { - throw new RenderContextIncorrectException(); - } - - var blockUIElementCollection = localContext.BlockUIElementCollection; - - var stackPanel = new StackPanel(); - var childContext = new UIElementCollectionRenderContext(stackPanel.Children, context) - { - Parent = stackPanel - }; - - if (QuoteForeground != null && !localContext.OverrideForeground) - { - childContext.Foreground = QuoteForeground; - } - - RenderBlocks(element.Blocks, childContext); - - var border = new Border - { - Margin = QuoteMargin, - Background = QuoteBackground, - BorderBrush = childContext.OverrideForeground ? childContext.Foreground : QuoteBorderBrush ?? childContext.Foreground, - BorderThickness = QuoteBorderThickness, - Padding = QuotePadding, - Child = stackPanel - }; - - blockUIElementCollection.Add(border); - } - - /// <summary> - /// Renders a code element. - /// </summary> - protected override void RenderCode(CodeBlock element, IRenderContext context) - { - if (!(context is UIElementCollectionRenderContext localContext)) - { - throw new RenderContextIncorrectException(); - } - - var blockUIElementCollection = localContext.BlockUIElementCollection; - - var brush = localContext.Foreground; - if (CodeForeground != null && !localContext.OverrideForeground) - { - brush = CodeForeground; - } - - var textBlock = new RichTextBlock - { - FontFamily = CodeFontFamily ?? FontFamily, - Foreground = brush, - LineHeight = FontSize * 1.4, - FlowDirection = FlowDirection - }; - - textBlock.PointerWheelChanged += Preventative_PointerWheelChanged; - - var paragraph = new Paragraph(); - textBlock.Blocks.Add(paragraph); - - // Allows external Syntax Highlighting - var hasCustomSyntax = CodeBlockResolver.ParseSyntax(paragraph.Inlines, element.Text, element.CodeLanguage); - if (!hasCustomSyntax) - { - paragraph.Inlines.Add(new Run { Text = element.Text }); - } - - // Ensures that Code has Horizontal Scroll and doesn't wrap. - var viewer = new ScrollViewer - { - Background = CodeBackground, - BorderBrush = CodeBorderBrush, - BorderThickness = CodeBorderThickness, - Padding = CodePadding, - Margin = CodeMargin, - Content = textBlock - }; - - if (!WrapCodeBlock) - { - viewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; - viewer.HorizontalScrollMode = ScrollMode.Auto; - viewer.VerticalScrollMode = ScrollMode.Disabled; - viewer.VerticalScrollBarVisibility = ScrollBarVisibility.Disabled; - } - - // Add it to the blocks - blockUIElementCollection.Add(viewer); - } - - /// <summary> - /// Renders a table element. - /// </summary> - protected override void RenderTable(TableBlock element, IRenderContext context) - { - if (!(context is UIElementCollectionRenderContext localContext)) - { - throw new RenderContextIncorrectException(); - } - - var blockUIElementCollection = localContext.BlockUIElementCollection; - - var table = new MarkdownTable(element.ColumnDefinitions.Count, element.Rows.Count, TableBorderThickness, TableBorderBrush) - { - HorizontalAlignment = HorizontalAlignment.Left, - Margin = TableMargin - }; - - // Add each row. - for (int rowIndex = 0; rowIndex < element.Rows.Count; rowIndex++) - { - var row = element.Rows[rowIndex]; - - // Add each cell. - for (int cellIndex = 0; cellIndex < Math.Min(element.ColumnDefinitions.Count, row.Cells.Count); cellIndex++) - { - var cell = row.Cells[cellIndex]; - - // Cell content. - var cellContent = CreateOrReuseRichTextBlock(new UIElementCollectionRenderContext(null, context)); - cellContent.Margin = TableCellPadding; - Grid.SetRow(cellContent, rowIndex); - Grid.SetColumn(cellContent, cellIndex); - switch (element.ColumnDefinitions[cellIndex].Alignment) - { - case ColumnAlignment.Center: - cellContent.TextAlignment = TextAlignment.Center; - break; - - case ColumnAlignment.Right: - cellContent.TextAlignment = TextAlignment.Right; - break; - } - - if (rowIndex == 0) - { - cellContent.FontWeight = FontWeights.Bold; - } - - var paragraph = new Paragraph(); - - var childContext = new InlineRenderContext(paragraph.Inlines, context) - { - Parent = paragraph, - TrimLeadingWhitespace = true - }; - - RenderInlineChildren(cell.Inlines, childContext); - - cellContent.Blocks.Add(paragraph); - table.Children.Add(cellContent); - } - } - - blockUIElementCollection.Add(table); - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.Dimensions.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.Dimensions.cs deleted file mode 100644 index 343a97193..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.Dimensions.cs +++ /dev/null @@ -1,227 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock/Render - -namespace Notepads.Controls.Markdown -{ - using Windows.UI.Text; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Media; - - /// <summary> - /// Measurement Properties for elements in the Markdown. - /// </summary> - public partial class MarkdownRenderer - { - /// <summary> - /// Gets or sets the distance between the border and its child object. - /// </summary> - public Thickness Padding { get; set; } - - /// <summary> - /// Gets or sets the border thickness of a control. - /// </summary> - public Thickness BorderThickness { get; set; } - - /// <summary> - /// Gets or sets the thickness of the border around code blocks. - /// </summary> - public Thickness CodeBorderThickness { get; set; } - - /// <summary> - /// Gets or sets the thickness of the border around inline code. - /// </summary> - public Thickness InlineCodeBorderThickness { get; set; } - - /// <summary> - /// Gets or sets the space outside of code blocks. - /// </summary> - public Thickness CodeMargin { get; set; } - - /// <summary> - /// Gets or sets the space between the code border and the text. - /// </summary> - public Thickness CodePadding { get; set; } - - /// <summary> - /// Gets or sets the space between the code border and the text. - /// </summary> - public Thickness InlineCodePadding { get; set; } - - /// <summary> - /// Gets or sets the margin of inline code. - /// </summary> - public Thickness InlineCodeMargin { get; set; } - - /// <summary> - /// Gets or sets the font size for level 1 headers. - /// </summary> - public double Header1FontSize { get; set; } - - /// <summary> - /// Gets or sets the margin for level 1 headers. - /// </summary> - public Thickness Header1Margin { get; set; } - - /// <summary> - /// Gets or sets the font size for level 2 headers. - /// </summary> - public double Header2FontSize { get; set; } - - /// <summary> - /// Gets or sets the margin for level 2 headers. - /// </summary> - public Thickness Header2Margin { get; set; } - - /// <summary> - /// Gets or sets the font size for level 3 headers. - /// </summary> - public double Header3FontSize { get; set; } - - /// <summary> - /// Gets or sets the margin for level 3 headers. - /// </summary> - public Thickness Header3Margin { get; set; } - - /// <summary> - /// Gets or sets the font size for level 4 headers. - /// </summary> - public double Header4FontSize { get; set; } - - /// <summary> - /// Gets or sets the margin for level 4 headers. - /// </summary> - public Thickness Header4Margin { get; set; } - - /// <summary> - /// Gets or sets the font size for level 5 headers. - /// </summary> - public double Header5FontSize { get; set; } - - /// <summary> - /// Gets or sets the margin for level 5 headers. - /// </summary> - public Thickness Header5Margin { get; set; } - - /// <summary> - /// Gets or sets the font size for level 6 headers. - /// </summary> - public double Header6FontSize { get; set; } - - /// <summary> - /// Gets or sets the margin for level 6 headers. - /// </summary> - public Thickness Header6Margin { get; set; } - - /// <summary> - /// Gets or sets the margin used for horizontal rules. - /// </summary> - public Thickness HorizontalRuleMargin { get; set; } - - /// <summary> - /// Gets or sets the vertical thickness of the horizontal rule. - /// </summary> - public double HorizontalRuleThickness { get; set; } - - /// <summary> - /// Gets or sets the margin used by lists. - /// </summary> - public Thickness ListMargin { get; set; } - - /// <summary> - /// Gets or sets the width of the space used by list item bullets/numbers. - /// </summary> - public double ListGutterWidth { get; set; } - - /// <summary> - /// Gets or sets the space between the list item bullets/numbers and the list item content. - /// </summary> - public double ListBulletSpacing { get; set; } - - /// <summary> - /// Gets or sets the margin used for paragraphs. - /// </summary> - public Thickness ParagraphMargin { get; set; } - - /// <summary> - /// Gets or sets the line height used for paragraphs. - /// </summary> - public int ParagraphLineHeight { get; set; } - - /// <summary> - /// Gets or sets the thickness of quote borders. - /// </summary> - public Thickness QuoteBorderThickness { get; set; } - - /// <summary> - /// Gets or sets the space outside of quote borders. - /// </summary> - public Thickness QuoteMargin { get; set; } - - /// <summary> - /// Gets or sets the space between the quote border and the text. - /// </summary> - public Thickness QuotePadding { get; set; } - - /// <summary> - /// Gets or sets the thickness of any table borders. - /// </summary> - public double TableBorderThickness { get; set; } - - /// <summary> - /// Gets or sets the thickness of any yaml header borders. - /// </summary> - public double YamlBorderThickness { get; set; } - - /// <summary> - /// Gets or sets the padding inside each cell. - /// </summary> - public Thickness TableCellPadding { get; set; } - - /// <summary> - /// Gets or sets the margin used by tables. - /// </summary> - public Thickness TableMargin { get; set; } - - /// <summary> - /// Gets or sets the size of the text in this control. - /// </summary> - public double FontSize { get; set; } - - /// <summary> - /// Gets or sets the uniform spacing between characters, in units of 1/1000 of an em. - /// </summary> - public int CharacterSpacing { get; set; } - - /// <summary> - /// Gets or sets the word wrapping behavior. - /// </summary> - public TextWrapping TextWrapping { get; set; } - - /// <summary> - /// Gets or sets the degree to which a font is condensed or expanded on the screen. - /// </summary> - public FontStretch FontStretch { get; set; } - - /// <summary> - /// Gets or sets the stretch used for images. - /// </summary> - public Stretch ImageStretch { get; set; } - - /// <summary> - /// Gets or sets the MaxHeight for images. - /// </summary> - public double ImageMaxHeight { get; set; } - - /// <summary> - /// Gets or sets the MaxWidth for images. - /// </summary> - public double ImageMaxWidth { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether to wrap text in the Code Block, or use Horizontal Scroll. - /// </summary> - public bool WrapCodeBlock { get; set; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.Inlines.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.Inlines.cs deleted file mode 100644 index f40472fec..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.Inlines.cs +++ /dev/null @@ -1,595 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock/Render - -namespace Notepads.Controls.Markdown -{ - using System.Collections.Generic; - using System.Text; - using Windows.UI.Text; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Documents; - using Windows.UI.Xaml.Media; - - /// <summary> - /// Inline UI Methods for UWP UI Creation. - /// </summary> - public partial class MarkdownRenderer - { - /// <summary> - /// Renders Emoji element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected override void RenderEmoji(EmojiInline element, IRenderContext context) - { - if (!(context is InlineRenderContext localContext)) - { - throw new RenderContextIncorrectException(); - } - - var inlineCollection = localContext.InlineCollection; - - var emoji = new Run - { - FontFamily = EmojiFontFamily ?? DefaultEmojiFont, - Text = element.Text - }; - - inlineCollection.Add(emoji); - } - - /// <summary> - /// Renders a text run element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected override void RenderTextRun(TextRunInline element, IRenderContext context) - { - InternalRenderTextRun(element, context); - } - - private Run InternalRenderTextRun(TextRunInline element, IRenderContext context) - { - if (!(context is InlineRenderContext localContext)) - { - throw new RenderContextIncorrectException(); - } - - var inlineCollection = localContext.InlineCollection; - - // Create the text run - Run textRun = new Run - { - Text = CollapseWhitespace(context, element.Text) - }; - - // Add it - inlineCollection.Add(textRun); - return textRun; - } - - /// <summary> - /// Renders a bold run element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected override void RenderBoldRun(BoldTextInline element, IRenderContext context) - { - if (!(context is InlineRenderContext localContext)) - { - throw new RenderContextIncorrectException(); - } - - // Create the text run - Span boldSpan = new Span - { - FontWeight = FontWeights.Bold - }; - - var childContext = new InlineRenderContext(boldSpan.Inlines, context) - { - Parent = boldSpan, - WithinBold = true - }; - - // Render the children into the bold inline. - RenderInlineChildren(element.Inlines, childContext); - - // Add it to the current inline collection - localContext.InlineCollection.Add(boldSpan); - } - - /// <summary> - /// Renders a link element - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected override void RenderMarkdownLink(MarkdownLinkInline element, IRenderContext context) - { - if (!(context is InlineRenderContext localContext)) - { - throw new RenderContextIncorrectException(); - } - - // HACK: Superscript is not allowed within a hyperlink. But if we switch it around, so - // that the superscript is outside the hyperlink, then it will render correctly. - // This assumes that the entire hyperlink is to be rendered as superscript. - if (AllTextIsSuperscript(element) == false) - { - // Regular ol' hyperlink. - var link = new Hyperlink(); - - // Register the link - LinkRegister.RegisterNewHyperLink(link, element.Url); - - // Remove superscripts. - RemoveSuperscriptRuns(element, insertCaret: true); - - // Render the children into the link inline. - var childContext = new InlineRenderContext(link.Inlines, context) - { - Parent = link, - WithinHyperlink = true - }; - - if (localContext.OverrideForeground) - { - link.Foreground = localContext.Foreground; - } - else if (LinkForeground != null) - { - link.Foreground = LinkForeground; - } - - RenderInlineChildren(element.Inlines, childContext); - context.TrimLeadingWhitespace = childContext.TrimLeadingWhitespace; - - ToolTipService.SetToolTip(link, element.Tooltip ?? element.Url); - - // Add it to the current inlines - localContext.InlineCollection.Add(link); - } - else - { - // THE HACK IS ON! - - // Create a fake superscript element. - var fakeSuperscript = new SuperscriptTextInline - { - Inlines = new List<MarkdownInline> - { - element - } - }; - - // Remove superscripts. - RemoveSuperscriptRuns(element, insertCaret: false); - - // Now render it. - RenderSuperscriptRun(fakeSuperscript, context); - } - } - - /// <summary> - /// Renders a raw link element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected override void RenderHyperlink(HyperlinkInline element, IRenderContext context) - { - if (!(context is InlineRenderContext localContext)) - { - throw new RenderContextIncorrectException(); - } - - var link = new Hyperlink(); - - // Register the link - LinkRegister.RegisterNewHyperLink(link, element.Url); - - var brush = localContext.Foreground; - if (LinkForeground != null && !localContext.OverrideForeground) - { - brush = LinkForeground; - } - - // Make a text block for the link - Run linkText = new Run - { - Text = CollapseWhitespace(context, element.Text), - Foreground = brush - }; - - link.Inlines.Add(linkText); - - try - { - //Add it to the current inline collection - localContext.InlineCollection.Add(link); - } - catch // Invalid hyperlink - { - link.Inlines.Clear(); - } - } - - /// <summary> - /// Renders an image element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected override async void RenderImage(ImageInline element, IRenderContext context) - { - if (!(context is InlineRenderContext localContext)) - { - throw new RenderContextIncorrectException(); - } - - var inlineCollection = localContext.InlineCollection; - - var placeholder = InternalRenderTextRun(new TextRunInline { Text = element.Text, Type = MarkdownInlineType.TextRun }, context); - var resolvedImage = await ImageResolver.ResolveImageAsync(element.RenderUrl, element.Tooltip); - - // if image can not be resolved we have to return - if (resolvedImage == null) - { - return; - } - - var image = new Image - { - Source = resolvedImage, - HorizontalAlignment = HorizontalAlignment.Left, - VerticalAlignment = VerticalAlignment.Top, - Stretch = ImageStretch - }; - - HyperlinkButton hyperlinkButton = new HyperlinkButton() - { - Content = image - }; - - var viewbox = new Viewbox - { - Child = hyperlinkButton, - StretchDirection = StretchDirection.DownOnly - }; - - viewbox.PointerWheelChanged += Preventative_PointerWheelChanged; - - var scrollViewer = new ScrollViewer - { - Content = viewbox, - VerticalScrollMode = ScrollMode.Disabled, - VerticalScrollBarVisibility = ScrollBarVisibility.Disabled - }; - - var imageContainer = new InlineUIContainer() { Child = scrollViewer }; - - bool ishyperlink = element.RenderUrl != element.Url; - - LinkRegister.RegisterNewHyperLink(image, element.Url, ishyperlink); - - if (ImageMaxHeight > 0) - { - viewbox.MaxHeight = ImageMaxHeight; - } - - if (ImageMaxWidth > 0) - { - viewbox.MaxWidth = ImageMaxWidth; - } - - if (element.ImageWidth > 0) - { - image.Width = element.ImageWidth; - image.Stretch = Stretch.UniformToFill; - } - - if (element.ImageHeight > 0) - { - if (element.ImageWidth == 0) - { - image.Width = element.ImageHeight; - } - - image.Height = element.ImageHeight; - image.Stretch = Stretch.UniformToFill; - } - - if (element.ImageHeight > 0 && element.ImageWidth > 0) - { - image.Stretch = Stretch.Fill; - } - - // If image size is given then scroll to view overflown part - if (element.ImageHeight > 0 || element.ImageWidth > 0) - { - scrollViewer.HorizontalScrollMode = ScrollMode.Auto; - scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; - } - - // Else resize the image - else - { - scrollViewer.HorizontalScrollMode = ScrollMode.Disabled; - scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled; - } - - ToolTipService.SetToolTip(image, element.Tooltip); - - // Try to add it to the current inlines - // Could fail because some containers like Hyperlink cannot have inlined images - try - { - var placeholderIndex = inlineCollection.IndexOf(placeholder); - inlineCollection.Remove(placeholder); - inlineCollection.Insert(placeholderIndex, imageContainer); - } - catch - { - // Ignore error - } - } - - /// <summary> - /// Renders a text run element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected override void RenderItalicRun(ItalicTextInline element, IRenderContext context) - { - if (!(context is InlineRenderContext localContext)) - { - throw new RenderContextIncorrectException(); - } - - // Create the text run - Span italicSpan = new Span - { - FontStyle = FontStyle.Italic - }; - - var childContext = new InlineRenderContext(italicSpan.Inlines, context) - { - Parent = italicSpan, - WithinItalics = true - }; - - // Render the children into the italic inline. - RenderInlineChildren(element.Inlines, childContext); - - // Add it to the current inlines - localContext.InlineCollection.Add(italicSpan); - } - - /// <summary> - /// Renders a strike-through element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected override void RenderStrikethroughRun(StrikethroughTextInline element, IRenderContext context) - { - if (!(context is InlineRenderContext localContext)) - { - throw new RenderContextIncorrectException(); - } - - Span span = new Span(); - - if (TextDecorationsSupported) - { - span.TextDecorations = TextDecorations.Strikethrough; - } - else - { - span.FontFamily = new FontFamily("Consolas"); - } - - var childContext = new InlineRenderContext(span.Inlines, context) - { - Parent = span - }; - - // Render the children into the inline. - RenderInlineChildren(element.Inlines, childContext); - - if (!TextDecorationsSupported) - { - AlterChildRuns(span, (parentSpan, run) => - { - var text = run.Text; - var builder = new StringBuilder(text.Length * 2); - foreach (var c in text) - { - builder.Append((char)0x0336); - builder.Append(c); - } - - run.Text = builder.ToString(); - }); - } - - // Add it to the current inlines - localContext.InlineCollection.Add(span); - } - - /// <summary> - /// Renders a superscript element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected override void RenderSuperscriptRun(SuperscriptTextInline element, IRenderContext context) - { - var localContext = context as InlineRenderContext; - var parent = localContext?.Parent as TextElement; - if (localContext == null && parent == null) - { - throw new RenderContextIncorrectException(); - } - - // Le <sigh>, InlineUIContainers are not allowed within hyperlinks. - if (localContext.WithinHyperlink) - { - RenderInlineChildren(element.Inlines, context); - return; - } - - var paragraph = new Paragraph - { - FontSize = parent.FontSize * 0.8, - FontFamily = parent.FontFamily, - FontStyle = parent.FontStyle, - FontWeight = parent.FontWeight - }; - - var childContext = new InlineRenderContext(paragraph.Inlines, context) - { - Parent = paragraph - }; - - RenderInlineChildren(element.Inlines, childContext); - - var richTextBlock = CreateOrReuseRichTextBlock(new UIElementCollectionRenderContext(null, context)); - richTextBlock.Blocks.Add(paragraph); - - var border = new Border - { - Padding = new Thickness(0, 0, 0, paragraph.FontSize * 0.2), - Child = richTextBlock - }; - - var inlineUIContainer = new InlineUIContainer - { - Child = border - }; - - // Add it to the current inlines - localContext.InlineCollection.Add(inlineUIContainer); - } - - /// <summary> - /// Renders a subscript element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected override void RenderSubscriptRun(SubscriptTextInline element, IRenderContext context) - { - var localContext = context as InlineRenderContext; - var parent = localContext?.Parent as TextElement; - if (localContext == null && parent == null) - { - throw new RenderContextIncorrectException(); - } - - var paragraph = new Paragraph - { - FontSize = parent.FontSize * 0.7, - FontFamily = parent.FontFamily, - FontStyle = parent.FontStyle, - FontWeight = parent.FontWeight - }; - - var childContext = new InlineRenderContext(paragraph.Inlines, context) - { - Parent = paragraph - }; - - RenderInlineChildren(element.Inlines, childContext); - - var richTextBlock = CreateOrReuseRichTextBlock(new UIElementCollectionRenderContext(null, context)); - richTextBlock.Blocks.Add(paragraph); - - var border = new Border - { - Margin = new Thickness(0, 0, 0, (-1) * (paragraph.FontSize * 0.6)), - Child = richTextBlock - }; - - var inlineUIContainer = new InlineUIContainer - { - Child = border - }; - - // Add it to the current inlines - localContext.InlineCollection.Add(inlineUIContainer); - } - - /// <summary> - /// Renders a code element - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected override void RenderCodeRun(CodeInline element, IRenderContext context) - { - if (!(context is InlineRenderContext localContext)) - { - throw new RenderContextIncorrectException(); - } - - var text = CreateTextBlock(localContext); - text.Text = CollapseWhitespace(context, element.Text); - text.FontFamily = InlineCodeFontFamily ?? FontFamily; - text.Foreground = InlineCodeForeground ?? Foreground; - - if (localContext.WithinItalics) - { - text.FontStyle = FontStyle.Italic; - } - - if (localContext.WithinBold) - { - text.FontWeight = FontWeights.Bold; - } - - var borderthickness = InlineCodeBorderThickness; - var padding = InlineCodePadding; - - var border = new Border - { - BorderThickness = borderthickness, - BorderBrush = InlineCodeBorderBrush, - Background = InlineCodeBackground, - Child = text, - Padding = padding, - Margin = InlineCodeMargin - }; - - // Aligns content in InlineUI, see https://social.msdn.microsoft.com/Forums/silverlight/en-US/48b5e91e-efc5-4768-8eaf-f897849fcf0b/richtextbox-inlineuicontainer-vertical-alignment-issue?forum=silverlightarchieve - border.RenderTransform = new TranslateTransform - { - Y = 4 - }; - - var inlineUIContainer = new InlineUIContainer - { - Child = border, - }; - - try - { - // Add it to the current inline collection - localContext.InlineCollection.Add(inlineUIContainer); - } - catch // Fallback - { - Run run = new Run - { - Text = text.Text, - FontFamily = InlineCodeFontFamily ?? FontFamily, - Foreground = InlineCodeForeground ?? Foreground - }; - - // Additional formatting - if (localContext.WithinItalics) run.FontStyle = FontStyle.Italic; - if (localContext.WithinBold) run.FontWeight = FontWeights.Bold; - - // Add the fallback block - localContext.InlineCollection.Add(run); - } - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.Properties.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.Properties.cs deleted file mode 100644 index bc9c2a43c..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.Properties.cs +++ /dev/null @@ -1,245 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock/Render - -namespace Notepads.Controls.Markdown -{ - using System.Reflection; - using Windows.Foundation.Metadata; - using Windows.UI.Text; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Media; - - /// <summary> - /// Properties for the UWP Markdown Renderer - /// </summary> - public partial class MarkdownRenderer - { - private static bool? _textDecorationsSupported = null; - - private static bool TextDecorationsSupported => (bool)(_textDecorationsSupported ?? - (_textDecorationsSupported = ApiInformation.IsTypePresent("Windows.UI.Text.TextDecorations"))); - - /// <summary> - /// Super Hack to retain inertia and passing the Scroll data onto the Parent ScrollViewer. - /// </summary> - private static readonly MethodInfo pointerWheelChanged = typeof(ScrollViewer).GetMethod("OnPointerWheelChanged", BindingFlags.NonPublic | BindingFlags.Instance); - - /// <summary> - /// Gets or sets the Root Framework Element. - /// </summary> - private FrameworkElement RootElement { get; set; } - - /// <summary> - /// Gets the interface that is used to register hyperlinks. - /// </summary> - protected ILinkRegister LinkRegister { get; } - - /// <summary> - /// Gets the interface that is used to resolve images. - /// </summary> - protected IImageResolver ImageResolver { get; } - - /// <summary> - /// Gets the Parser to parse code strings into Syntax Highlighted text. - /// </summary> - protected ICodeBlockResolver CodeBlockResolver { get; } - - /// <summary> - /// Gets the Default Emoji Font. - /// </summary> - protected FontFamily DefaultEmojiFont { get; } - - /// <summary> - /// Gets or sets a brush that provides the background of the control. - /// </summary> - public Brush Background { get; set; } - - /// <summary> - /// Gets or sets a brush that describes the border fill of a control. - /// </summary> - public Brush BorderBrush { get; set; } - - /// <summary> - /// Gets or sets the <see cref="FlowDirection"/> of the markdown. - /// </summary> - public FlowDirection FlowDirection { get; set; } - - /// <summary> - /// Gets or sets the font used to display text in the control. - /// </summary> - public FontFamily FontFamily { get; set; } - - /// <summary> - /// Gets or sets the style in which the text is rendered. - /// </summary> - public FontStyle FontStyle { get; set; } - - /// <summary> - /// Gets or sets the thickness of the specified font. - /// </summary> - public FontWeight FontWeight { get; set; } - - /// <summary> - /// Gets or sets a brush that describes the foreground color. - /// </summary> - public Brush Foreground { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether text selection is enabled. - /// </summary> - public bool IsTextSelectionEnabled { get; set; } - - /// <summary> - /// Gets or sets the brush used to fill the background of a code block. - /// </summary> - public Brush CodeBackground { get; set; } - - /// <summary> - /// Gets or sets the brush used to fill the background of inline code. - /// </summary> - public Brush InlineCodeBackground { get; set; } - - /// <summary> - /// Gets or sets the brush used to fill the foreground of inline code. - /// </summary> - public Brush InlineCodeForeground { get; set; } - - /// <summary> - /// Gets or sets the brush used to fill the border of inline code. - /// </summary> - public Brush InlineCodeBorderBrush { get; set; } - - /// <summary> - /// Gets or sets the brush used to render the border fill of a code block. - /// </summary> - public Brush CodeBorderBrush { get; set; } - - /// <summary> - /// Gets or sets the brush used to render the text inside a code block. If this is - /// <c>null</c>, then <see cref="Foreground"/> is used. - /// </summary> - public Brush CodeForeground { get; set; } - - /// <summary> - /// Gets or sets the font used to display code. If this is <c>null</c>, then - /// <see cref="FontFamily"/> is used. - /// </summary> - public FontFamily CodeFontFamily { get; set; } - - /// <summary> - /// Gets or sets the font used to display code. If this is <c>null</c>, then - /// <see cref="FontFamily"/> is used. - /// </summary> - public FontFamily InlineCodeFontFamily { get; set; } - - /// <summary> - /// Gets or sets the font used to display emojis. If this is <c>null</c>, then - /// Segoe UI Emoji font is used. - /// </summary> - public FontFamily EmojiFontFamily { get; set; } - - /// <summary> - /// Gets or sets the font weight to use for level 1 headers. - /// </summary> - public FontWeight Header1FontWeight { get; set; } - - /// <summary> - /// Gets or sets the foreground brush for level 1 headers. - /// </summary> - public Brush Header1Foreground { get; set; } - - /// <summary> - /// Gets or sets the font weight to use for level 2 headers. - /// </summary> - public FontWeight Header2FontWeight { get; set; } - - /// <summary> - /// Gets or sets the foreground brush for level 2 headers. - /// </summary> - public Brush Header2Foreground { get; set; } - - /// <summary> - /// Gets or sets the font weight to use for level 3 headers. - /// </summary> - public FontWeight Header3FontWeight { get; set; } - - /// <summary> - /// Gets or sets the foreground brush for level 3 headers. - /// </summary> - public Brush Header3Foreground { get; set; } - - /// <summary> - /// Gets or sets the font weight to use for level 4 headers. - /// </summary> - public FontWeight Header4FontWeight { get; set; } - - /// <summary> - /// Gets or sets the foreground brush for level 4 headers. - /// </summary> - public Brush Header4Foreground { get; set; } - - /// <summary> - /// Gets or sets the font weight to use for level 5 headers. - /// </summary> - public FontWeight Header5FontWeight { get; set; } - - /// <summary> - /// Gets or sets the foreground brush for level 5 headers. - /// </summary> - public Brush Header5Foreground { get; set; } - - /// <summary> - /// Gets or sets the font weight to use for level 6 headers. - /// </summary> - public FontWeight Header6FontWeight { get; set; } - - /// <summary> - /// Gets or sets the foreground brush for level 6 headers. - /// </summary> - public Brush Header6Foreground { get; set; } - - /// <summary> - /// Gets or sets the brush used to render a horizontal rule. If this is <c>null</c>, then - /// <see cref="Foreground"/> is used. - /// </summary> - public Brush HorizontalRuleBrush { get; set; } - - /// <summary> - /// Gets or sets the brush used to fill the background of a quote block. - /// </summary> - public Brush QuoteBackground { get; set; } - - /// <summary> - /// Gets or sets the brush used to render a quote border. If this is <c>null</c>, then - /// <see cref="Foreground"/> is used. - /// </summary> - public Brush QuoteBorderBrush { get; set; } - - /// <summary> - /// Gets or sets the brush used to render the text inside a quote block. If this is - /// <c>null</c>, then <see cref="Foreground"/> is used. - /// </summary> - public Brush QuoteForeground { get; set; } - - /// <summary> - /// Gets or sets the brush used to render table borders. If this is <c>null</c>, then - /// <see cref="Foreground"/> is used. - /// </summary> - public Brush TableBorderBrush { get; set; } - - /// <summary> - /// Gets or sets the brush used to render table borders. If this is <c>null</c>, then - /// <see cref="Foreground"/> is used. - /// </summary> - public Brush YamlBorderBrush { get; set; } - - /// <summary> - /// Gets or sets the brush used to render links. If this is <c>null</c>, then - /// <see cref="Foreground"/> is used. - /// </summary> - public Brush LinkForeground { get; set; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.cs deleted file mode 100644 index 2c6ce900c..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRenderer.cs +++ /dev/null @@ -1,221 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock/Render - -namespace Notepads.Controls.Markdown -{ - using System; - using Microsoft.Toolkit.Uwp.UI; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Documents; - using Windows.UI.Xaml.Media; - - /// <summary> - /// Generates Framework Elements for the UWP Markdown Textblock. - /// </summary> - public partial class MarkdownRenderer : MarkdownRendererBase - { - /// <summary> - /// Initializes a new instance of the <see cref="MarkdownRenderer"/> class. - /// </summary> - /// <param name="document">The Document to Render.</param> - /// <param name="linkRegister">The LinkRegister, <see cref="MarkdownTextBlock"/> will use itself.</param> - /// <param name="imageResolver">The Image Resolver, <see cref="MarkdownTextBlock"/> will use itself.</param> - /// <param name="codeBlockResolver">The Code Block Resolver, <see cref="MarkdownTextBlock"/> will use itself.</param> - public MarkdownRenderer(MarkdownDocument document, ILinkRegister linkRegister, IImageResolver imageResolver, ICodeBlockResolver codeBlockResolver) - : base(document) - { - LinkRegister = linkRegister; - ImageResolver = imageResolver; - CodeBlockResolver = codeBlockResolver; - DefaultEmojiFont = new FontFamily("Segoe UI Emoji"); - } - - /// <summary> - /// Called externally to render markdown to a text block. - /// </summary> - /// <returns> A XAML UI element. </returns> - public UIElement Render() - { - var stackPanel = new StackPanel(); - RootElement = stackPanel; - Render(new UIElementCollectionRenderContext(stackPanel.Children) { Foreground = Foreground }); - - // Set background and border properties. - stackPanel.Background = Background; - stackPanel.BorderBrush = BorderBrush; - stackPanel.BorderThickness = BorderThickness; - stackPanel.Padding = Padding; - - return stackPanel; - } - - /// <summary> - /// Creates a new RichTextBlock, if the last element of the provided collection isn't already a RichTextBlock. - /// </summary> - /// <returns>The rich text block</returns> - protected RichTextBlock CreateOrReuseRichTextBlock(IRenderContext context) - { - if (!(context is UIElementCollectionRenderContext localContext)) - { - throw new RenderContextIncorrectException(); - } - - var blockUIElementCollection = localContext.BlockUIElementCollection; - - // Reuse the last RichTextBlock, if possible. - if (blockUIElementCollection != null && blockUIElementCollection.Count > 0 && blockUIElementCollection[blockUIElementCollection.Count - 1] is RichTextBlock) - { - return (RichTextBlock)blockUIElementCollection[blockUIElementCollection.Count - 1]; - } - - var result = new RichTextBlock - { - CharacterSpacing = CharacterSpacing, - FontFamily = FontFamily, - FontSize = FontSize, - FontStretch = FontStretch, - FontStyle = FontStyle, - FontWeight = FontWeight, - Foreground = localContext.Foreground, - IsTextSelectionEnabled = IsTextSelectionEnabled, - TextWrapping = TextWrapping, - FlowDirection = FlowDirection - }; - localContext.BlockUIElementCollection?.Add(result); - - return result; - } - - /// <summary> - /// Creates a new TextBlock, with default settings. - /// </summary> - /// <returns>The created TextBlock</returns> - protected TextBlock CreateTextBlock(RenderContext context) - { - var result = new TextBlock - { - CharacterSpacing = CharacterSpacing, - FontFamily = FontFamily, - FontSize = FontSize, - FontStretch = FontStretch, - FontStyle = FontStyle, - FontWeight = FontWeight, - Foreground = context.Foreground, - IsTextSelectionEnabled = IsTextSelectionEnabled, - TextWrapping = TextWrapping, - FlowDirection = FlowDirection - }; - return result; - } - - /// <summary> - /// Performs an action against any runs that occur within the given span. - /// </summary> - protected void AlterChildRuns(Span parentSpan, Action<Span, Run> action) - { - foreach (var inlineElement in parentSpan.Inlines) - { - if (inlineElement is Span span) - { - AlterChildRuns(span, action); - } - else if (inlineElement is Run) - { - action(parentSpan, (Run)inlineElement); - } - } - } - - /// <summary> - /// Checks if all text elements inside the given container are superscript. - /// </summary> - /// <returns> <c>true</c> if all text is superscript (level 1); <c>false</c> otherwise. </returns> - private bool AllTextIsSuperscript(IInlineContainer container, int superscriptLevel = 0) - { - foreach (var inline in container.Inlines) - { - if (inline is SuperscriptTextInline textInline) - { - // Remove any nested superscripts. - if (AllTextIsSuperscript(textInline, superscriptLevel + 1) == false) - { - return false; - } - } - else if (inline is IInlineContainer inlineContainer) - { - // Remove any superscripts. - if (AllTextIsSuperscript(inlineContainer, superscriptLevel) == false) - { - return false; - } - } - else if (inline is IInlineLeaf leaf && superscriptLevel != 1) - { - if (!ParseHelpers.IsMarkdownBlankOrWhiteSpace(leaf.Text) || string.IsNullOrWhiteSpace(leaf.Text)) - { - return false; - } - } - } - - return true; - } - - /// <summary> - /// Removes all superscript elements from the given container. - /// </summary> - private void RemoveSuperscriptRuns(IInlineContainer container, bool insertCaret) - { - for (int i = 0; i < container.Inlines.Count; i++) - { - var inline = container.Inlines[i]; - if (inline is SuperscriptTextInline textInline) - { - // Remove any nested superscripts. - RemoveSuperscriptRuns(textInline, insertCaret); - - // Remove the superscript element, insert all the children. - container.Inlines.RemoveAt(i); - if (insertCaret) - { - container.Inlines.Insert(i++, new TextRunInline { Text = "^" }); - } - - foreach (var superscriptInline in textInline.Inlines) - { - container.Inlines.Insert(i++, superscriptInline); - } - - i--; - } - else if (inline is IInlineContainer) - { - // Remove any superscripts. - RemoveSuperscriptRuns((IInlineContainer)inline, insertCaret); - } - } - } - - private void Preventative_PointerWheelChanged(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e) - { - var pointerPoint = e.GetCurrentPoint((UIElement)sender); - - if (pointerPoint.Properties.IsHorizontalMouseWheel) - { - e.Handled = false; - return; - } - - var rootViewer = RootElement.FindAscendant<ScrollViewer>(); - if (rootViewer != null) - { - pointerWheelChanged?.Invoke(rootViewer, new object[] { e }); - e.Handled = true; - } - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRendererBase.Blocks.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRendererBase.Blocks.cs deleted file mode 100644 index b46746fc7..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRendererBase.Blocks.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Render - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// Block Rendering Methods. - /// </summary> - public partial class MarkdownRendererBase - { - /// <summary> - /// Renders a paragraph element. - /// </summary> - protected abstract void RenderParagraph(ParagraphBlock element, IRenderContext context); - - /// <summary> - /// Renders a yaml header element. - /// </summary> - protected abstract void RenderYamlHeader(YamlHeaderBlock element, IRenderContext context); - - /// <summary> - /// Renders a header element. - /// </summary> - protected abstract void RenderHeader(HeaderBlock element, IRenderContext context); - - /// <summary> - /// Renders a list element. - /// </summary> - protected abstract void RenderListElement(ListBlock element, IRenderContext context); - - /// <summary> - /// Renders a horizontal rule element. - /// </summary> - protected abstract void RenderHorizontalRule(IRenderContext context); - - /// <summary> - /// Renders a quote element. - /// </summary> - protected abstract void RenderQuote(QuoteBlock element, IRenderContext context); - - /// <summary> - /// Renders a code element. - /// </summary> - protected abstract void RenderCode(CodeBlock element, IRenderContext context); - - /// <summary> - /// Renders a table element. - /// </summary> - protected abstract void RenderTable(TableBlock element, IRenderContext context); - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRendererBase.Inlines.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRendererBase.Inlines.cs deleted file mode 100644 index 9d7121aab..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRendererBase.Inlines.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Render - -namespace Notepads.Controls.Markdown -{ - /// <summary> - /// Inline Rendering Methods. - /// </summary> - public partial class MarkdownRendererBase - { - /// <summary> - /// Renders emoji element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected abstract void RenderEmoji(EmojiInline element, IRenderContext context); - - /// <summary> - /// Renders a text run element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected abstract void RenderTextRun(TextRunInline element, IRenderContext context); - - /// <summary> - /// Renders a bold run element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected abstract void RenderBoldRun(BoldTextInline element, IRenderContext context); - - /// <summary> - /// Renders a link element - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected abstract void RenderMarkdownLink(MarkdownLinkInline element, IRenderContext context); - - /// <summary> - /// Renders an image element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected abstract void RenderImage(ImageInline element, IRenderContext context); - - /// <summary> - /// Renders a raw link element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected abstract void RenderHyperlink(HyperlinkInline element, IRenderContext context); - - /// <summary> - /// Renders a text run element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected abstract void RenderItalicRun(ItalicTextInline element, IRenderContext context); - - /// <summary> - /// Renders a strikethrough element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected abstract void RenderStrikethroughRun(StrikethroughTextInline element, IRenderContext context); - - /// <summary> - /// Renders a superscript element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected abstract void RenderSuperscriptRun(SuperscriptTextInline element, IRenderContext context); - - /// <summary> - /// Renders a subscript element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected abstract void RenderSubscriptRun(SubscriptTextInline element, IRenderContext context); - - /// <summary> - /// Renders a code element - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected abstract void RenderCodeRun(CodeInline element, IRenderContext context); - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRendererBase.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRendererBase.cs deleted file mode 100644 index fd20461c5..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownRendererBase.cs +++ /dev/null @@ -1,250 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Parsers/Markdown/Render - -namespace Notepads.Controls.Markdown -{ - using System.Collections.Generic; - using System.Text; - - /// <summary> - /// A base renderer for Rendering Markdown into Controls. - /// </summary> - public abstract partial class MarkdownRendererBase - { - /// <summary> - /// Initializes a new instance of the <see cref="MarkdownRendererBase"/> class. - /// </summary> - /// <param name="document">Markdown Document to Render</param> - protected MarkdownRendererBase(MarkdownDocument document) - { - Document = document; - } - - /// <summary> - /// Renders all Content to the Provided Parent UI. - /// </summary> - /// <param name="context">UI Context</param> - public virtual void Render(IRenderContext context) - { - RenderBlocks(Document.Blocks, context); - } - - /// <summary> - /// Renders a list of block elements. - /// </summary> - protected virtual void RenderBlocks(IEnumerable<MarkdownBlock> blockElements, IRenderContext context) - { - foreach (MarkdownBlock element in blockElements) - { - RenderBlock(element, context); - } - } - - /// <summary> - /// Called to render a block element. - /// </summary> - protected void RenderBlock(MarkdownBlock element, IRenderContext context) - { - { - switch (element.Type) - { - case MarkdownBlockType.Paragraph: - RenderParagraph((ParagraphBlock)element, context); - break; - - case MarkdownBlockType.Quote: - RenderQuote((QuoteBlock)element, context); - break; - - case MarkdownBlockType.Code: - RenderCode((CodeBlock)element, context); - break; - - case MarkdownBlockType.Header: - RenderHeader((HeaderBlock)element, context); - break; - - case MarkdownBlockType.List: - RenderListElement((ListBlock)element, context); - break; - - case MarkdownBlockType.HorizontalRule: - RenderHorizontalRule(context); - break; - - case MarkdownBlockType.Table: - RenderTable((TableBlock)element, context); - break; - - case MarkdownBlockType.YamlHeader: - RenderYamlHeader((YamlHeaderBlock)element, context); - break; - } - } - } - - /// <summary> - /// Renders all of the children for the given element. - /// </summary> - /// <param name="inlineElements"> The parsed inline elements to render. </param> - /// <param name="context"> Persistent state. </param> - protected void RenderInlineChildren(IList<MarkdownInline> inlineElements, IRenderContext context) - { - foreach (MarkdownInline element in inlineElements) - { - switch (element.Type) - { - case MarkdownInlineType.Comment: - case MarkdownInlineType.LinkReference: - break; - - default: - RenderInline(element, context); - break; - } - } - } - - /// <summary> - /// Called to render an inline element. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected void RenderInline(MarkdownInline element, IRenderContext context) - { - switch (element.Type) - { - case MarkdownInlineType.TextRun: - RenderTextRun((TextRunInline)element, context); - break; - - case MarkdownInlineType.Italic: - RenderItalicRun((ItalicTextInline)element, context); - break; - - case MarkdownInlineType.Bold: - RenderBoldRun((BoldTextInline)element, context); - break; - - case MarkdownInlineType.MarkdownLink: - CheckRenderMarkdownLink((MarkdownLinkInline)element, context); - break; - - case MarkdownInlineType.RawHyperlink: - RenderHyperlink((HyperlinkInline)element, context); - break; - - case MarkdownInlineType.Strikethrough: - RenderStrikethroughRun((StrikethroughTextInline)element, context); - break; - - case MarkdownInlineType.Superscript: - RenderSuperscriptRun((SuperscriptTextInline)element, context); - break; - - case MarkdownInlineType.Subscript: - RenderSubscriptRun((SubscriptTextInline)element, context); - break; - - case MarkdownInlineType.Code: - RenderCodeRun((CodeInline)element, context); - break; - - case MarkdownInlineType.Image: - RenderImage((ImageInline)element, context); - break; - - case MarkdownInlineType.Emoji: - RenderEmoji((EmojiInline)element, context); - break; - } - } - - /// <summary> - /// Removes leading whitespace, but only if this is the first run in the block. - /// </summary> - /// <returns>The corrected string</returns> - protected static string CollapseWhitespace(IRenderContext context, string text) - { - bool dontOutputWhitespace = context.TrimLeadingWhitespace; - StringBuilder result = null; - for (int i = 0; i < text.Length; i++) - { - char c = text[i]; - if (c == ' ' || c == '\t') - { - if (dontOutputWhitespace) - { - if (result == null) - { - result = new StringBuilder(text.Substring(0, i), text.Length); - } - } - else - { - result?.Append(c); - - dontOutputWhitespace = true; - } - } - else - { - result?.Append(c); - - dontOutputWhitespace = false; - } - } - - context.TrimLeadingWhitespace = false; - return result == null ? text : result.ToString(); - } - - /// <summary> - /// Verifies if the link is valid, before processing into a link, or plain text. - /// </summary> - /// <param name="element"> The parsed inline element to render. </param> - /// <param name="context"> Persistent state. </param> - protected void CheckRenderMarkdownLink(MarkdownLinkInline element, IRenderContext context) - { - // Avoid processing when link text is empty. - if (element.Inlines.Count == 0) - { - return; - } - - // Attempt to resolve references. - element.ResolveReference(Document); - if (element.Url == null) - { - // The element couldn't be resolved, just render it as text. - RenderInlineChildren(element.Inlines, context); - return; - } - - foreach (MarkdownInline inline in element.Inlines) - { - if (inline is ImageInline imageInline) - { - // this is an image, create Image. - if (!string.IsNullOrEmpty(imageInline.ReferenceId)) - { - imageInline.ResolveReference(Document); - } - - imageInline.Url = element.Url; - RenderImage(imageInline, context); - return; - } - } - - RenderMarkdownLink(element, context); - } - - /// <summary> - /// Gets the markdown document that will be rendered. - /// </summary> - protected MarkdownDocument Document { get; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownTable.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownTable.cs deleted file mode 100644 index b87d001d1..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/MarkdownTable.cs +++ /dev/null @@ -1,217 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock/Render - -namespace Notepads.Controls.Markdown -{ - using System; - using System.Collections.Generic; - using System.Linq; - using Windows.Foundation; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Media; - using Windows.UI.Xaml.Shapes; - - /// <summary> - /// A custom panel control that arranges elements similar to how an HTML table would. - /// </summary> - internal class MarkdownTable : Panel - { - private readonly int _columnCount; - private readonly int _rowCount; - private readonly double _borderThickness; - private double[] _columnWidths; - private double[] _rowHeights; - - public MarkdownTable(int columnCount, int rowCount, double borderThickness, Brush borderBrush) - { - _columnCount = columnCount; - _rowCount = rowCount; - _borderThickness = borderThickness; - for (int col = 0; col < columnCount + 1; col++) - { - Children.Add(new Rectangle { Fill = borderBrush }); - } - - for (int row = 0; row < rowCount + 1; row++) - { - Children.Add(new Rectangle { Fill = borderBrush }); - } - } - - // Helper method to enumerate FrameworkElements instead of UIElements. - private IEnumerable<FrameworkElement> ContentChildren - { - get - { - for (int i = _columnCount + _rowCount + 2; i < Children.Count; i++) - { - yield return (FrameworkElement)Children[i]; - } - } - } - - // Helper method to get table vertical edges. - private IEnumerable<Rectangle> VerticalLines - { - get - { - for (int i = 0; i < _columnCount + 1; i++) - { - yield return (Rectangle)Children[i]; - } - } - } - - // Helper method to get table horizontal edges. - private IEnumerable<Rectangle> HorizontalLines - { - get - { - for (int i = _columnCount + 1; i < _columnCount + _rowCount + 2; i++) - { - yield return (Rectangle)Children[i]; - } - } - } - - protected override Size MeasureOverride(Size availableSize) - { - // Measure the width of each column, with no horizontal width restrictions. - var naturalColumnWidths = new double[_columnCount]; - foreach (var child in ContentChildren) - { - var columnIndex = Grid.GetColumn(child); - child.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); - naturalColumnWidths[columnIndex] = Math.Max(naturalColumnWidths[columnIndex], child.DesiredSize.Width); - } - - // Now figure out the actual column widths. - var remainingContentWidth = availableSize.Width - ((_columnCount + 1) * _borderThickness); - _columnWidths = new double[_columnCount]; - int remainingColumnCount = _columnCount; - while (remainingColumnCount > 0) - { - // Calculate the fair width of all columns. - double fairWidth = Math.Max(0, remainingContentWidth / remainingColumnCount); - - // Are there any columns less than that? If so, they get what they are asking for. - bool recalculationNeeded = false; - for (int i = 0; i < _columnCount; i++) - { - if (_columnWidths[i] == 0 && naturalColumnWidths[i] < fairWidth) - { - _columnWidths[i] = naturalColumnWidths[i]; - remainingColumnCount--; - remainingContentWidth -= _columnWidths[i]; - recalculationNeeded = true; - } - } - - // If there are no columns less than the fair width, every remaining column gets that width. - if (recalculationNeeded == false) - { - for (int i = 0; i < _columnCount; i++) - { - if (_columnWidths[i] == 0) - { - _columnWidths[i] = fairWidth; - } - } - - break; - } - } - - // TODO: we can skip this step if none of the column widths changed, and just re-use - // the row heights we obtained earlier. - - // Now measure row heights. - _rowHeights = new double[_rowCount]; - foreach (var child in ContentChildren) - { - var columnIndex = Grid.GetColumn(child); - var rowIndex = Grid.GetRow(child); - child.Measure(new Size(_columnWidths[columnIndex], double.PositiveInfinity)); - _rowHeights[rowIndex] = Math.Max(_rowHeights[rowIndex], child.DesiredSize.Height); - } - - return new Size( - _columnWidths.Sum() + (_borderThickness * (_columnCount + 1)), - _rowHeights.Sum() + ((_rowCount + 1) * _borderThickness)); - } - - protected override Size ArrangeOverride(Size finalSize) - { - if (_columnWidths == null || _rowHeights == null) - { - throw new InvalidOperationException("Expected Measure to be called first."); - } - - // Arrange content. - foreach (var child in ContentChildren) - { - var columnIndex = Grid.GetColumn(child); - var rowIndex = Grid.GetRow(child); - - var rect = new Rect(0, 0, 0, 0) - { - X = _borderThickness - }; - - for (int col = 0; col < columnIndex; col++) - { - rect.X += _borderThickness + _columnWidths[col]; - } - - rect.Y = _borderThickness; - for (int row = 0; row < rowIndex; row++) - { - rect.Y += _borderThickness + _rowHeights[row]; - } - - rect.Width = _columnWidths[columnIndex]; - rect.Height = _rowHeights[rowIndex]; - child.Arrange(rect); - } - - // Arrange vertical border elements. - { - int colIndex = 0; - double x = 0; - foreach (var borderLine in VerticalLines) - { - borderLine.Arrange(new Rect(x, 0, _borderThickness, finalSize.Height)); - if (colIndex >= _columnWidths.Length) - { - break; - } - - x += _borderThickness + _columnWidths[colIndex]; - colIndex++; - } - } - - // Arrange horizontal border elements. - { - int rowIndex = 0; - double y = 0; - foreach (var borderLine in HorizontalLines) - { - borderLine.Arrange(new Rect(0, y, finalSize.Width, _borderThickness)); - if (rowIndex >= _rowHeights.Length) - { - break; - } - - y += _borderThickness + _rowHeights[rowIndex]; - rowIndex++; - } - } - - return finalSize; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/RenderContext.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/RenderContext.cs deleted file mode 100644 index f796b6395..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/RenderContext.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock/Render - -namespace Notepads.Controls.Markdown -{ - using Windows.UI.Xaml.Media; - - /// <summary> - /// The Context of the Current Position - /// </summary> - public abstract class RenderContext : IRenderContext - { - /// <summary> - /// Gets or sets the Foreground of the Current Context. - /// </summary> - public Brush Foreground { get; set; } - - /// <inheritdoc/> - public bool TrimLeadingWhitespace { get; set; } - - /// <inheritdoc/> - public object Parent { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether to override the Foreground Property. - /// </summary> - public bool OverrideForeground { get; set; } - - /// <inheritdoc/> - public IRenderContext Clone() - { - return (IRenderContext)MemberwiseClone(); - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/RenderContextIncorrectException.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/RenderContextIncorrectException.cs deleted file mode 100644 index 776196d24..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/RenderContextIncorrectException.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock/Render - -namespace Notepads.Controls.Markdown -{ - using System; - - /// <summary> - /// An Exception that occurs when the Render Context is Incorrect. - /// </summary> - public class RenderContextIncorrectException : Exception - { - internal RenderContextIncorrectException() : base("Markdown Render Context missing or incorrect.") - { - } - - public RenderContextIncorrectException(string message) : base(message) - { - } - - public RenderContextIncorrectException(string message, Exception innerException) : base(message, innerException) - { - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/UIElementCollectionRenderContext.cs b/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/UIElementCollectionRenderContext.cs deleted file mode 100644 index 6068039b8..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/Markdown/Render/UIElementCollectionRenderContext.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock/Render - -namespace Notepads.Controls.Markdown -{ - using Windows.UI.Xaml.Controls; - - /// <summary> - /// The Context of the Current Document Rendering. - /// </summary> - public class UIElementCollectionRenderContext : RenderContext - { - internal UIElementCollectionRenderContext(UIElementCollection blockUIElementCollection) - { - BlockUIElementCollection = blockUIElementCollection; - } - - internal UIElementCollectionRenderContext(UIElementCollection blockUIElementCollection, IRenderContext context) - : this(blockUIElementCollection) - { - TrimLeadingWhitespace = context.TrimLeadingWhitespace; - Parent = context.Parent; - - if (context is RenderContext localcontext) - { - Foreground = localcontext.Foreground; - OverrideForeground = localcontext.OverrideForeground; - } - } - - /// <summary> - /// Gets or sets the list to add to. - /// </summary> - public UIElementCollection BlockUIElementCollection { get; set; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/MarkdownRenderedEventArgs.cs b/src/Notepads.Controls/MarkdownTextBlock/MarkdownRenderedEventArgs.cs deleted file mode 100644 index faeb1aeec..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/MarkdownRenderedEventArgs.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock - -namespace Notepads.Controls -{ - using System; - - /// <summary> - /// Arguments for the OnMarkdownRendered event which indicates when the markdown has been - /// rendered. - /// </summary> - public class MarkdownRenderedEventArgs : EventArgs - { - internal MarkdownRenderedEventArgs(Exception ex) - { - Exception = ex; - } - - /// <summary> - /// Gets the exception if there was one. If the exception is null there was no error. - /// </summary> - public Exception Exception { get; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.Dimensions.cs b/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.Dimensions.cs deleted file mode 100644 index 0e09a7f26..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.Dimensions.cs +++ /dev/null @@ -1,667 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock - -namespace Notepads.Controls -{ - using Windows.UI.Xaml; - using Windows.UI.Xaml.Media; - - /// <summary> - /// Measurement Properties for elements in the Markdown. - /// </summary> - public partial class MarkdownTextBlock - { - /// <summary> - /// Gets the dependency property for <see cref="InlineCodePadding"/>. - /// </summary> - public static readonly DependencyProperty InlineCodePaddingProperty = - DependencyProperty.Register( - nameof(InlineCodePadding), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="InlineCodeMargin"/>. - /// </summary> - public static readonly DependencyProperty InlineCodeMarginProperty = - DependencyProperty.Register( - nameof(InlineCodeMargin), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="InlineCodeBorderThickness"/>. - /// </summary> - public static readonly DependencyProperty InlineCodeBorderThicknessProperty = - DependencyProperty.Register( - nameof(InlineCodeBorderThickness), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="ImageStretch"/>. - /// </summary> - public static readonly DependencyProperty ImageStretchProperty = DependencyProperty.Register( - nameof(ImageStretch), - typeof(Stretch), - typeof(MarkdownTextBlock), - new PropertyMetadata(Stretch.None, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="CodeBorderThickness"/>. - /// </summary> - public static readonly DependencyProperty CodeBorderThicknessProperty = DependencyProperty.Register( - nameof(CodeBorderThickness), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="CodeMargin"/>. - /// </summary> - public static readonly DependencyProperty CodeMarginProperty = DependencyProperty.Register( - nameof(CodeMargin), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="CodePadding"/>. - /// </summary> - public static readonly DependencyProperty CodePaddingProperty = DependencyProperty.Register( - nameof(CodePadding), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header1FontSize"/>. - /// </summary> - public static readonly DependencyProperty Header1FontSizeProperty = DependencyProperty.Register( - nameof(Header1FontSize), - typeof(double), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header1Margin"/>. - /// </summary> - public static readonly DependencyProperty Header1MarginProperty = DependencyProperty.Register( - nameof(Header1Margin), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header2FontSize"/>. - /// </summary> - public static readonly DependencyProperty Header2FontSizeProperty = DependencyProperty.Register( - nameof(Header2FontSize), - typeof(double), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header2Margin"/>. - /// </summary> - public static readonly DependencyProperty Header2MarginProperty = DependencyProperty.Register( - nameof(Header2Margin), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header3FontSize"/>. - /// </summary> - public static readonly DependencyProperty Header3FontSizeProperty = DependencyProperty.Register( - nameof(Header3FontSize), - typeof(double), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header3Margin"/>. - /// </summary> - public static readonly DependencyProperty Header3MarginProperty = DependencyProperty.Register( - nameof(Header3Margin), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header4FontSize"/>. - /// </summary> - public static readonly DependencyProperty Header4FontSizeProperty = DependencyProperty.Register( - nameof(Header4FontSize), - typeof(double), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header4Margin"/>. - /// </summary> - public static readonly DependencyProperty Header4MarginProperty = DependencyProperty.Register( - nameof(Header4Margin), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header5FontSize"/>. - /// </summary> - public static readonly DependencyProperty Header5FontSizeProperty = DependencyProperty.Register( - nameof(Header5FontSize), - typeof(double), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header5Margin"/>. - /// </summary> - public static readonly DependencyProperty Header5MarginProperty = DependencyProperty.Register( - nameof(Header5Margin), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header6Margin"/>. - /// </summary> - public static readonly DependencyProperty Header6MarginProperty = DependencyProperty.Register( - nameof(Header6Margin), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header6FontSize"/>. - /// </summary> - public static readonly DependencyProperty Header6FontSizeProperty = DependencyProperty.Register( - nameof(Header6FontSize), - typeof(double), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="HorizontalRuleMargin"/>. - /// </summary> - public static readonly DependencyProperty HorizontalRuleMarginProperty = DependencyProperty.Register( - nameof(HorizontalRuleMargin), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="HorizontalRuleThickness"/>. - /// </summary> - public static readonly DependencyProperty HorizontalRuleThicknessProperty = DependencyProperty.Register( - nameof(HorizontalRuleThickness), - typeof(double), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="ListMargin"/>. - /// </summary> - public static readonly DependencyProperty ListMarginProperty = DependencyProperty.Register( - nameof(ListMargin), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="ListGutterWidth"/>. - /// </summary> - public static readonly DependencyProperty ListGutterWidthProperty = DependencyProperty.Register( - nameof(ListGutterWidth), - typeof(double), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="ListBulletSpacing"/>. - /// </summary> - public static readonly DependencyProperty ListBulletSpacingProperty = DependencyProperty.Register( - nameof(ListBulletSpacing), - typeof(double), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="ParagraphMargin"/>. - /// </summary> - public static readonly DependencyProperty ParagraphMarginProperty = DependencyProperty.Register( - nameof(ParagraphMargin), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="ParagraphLineHeight"/>. - /// </summary> - public static readonly DependencyProperty ParagraphLineHeightProperty = DependencyProperty.Register( - nameof(ParagraphLineHeight), - typeof(int), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="QuoteBorderThickness"/>. - /// </summary> - public static readonly DependencyProperty QuoteBorderThicknessProperty = DependencyProperty.Register( - nameof(QuoteBorderThickness), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="QuoteMargin"/>. - /// </summary> - public static readonly DependencyProperty QuoteMarginProperty = DependencyProperty.Register( - nameof(QuoteMargin), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="QuotePadding"/>. - /// </summary> - public static readonly DependencyProperty QuotePaddingProperty = DependencyProperty.Register( - nameof(QuotePadding), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="YamlBorderThickness"/>. - /// </summary> - public static readonly DependencyProperty YamlBorderThicknessProperty = DependencyProperty.Register( - nameof(YamlBorderThickness), - typeof(double), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="TableBorderThickness"/>. - /// </summary> - public static readonly DependencyProperty TableBorderThicknessProperty = DependencyProperty.Register( - nameof(TableBorderThickness), - typeof(double), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="TableCellPadding"/>. - /// </summary> - public static readonly DependencyProperty TableCellPaddingProperty = DependencyProperty.Register( - nameof(TableCellPadding), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="TableMargin"/>. - /// </summary> - public static readonly DependencyProperty TableMarginProperty = DependencyProperty.Register( - nameof(TableMargin), - typeof(Thickness), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="TextWrapping"/>. - /// </summary> - public static readonly DependencyProperty TextWrappingProperty = DependencyProperty.Register( - nameof(TextWrapping), - typeof(TextWrapping), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="ImageMaxHeight"/> - /// </summary> - public static readonly DependencyProperty ImageMaxHeightProperty = DependencyProperty.Register( - nameof(ImageMaxHeight), - typeof(double), - typeof(MarkdownTextBlock), - new PropertyMetadata(0.0, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="ImageMaxWidth"/> - /// </summary> - public static readonly DependencyProperty ImageMaxWidthProperty = DependencyProperty.Register( - nameof(ImageMaxWidth), - typeof(double), - typeof(MarkdownTextBlock), - new PropertyMetadata(0.0, OnPropertyChangedStatic)); - - /// <summary> - /// Gets or sets the MaxWidth for images. - /// </summary> - public double ImageMaxWidth - { - get => (double)GetValue(ImageMaxWidthProperty); - set => SetValue(ImageMaxWidthProperty, value); - } - - /// <summary> - /// Gets or sets the MaxHeight for images. - /// </summary> - public double ImageMaxHeight - { - get => (double)GetValue(ImageMaxHeightProperty); - set => SetValue(ImageMaxHeightProperty, value); - } - - /// <summary> - /// Gets or sets the stretch used for images. - /// </summary> - public Stretch ImageStretch - { - get => (Stretch)GetValue(ImageStretchProperty); - set => SetValue(ImageStretchProperty, value); - } - - /// <summary> - /// Gets or sets the thickness of the border around code blocks. - /// </summary> - public Thickness CodeBorderThickness - { - get => (Thickness)GetValue(CodeBorderThicknessProperty); - set => SetValue(CodeBorderThicknessProperty, value); - } - - /// <summary> - /// Gets or sets the thickness of the border for inline code. - /// </summary> - public Thickness InlineCodeBorderThickness - { - get => (Thickness)GetValue(InlineCodeBorderThicknessProperty); - set => SetValue(InlineCodeBorderThicknessProperty, value); - } - - /// <summary> - /// Gets or sets the space between the code border and the text. - /// </summary> - public Thickness InlineCodePadding - { - get => (Thickness)GetValue(InlineCodePaddingProperty); - set => SetValue(InlineCodePaddingProperty, value); - } - - /// <summary> - /// Gets or sets the margin for inline code. - /// </summary> - public Thickness InlineCodeMargin - { - get => (Thickness)GetValue(InlineCodeMarginProperty); - set => SetValue(InlineCodeMarginProperty, value); - } - - /// <summary> - /// Gets or sets the space between the code border and the text. - /// </summary> - public Thickness CodeMargin - { - get => (Thickness)GetValue(CodeMarginProperty); - set => SetValue(CodeMarginProperty, value); - } - - /// <summary> - /// Gets or sets space between the code border and the text. - /// </summary> - public Thickness CodePadding - { - get => (Thickness)GetValue(CodePaddingProperty); - set => SetValue(CodePaddingProperty, value); - } - - /// <summary> - /// Gets or sets the font size for level 1 headers. - /// </summary> - public double Header1FontSize - { - get => (double)GetValue(Header1FontSizeProperty); - set => SetValue(Header1FontSizeProperty, value); - } - - /// <summary> - /// Gets or sets the margin for level 1 headers. - /// </summary> - public Thickness Header1Margin - { - get => (Thickness)GetValue(Header1MarginProperty); - set => SetValue(Header1MarginProperty, value); - } - - /// <summary> - /// Gets or sets the font size for level 2 headers. - /// </summary> - public double Header2FontSize - { - get => (double)GetValue(Header2FontSizeProperty); - set => SetValue(Header2FontSizeProperty, value); - } - - /// <summary> - /// Gets or sets the margin for level 2 headers. - /// </summary> - public Thickness Header2Margin - { - get => (Thickness)GetValue(Header2MarginProperty); - set => SetValue(Header2MarginProperty, value); - } - - /// <summary> - /// Gets or sets the font size for level 3 headers. - /// </summary> - public double Header3FontSize - { - get => (double)GetValue(Header3FontSizeProperty); - set => SetValue(Header3FontSizeProperty, value); - } - - /// <summary> - /// Gets or sets the margin for level 3 headers. - /// </summary> - public Thickness Header3Margin - { - get => (Thickness)GetValue(Header3MarginProperty); - set => SetValue(Header3MarginProperty, value); - } - - /// <summary> - /// Gets or sets the font size for level 4 headers. - /// </summary> - public double Header4FontSize - { - get => (double)GetValue(Header4FontSizeProperty); - set => SetValue(Header4FontSizeProperty, value); - } - - /// <summary> - /// Gets or sets the margin for level 4 headers. - /// </summary> - public Thickness Header4Margin - { - get => (Thickness)GetValue(Header4MarginProperty); - set => SetValue(Header4MarginProperty, value); - } - - /// <summary> - /// Gets or sets the font size for level 5 headers. - /// </summary> - public double Header5FontSize - { - get => (double)GetValue(Header5FontSizeProperty); - set => SetValue(Header5FontSizeProperty, value); - } - - /// <summary> - /// Gets or sets the margin for level 5 headers. - /// </summary> - public Thickness Header5Margin - { - get => (Thickness)GetValue(Header5MarginProperty); - set => SetValue(Header5MarginProperty, value); - } - - /// <summary> - /// Gets or sets the font size for level 6 headers. - /// </summary> - public double Header6FontSize - { - get => (double)GetValue(Header6FontSizeProperty); - set => SetValue(Header6FontSizeProperty, value); - } - - /// <summary> - /// Gets or sets the margin for level 6 headers. - /// </summary> - public Thickness Header6Margin - { - get => (Thickness)GetValue(Header6MarginProperty); - set => SetValue(Header6MarginProperty, value); - } - - /// <summary> - /// Gets or sets the margin used for horizontal rules. - /// </summary> - public Thickness HorizontalRuleMargin - { - get => (Thickness)GetValue(HorizontalRuleMarginProperty); - set => SetValue(HorizontalRuleMarginProperty, value); - } - - /// <summary> - /// Gets or sets the vertical thickness of the horizontal rule. - /// </summary> - public double HorizontalRuleThickness - { - get => (double)GetValue(HorizontalRuleThicknessProperty); - set => SetValue(HorizontalRuleThicknessProperty, value); - } - - /// <summary> - /// Gets or sets the margin used by lists. - /// </summary> - public Thickness ListMargin - { - get => (Thickness)GetValue(ListMarginProperty); - set => SetValue(ListMarginProperty, value); - } - - /// <summary> - /// Gets or sets the width of the space used by list item bullets/numbers. - /// </summary> - public double ListGutterWidth - { - get => (double)GetValue(ListGutterWidthProperty); - set => SetValue(ListGutterWidthProperty, value); - } - - /// <summary> - /// Gets or sets the space between the list item bullets/numbers and the list item content. - /// </summary> - public double ListBulletSpacing - { - get => (double)GetValue(ListBulletSpacingProperty); - set => SetValue(ListBulletSpacingProperty, value); - } - - /// <summary> - /// Gets or sets the margin used for paragraphs. - /// </summary> - public Thickness ParagraphMargin - { - get => (Thickness)GetValue(ParagraphMarginProperty); - set => SetValue(ParagraphMarginProperty, value); - } - - /// <summary> - /// Gets or sets the line height used for paragraphs. - /// </summary> - public int ParagraphLineHeight - { - get => (int)GetValue(ParagraphLineHeightProperty); - set => SetValue(ParagraphLineHeightProperty, value); - } - - /// <summary> - /// Gets or sets the thickness of quote borders. - /// </summary> - public Thickness QuoteBorderThickness - { - get => (Thickness)GetValue(QuoteBorderThicknessProperty); - set => SetValue(QuoteBorderThicknessProperty, value); - } - - /// <summary> - /// Gets or sets the space outside of quote borders. - /// </summary> - public Thickness QuoteMargin - { - get => (Thickness)GetValue(QuoteMarginProperty); - set => SetValue(QuoteMarginProperty, value); - } - - /// <summary> - /// Gets or sets the space between the quote border and the text. - /// </summary> - public Thickness QuotePadding - { - get => (Thickness)GetValue(QuotePaddingProperty); - set => SetValue(QuotePaddingProperty, value); - } - - /// <summary> - /// Gets or sets the thickness of any yaml header borders. - /// </summary> - public double YamlBorderThickness - { - get => (double)GetValue(YamlBorderThicknessProperty); - set => SetValue(YamlBorderThicknessProperty, value); - } - - /// <summary> - /// Gets or sets the thickness of any table borders. - /// </summary> - public double TableBorderThickness - { - get => (double)GetValue(TableBorderThicknessProperty); - set => SetValue(TableBorderThicknessProperty, value); - } - - /// <summary> - /// Gets or sets the padding inside each cell. - /// </summary> - public Thickness TableCellPadding - { - get => (Thickness)GetValue(TableCellPaddingProperty); - set => SetValue(TableCellPaddingProperty, value); - } - - /// <summary> - /// Gets or sets the margin used by tables. - /// </summary> - public Thickness TableMargin - { - get => (Thickness)GetValue(TableMarginProperty); - set => SetValue(TableMarginProperty, value); - } - - /// <summary> - /// Gets or sets the word wrapping behavior. - /// </summary> - public TextWrapping TextWrapping - { - get => (TextWrapping)GetValue(TextWrappingProperty); - set => SetValue(TextWrappingProperty, value); - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.Events.cs b/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.Events.cs deleted file mode 100644 index fca584065..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.Events.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock - -namespace Notepads.Controls -{ - using System; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Documents; - - /// <summary> - /// An efficient and extensible control that can parse and render markdown. - /// </summary> - public partial class MarkdownTextBlock - { - /// <summary> - /// Calls OnPropertyChanged. - /// </summary> - private static void OnPropertyChangedStatic(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var instance = d as MarkdownTextBlock; - - // Defer to the instance method. - instance?.OnPropertyChanged(d, e.Property); - } - - /// <summary> - /// Fired when the value of a DependencyProperty is changed. - /// </summary> - private void OnPropertyChanged(DependencyObject d, DependencyProperty prop) - { - RenderMarkdown(); - } - - /// <summary> - /// Fired when a user taps one of the link elements - /// </summary> - private void Hyperlink_Click(Hyperlink sender, HyperlinkClickEventArgs args) - { - LinkHandled((string)sender.GetValue(HyperlinkUrlProperty), true); - } - - /// <summary> - /// Fired when a user taps one of the image elements - /// </summary> - private void NewImagelink_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) - { - string hyperLink = (string)(sender as Image).GetValue(HyperlinkUrlProperty); - bool isHyperLink = (bool)(sender as Image).GetValue(IsHyperlinkProperty); - LinkHandled(hyperLink, isHyperLink); - } - - /// <summary> - /// Fired when the text is done parsing and formatting. Fires each time the markdown is rendered. - /// </summary> - public event EventHandler<MarkdownRenderedEventArgs> MarkdownRendered; - - /// <summary> - /// Fired when a link element in the markdown was tapped. - /// </summary> - public event EventHandler<LinkClickedEventArgs> LinkClicked; - - /// <summary> - /// Fired when an image element in the markdown was tapped. - /// </summary> - public event EventHandler<LinkClickedEventArgs> ImageClicked; - - /// <summary> - /// Fired when an image from the markdown document needs to be resolved. - /// The default implementation is basically <code>new BitmapImage(new Uri(e.Url));</code>. - /// <para/>You must set <see cref="ImageResolvingEventArgs.Handled"/> to true in order to process your changes. - /// </summary> - public event EventHandler<ImageResolvingEventArgs> ImageResolving; - - /// <summary> - /// Fired when a Code Block is being Rendered. - /// The default implementation is to output the CodeBlock as Plain Text. - /// <para/>You must set <see cref="CodeBlockResolvingEventArgs.Handled"/> to true in order to process your changes. - /// </summary> - public event EventHandler<CodeBlockResolvingEventArgs> CodeBlockResolving; - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.Methods.cs b/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.Methods.cs deleted file mode 100644 index a5ede2de5..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.Methods.cs +++ /dev/null @@ -1,376 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock - -namespace Notepads.Controls -{ - using System; - using System.Diagnostics; - using System.IO; - using System.Linq; - using System.Threading.Tasks; - using ColorCode; - using Windows.UI.Core; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Documents; - using Windows.UI.Xaml.Media; - using Windows.UI.Xaml.Media.Imaging; - using Notepads.Controls.Markdown; - - /// <summary> - /// An efficient and extensible control that can parse and render markdown. - /// </summary> - public partial class MarkdownTextBlock - { - /// <summary> - /// Sets the Markdown Renderer for Rendering the UI. - /// </summary> - /// <typeparam name="T">The Inherited Markdown Render</typeparam> - public void SetRenderer<T>() - where T : MarkdownRenderer - { - renderertype = typeof(T); - } - - /// <summary> - /// Called to preform a render of the current Markdown. - /// </summary> - private void RenderMarkdown() - { - // Leave if we don't have our root yet. - if (_rootElement == null) - { - return; - } - - // Disconnect from OnClick handlers. - UnhookListeners(); - - // Clear everything that exists. - _listeningHyperlinks.Clear(); - - var markdownRenderedArgs = new MarkdownRenderedEventArgs(null); - - // Make sure we have something to parse. - if (string.IsNullOrWhiteSpace(Text)) - { - _rootElement.Child = null; - } - else - { - try - { - // Try to parse the markdown. - MarkdownDocument markdown = new MarkdownDocument(); - foreach (string str in SchemeList.Split(',').ToList()) - { - if (!string.IsNullOrEmpty(str)) - { - MarkdownDocument.KnownSchemes.Add(str); - } - } - - markdown.Parse(Text); - - // Now try to display it - if (!(Activator.CreateInstance(renderertype, markdown, this, this, this) is MarkdownRenderer renderer)) - { - throw new Exception("Markdown Renderer was not of the correct type."); - } - - renderer.Background = Background; - renderer.BorderBrush = BorderBrush; - renderer.BorderThickness = BorderThickness; - renderer.CharacterSpacing = CharacterSpacing; - renderer.FontFamily = FontFamily; - renderer.FontSize = FontSize; - renderer.FontStretch = FontStretch; - renderer.FontStyle = FontStyle; - renderer.FontWeight = FontWeight; - renderer.Foreground = Foreground; - renderer.IsTextSelectionEnabled = IsTextSelectionEnabled; - renderer.Padding = Padding; - renderer.CodeBackground = CodeBackground; - renderer.CodeBorderBrush = CodeBorderBrush; - renderer.CodeBorderThickness = CodeBorderThickness; - renderer.InlineCodeBorderThickness = InlineCodeBorderThickness; - renderer.InlineCodeBackground = InlineCodeBackground; - renderer.InlineCodeBorderBrush = InlineCodeBorderBrush; - renderer.InlineCodePadding = InlineCodePadding; - renderer.InlineCodeFontFamily = InlineCodeFontFamily; - renderer.InlineCodeForeground = InlineCodeForeground; - renderer.CodeForeground = CodeForeground; - renderer.CodeFontFamily = CodeFontFamily; - renderer.CodePadding = CodePadding; - renderer.CodeMargin = CodeMargin; - renderer.EmojiFontFamily = EmojiFontFamily; - renderer.Header1FontSize = Header1FontSize; - renderer.Header1FontWeight = Header1FontWeight; - renderer.Header1Margin = Header1Margin; - renderer.Header1Foreground = Header1Foreground; - renderer.Header2FontSize = Header2FontSize; - renderer.Header2FontWeight = Header2FontWeight; - renderer.Header2Margin = Header2Margin; - renderer.Header2Foreground = Header2Foreground; - renderer.Header3FontSize = Header3FontSize; - renderer.Header3FontWeight = Header3FontWeight; - renderer.Header3Margin = Header3Margin; - renderer.Header3Foreground = Header3Foreground; - renderer.Header4FontSize = Header4FontSize; - renderer.Header4FontWeight = Header4FontWeight; - renderer.Header4Margin = Header4Margin; - renderer.Header4Foreground = Header4Foreground; - renderer.Header5FontSize = Header5FontSize; - renderer.Header5FontWeight = Header5FontWeight; - renderer.Header5Margin = Header5Margin; - renderer.Header5Foreground = Header5Foreground; - renderer.Header6FontSize = Header6FontSize; - renderer.Header6FontWeight = Header6FontWeight; - renderer.Header6Margin = Header6Margin; - renderer.Header6Foreground = Header6Foreground; - renderer.HorizontalRuleBrush = HorizontalRuleBrush; - renderer.HorizontalRuleMargin = HorizontalRuleMargin; - renderer.HorizontalRuleThickness = HorizontalRuleThickness; - renderer.ListMargin = ListMargin; - renderer.ListGutterWidth = ListGutterWidth; - renderer.ListBulletSpacing = ListBulletSpacing; - renderer.ParagraphMargin = ParagraphMargin; - renderer.ParagraphLineHeight = ParagraphLineHeight; - renderer.QuoteBackground = QuoteBackground; - renderer.QuoteBorderBrush = QuoteBorderBrush; - renderer.QuoteBorderThickness = QuoteBorderThickness; - renderer.QuoteForeground = QuoteForeground; - renderer.QuoteMargin = QuoteMargin; - renderer.QuotePadding = QuotePadding; - renderer.TableBorderBrush = TableBorderBrush; - renderer.TableBorderThickness = TableBorderThickness; - renderer.YamlBorderBrush = YamlBorderBrush; - renderer.YamlBorderThickness = YamlBorderThickness; - renderer.TableCellPadding = TableCellPadding; - renderer.TableMargin = TableMargin; - renderer.TextWrapping = TextWrapping; - renderer.LinkForeground = LinkForeground; - renderer.ImageStretch = ImageStretch; - renderer.ImageMaxHeight = ImageMaxHeight; - renderer.ImageMaxWidth = ImageMaxWidth; - renderer.WrapCodeBlock = WrapCodeBlock; - renderer.FlowDirection = FlowDirection; - - _rootElement.Child = renderer.Render(); - } - catch (Exception ex) - { - Debug.WriteLine("Error while parsing and rendering: " + ex.Message); - if (Debugger.IsAttached) - { - Debugger.Break(); - } - - markdownRenderedArgs = new MarkdownRenderedEventArgs(ex); - } - } - - // Indicate that the parse is done. - MarkdownRendered?.Invoke(this, markdownRenderedArgs); - } - - private void HookListeners() - { - // Re-hook all hyper link events we currently have - foreach (object link in _listeningHyperlinks) - { - if (link is Hyperlink hyperlink) - { - hyperlink.Click -= Hyperlink_Click; - hyperlink.Click += Hyperlink_Click; - } - else if (link is Image image) - { - image.Tapped -= NewImagelink_Tapped; - image.Tapped += NewImagelink_Tapped; - } - } - } - - private void UnhookListeners() - { - // Unhook any hyper link events if we have any - foreach (object link in _listeningHyperlinks) - { - if (link is Hyperlink hyperlink) - { - hyperlink.Click -= Hyperlink_Click; - } - else if (link is Image image) - { - image.Tapped -= NewImagelink_Tapped; - } - } - } - - /// <summary> - /// Called when the render has a link we need to listen to. - /// </summary> - public void RegisterNewHyperLink(Hyperlink newHyperlink, string linkUrl) - { - // Setup a listener for clicks. - newHyperlink.Click += Hyperlink_Click; - - // Associate the URL with the hyperlink. - newHyperlink.SetValue(HyperlinkUrlProperty, linkUrl); - - // Add it to our list - _listeningHyperlinks.Add(newHyperlink); - } - - /// <summary> - /// Called when the render has a link we need to listen to. - /// </summary> - public void RegisterNewHyperLink(Image newImagelink, string linkUrl, bool isHyperLink) - { - // Setup a listener for clicks. - newImagelink.Tapped += NewImagelink_Tapped; - - // Associate the URL with the hyperlink. - newImagelink.SetValue(HyperlinkUrlProperty, linkUrl); - - // Set if the Image is HyperLink or not - newImagelink.SetValue(IsHyperlinkProperty, isHyperLink); - - // Add it to our list - _listeningHyperlinks.Add(newImagelink); - } - - /// <summary> - /// Called when the renderer needs to display a image. - /// </summary> - /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> - async Task<ImageSource> IImageResolver.ResolveImageAsync(string url, string tooltip) - { - if (!Uri.TryCreate(url, UriKind.Absolute, out Uri uri)) - { - if (!string.IsNullOrEmpty(UriPrefix)) - { - url = $"{UriPrefix}{url}"; - } - } - - var eventArgs = new ImageResolvingEventArgs(url, tooltip); - ImageResolving?.Invoke(this, eventArgs); - - await eventArgs.WaitForDeferrals(); - - try - { - return eventArgs.Handled - ? eventArgs.Image - : GetImageSource(new Uri(url)); - } - catch (Exception) - { - return null; - } - - ImageSource GetImageSource(Uri imageUrl) - { - if (_isSvgImageSupported) - { - if (Path.GetExtension(imageUrl.AbsolutePath)?.ToLowerInvariant() == ".svg") - { - return new SvgImageSource(imageUrl); - } - } - - return new BitmapImage(imageUrl); - } - } - - /// <summary> - /// Called when a Code Block is being rendered. - /// </summary> - /// <returns>Parsing was handled Successfully</returns> - bool ICodeBlockResolver.ParseSyntax(InlineCollection inlineCollection, string text, string codeLanguage) - { - var eventArgs = new CodeBlockResolvingEventArgs(inlineCollection, text, codeLanguage); - CodeBlockResolving?.Invoke(this, eventArgs); - - try - { - var result = eventArgs.Handled; - if (UseSyntaxHighlighting && !result && codeLanguage != null) - { - var language = Languages.FindById(codeLanguage); - if (language != null) - { - RichTextBlockFormatter formatter; - if (CodeStyling != null) - { - formatter = new RichTextBlockFormatter(CodeStyling); - } - else - { - //var theme = themeListener.CurrentTheme == ApplicationTheme.Dark ? ElementTheme.Dark : ElementTheme.Light; - //if (RequestedTheme != ElementTheme.Default) - //{ - // theme = RequestedTheme; - //} - - var theme = ActualTheme; - if (RequestedTheme != ElementTheme.Default) - { - theme = RequestedTheme; - } - - formatter = new RichTextBlockFormatter(theme); - } - - formatter.FormatInlines(text, language, inlineCollection); - return true; - } - } - - return result; - } - catch - { - return false; - } - } - - /// <summary> - /// Called when a link needs to be handled - /// </summary> - internal async void LinkHandled(string url, bool isHyperlink) - { - // Links that are nested within superscript elements cause the Click event to fire multiple times. - // e.g. this markdown "[^bot](http://www.reddit.com/r/youtubefactsbot/wiki/index)" - // Therefore we detect and ignore multiple clicks. - if (multiClickDetectionTriggered) - { - return; - } - - multiClickDetectionTriggered = true; - await Dispatcher.RunAsync(CoreDispatcherPriority.High, () => multiClickDetectionTriggered = false); - - // Get the hyperlink URL. - if (url == null) - { - return; - } - - // Fire off the event. - var eventArgs = new LinkClickedEventArgs(url); - if (isHyperlink) - { - LinkClicked?.Invoke(this, eventArgs); - } - else - { - ImageClicked?.Invoke(this, eventArgs); - } - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.Properties.cs b/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.Properties.cs deleted file mode 100644 index ae95a32ac..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.Properties.cs +++ /dev/null @@ -1,692 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock - -namespace Notepads.Controls -{ - using System; - using System.Collections.Generic; - using ColorCode.Styling; - using Windows.Foundation.Metadata; - using Windows.UI.Text; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Media; - using Notepads.Controls.Markdown; - - /// <summary> - /// An efficient and extensible control that can parse and render markdown. - /// </summary> - public partial class MarkdownTextBlock - { - // SvgImageSource was introduced in Creators Update (15063) - private static readonly bool _isSvgImageSupported = ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 4); - - // Used to attach the URL to hyperlinks. - private static readonly DependencyProperty HyperlinkUrlProperty = - DependencyProperty.RegisterAttached("HyperlinkUrl", typeof(string), typeof(MarkdownTextBlock), new PropertyMetadata(null)); - - // Checks if clicked image is a hyperlink or not. - private static readonly DependencyProperty IsHyperlinkProperty = - DependencyProperty.RegisterAttached("IsHyperLink", typeof(string), typeof(MarkdownTextBlock), new PropertyMetadata(null)); - - /// <summary> - /// Gets the dependency property for <see cref="CodeStyling"/>. - /// </summary> - public static readonly DependencyProperty CodeStylingProperty = - DependencyProperty.Register( - nameof(CodeStyling), - typeof(StyleDictionary), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="UseSyntaxHighlighting"/>. - /// </summary> - public static readonly DependencyProperty UseSyntaxHighlightingProperty = - DependencyProperty.Register( - nameof(UseSyntaxHighlighting), - typeof(bool), - typeof(MarkdownTextBlock), - new PropertyMetadata(true, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="WrapCodeBlock"/>. - /// </summary> - public static readonly DependencyProperty WrapCodeBlockProperty = - DependencyProperty.Register(nameof(WrapCodeBlock), typeof(bool), typeof(MarkdownTextBlock), new PropertyMetadata(false)); - - /// <summary> - /// Gets the dependency property for <see cref="Text"/>. - /// </summary> - public static readonly DependencyProperty TextProperty = DependencyProperty.Register( - nameof(Text), - typeof(string), - typeof(MarkdownTextBlock), - new PropertyMetadata(string.Empty, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="InlineCodeBackground"/>. - /// </summary> - public static readonly DependencyProperty InlineCodeBackgroundProperty = - DependencyProperty.Register( - nameof(InlineCodeBackground), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="InlineCodeForeground"/>. - /// </summary> - public static readonly DependencyProperty InlineCodeForegroundProperty = - DependencyProperty.Register( - nameof(InlineCodeForeground), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="InlineCodeBorderBrush"/>. - /// </summary> - public static readonly DependencyProperty InlineCodeBorderBrushProperty = - DependencyProperty.Register( - nameof(InlineCodeBorderBrush), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="IsTextSelectionEnabled"/>. - /// </summary> - public static readonly DependencyProperty IsTextSelectionEnabledProperty = DependencyProperty.Register( - nameof(IsTextSelectionEnabled), - typeof(bool), - typeof(MarkdownTextBlock), - new PropertyMetadata(true, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="LinkForeground"/>. - /// </summary> - public static readonly DependencyProperty LinkForegroundProperty = DependencyProperty.Register( - nameof(LinkForeground), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="CodeBackground"/>. - /// </summary> - public static readonly DependencyProperty CodeBackgroundProperty = DependencyProperty.Register( - nameof(CodeBackground), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="CodeBorderBrush"/>. - /// </summary> - public static readonly DependencyProperty CodeBorderBrushProperty = DependencyProperty.Register( - nameof(CodeBorderBrush), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="CodeForeground"/>. - /// </summary> - public static readonly DependencyProperty CodeForegroundProperty = DependencyProperty.Register( - nameof(CodeForeground), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="CodeFontFamily"/>. - /// </summary> - public static readonly DependencyProperty CodeFontFamilyProperty = DependencyProperty.Register( - nameof(CodeFontFamily), - typeof(FontFamily), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="InlineCodeFontFamily"/>. - /// </summary> - public static readonly DependencyProperty InlineCodeFontFamilyProperty = DependencyProperty.Register( - nameof(InlineCodeFontFamily), - typeof(FontFamily), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="EmojiFontFamily"/>. - /// </summary> - public static readonly DependencyProperty EmojiFontFamilyProperty = DependencyProperty.Register( - nameof(EmojiFontFamily), - typeof(FontFamily), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header1FontWeight"/>. - /// </summary> - public static readonly DependencyProperty Header1FontWeightProperty = DependencyProperty.Register( - nameof(Header1FontWeight), - typeof(FontWeight), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header1Foreground"/>. - /// </summary> - public static readonly DependencyProperty Header1ForegroundProperty = DependencyProperty.Register( - nameof(Header1Foreground), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header2FontWeight"/>. - /// </summary> - public static readonly DependencyProperty Header2FontWeightProperty = DependencyProperty.Register( - nameof(Header2FontWeight), - typeof(FontWeight), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header2Foreground"/>. - /// </summary> - public static readonly DependencyProperty Header2ForegroundProperty = DependencyProperty.Register( - nameof(Header2Foreground), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header3FontWeight"/>. - /// </summary> - public static readonly DependencyProperty Header3FontWeightProperty = DependencyProperty.Register( - nameof(Header3FontWeight), - typeof(FontWeight), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header3Foreground"/>. - /// </summary> - public static readonly DependencyProperty Header3ForegroundProperty = DependencyProperty.Register( - nameof(Header3Foreground), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header4FontWeight"/>. - /// </summary> - public static readonly DependencyProperty Header4FontWeightProperty = DependencyProperty.Register( - nameof(Header4FontWeight), - typeof(FontWeight), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header4Foreground"/>. - /// </summary> - public static readonly DependencyProperty Header4ForegroundProperty = DependencyProperty.Register( - nameof(Header4Foreground), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header5FontWeight"/>. - /// </summary> - public static readonly DependencyProperty Header5FontWeightProperty = DependencyProperty.Register( - nameof(Header5FontWeight), - typeof(FontWeight), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header5Foreground"/>. - /// </summary> - public static readonly DependencyProperty Header5ForegroundProperty = DependencyProperty.Register( - nameof(Header5Foreground), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header6FontWeight"/>. - /// </summary> - public static readonly DependencyProperty Header6FontWeightProperty = DependencyProperty.Register( - nameof(Header6FontWeight), - typeof(FontWeight), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="Header6Foreground"/>. - /// </summary> - public static readonly DependencyProperty Header6ForegroundProperty = DependencyProperty.Register( - nameof(Header6Foreground), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="HorizontalRuleBrush"/>. - /// </summary> - public static readonly DependencyProperty HorizontalRuleBrushProperty = DependencyProperty.Register( - nameof(HorizontalRuleBrush), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="QuoteBackground"/>. - /// </summary> - public static readonly DependencyProperty QuoteBackgroundProperty = DependencyProperty.Register( - nameof(QuoteBackground), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="QuoteBorderBrush"/>. - /// </summary> - public static readonly DependencyProperty QuoteBorderBrushProperty = DependencyProperty.Register( - nameof(QuoteBorderBrush), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="QuoteForeground"/>. - /// </summary> - public static readonly DependencyProperty QuoteForegroundProperty = DependencyProperty.Register( - nameof(QuoteForeground), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="TableBorderBrush"/>. - /// </summary> - public static readonly DependencyProperty TableBorderBrushProperty = DependencyProperty.Register( - nameof(TableBorderBrush), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="YamlBorderBrush"/>. - /// </summary> - public static readonly DependencyProperty YamlBorderBrushProperty = DependencyProperty.Register( - nameof(YamlBorderBrush), - typeof(Brush), - typeof(MarkdownTextBlock), - new PropertyMetadata(null, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="UriPrefix"/>. - /// </summary> - public static readonly DependencyProperty UriPrefixProperty = DependencyProperty.Register( - nameof(UriPrefix), - typeof(string), - typeof(MarkdownTextBlock), - new PropertyMetadata(string.Empty, OnPropertyChangedStatic)); - - /// <summary> - /// Gets the dependency property for <see cref="UriPrefix"/>. - /// </summary> - public static readonly DependencyProperty SchemeListProperty = DependencyProperty.Register( - nameof(SchemeList), - typeof(string), - typeof(MarkdownTextBlock), - new PropertyMetadata(string.Empty, OnPropertyChangedStatic)); - - /// <summary> - /// Gets or sets the markdown text to display. - /// </summary> - public string Text - { - get => (string)GetValue(TextProperty); - set => SetValue(TextProperty, value); - } - - /// <summary> - /// Gets or sets a value indicating whether to use Syntax Highlighting on Code. - /// </summary> - public bool UseSyntaxHighlighting - { - get => (bool)GetValue(UseSyntaxHighlightingProperty); - set => SetValue(UseSyntaxHighlightingProperty, value); - } - - /// <summary> - /// Gets or sets a value indicating whether to Wrap the Code Block or use a Horizontal Scroll. - /// </summary> - public bool WrapCodeBlock - { - get => (bool)GetValue(WrapCodeBlockProperty); - set => SetValue(WrapCodeBlockProperty, value); - } - - /// <summary> - /// Gets or sets the Default Code Styling for Code Blocks. - /// </summary> - public StyleDictionary CodeStyling - { - get => (StyleDictionary)GetValue(CodeStylingProperty); - set => SetValue(CodeStylingProperty, value); - } - - /// <summary> - /// Gets or sets a value indicating whether text selection is enabled. - /// </summary> - public bool IsTextSelectionEnabled - { - get => (bool)GetValue(IsTextSelectionEnabledProperty); - set => SetValue(IsTextSelectionEnabledProperty, value); - } - - /// <summary> - /// Gets or sets the brush used to render links. If this is - /// <c>null</c>, then Foreground is used. - /// </summary> - public Brush LinkForeground - { - get => (Brush)GetValue(LinkForegroundProperty); - set => SetValue(LinkForegroundProperty, value); - } - - /// <summary> - /// Gets or sets the brush used to fill the background of a code block. - /// </summary> - public Brush CodeBackground - { - get => (Brush)GetValue(CodeBackgroundProperty); - set => SetValue(CodeBackgroundProperty, value); - } - - /// <summary> - /// Gets or sets the brush used to render the border fill of a code block. - /// </summary> - public Brush CodeBorderBrush - { - get => (Brush)GetValue(CodeBorderBrushProperty); - set => SetValue(CodeBorderBrushProperty, value); - } - - /// <summary> - /// Gets or sets the brush used to render the text inside a code block. If this is - /// <c>null</c>, then Foreground is used. - /// </summary> - public Brush CodeForeground - { - get => (Brush)GetValue(CodeForegroundProperty); - set => SetValue(CodeForegroundProperty, value); - } - - /// <summary> - /// Gets or sets the font used to display code. If this is <c>null</c>, then - /// <see cref="FontFamily"/> is used. - /// </summary> - public FontFamily CodeFontFamily - { - get => (FontFamily)GetValue(CodeFontFamilyProperty); - set => SetValue(CodeFontFamilyProperty, value); - } - - /// <summary> - /// Gets or sets the font used to display code. If this is <c>null</c>, then - /// <see cref="FontFamily"/> is used. - /// </summary> - public FontFamily InlineCodeFontFamily - { - get => (FontFamily)GetValue(InlineCodeFontFamilyProperty); - set => SetValue(InlineCodeFontFamilyProperty, value); - } - - /// <summary> - /// Gets or sets the background brush for inline code. - /// </summary> - public Brush InlineCodeBackground - { - get => (Brush)GetValue(InlineCodeBackgroundProperty); - set => SetValue(InlineCodeBackgroundProperty, value); - } - - /// <summary> - /// Gets or sets the foreground brush for inline code. - /// </summary> - public Brush InlineCodeForeground - { - get => (Brush)GetValue(InlineCodeForegroundProperty); - set => SetValue(InlineCodeForegroundProperty, value); - } - - /// <summary> - /// Gets or sets the border brush for inline code. - /// </summary> - public Brush InlineCodeBorderBrush - { - get => (Brush)GetValue(InlineCodeBorderBrushProperty); - set => SetValue(InlineCodeBorderBrushProperty, value); - } - - /// <summary> - /// Gets or sets the font used to display emojis. If this is <c>null</c>, then - /// Segoe UI Emoji font is used. - /// </summary> - public FontFamily EmojiFontFamily - { - get => (FontFamily)GetValue(EmojiFontFamilyProperty); - set => SetValue(EmojiFontFamilyProperty, value); - } - - /// <summary> - /// Gets or sets the font weight to use for level 1 headers. - /// </summary> - public FontWeight Header1FontWeight - { - get => (FontWeight)GetValue(Header1FontWeightProperty); - set => SetValue(Header1FontWeightProperty, value); - } - - /// <summary> - /// Gets or sets the foreground brush for level 1 headers. - /// </summary> - public Brush Header1Foreground - { - get => (Brush)GetValue(Header1ForegroundProperty); - set => SetValue(Header1ForegroundProperty, value); - } - - /// <summary> - /// Gets or sets the font weight to use for level 2 headers. - /// </summary> - public FontWeight Header2FontWeight - { - get => (FontWeight)GetValue(Header2FontWeightProperty); - set => SetValue(Header2FontWeightProperty, value); - } - - /// <summary> - /// Gets or sets the foreground brush for level 2 headers. - /// </summary> - public Brush Header2Foreground - { - get => (Brush)GetValue(Header2ForegroundProperty); - set => SetValue(Header2ForegroundProperty, value); - } - - /// <summary> - /// Gets or sets the font weight to use for level 3 headers. - /// </summary> - public FontWeight Header3FontWeight - { - get => (FontWeight)GetValue(Header3FontWeightProperty); - set => SetValue(Header3FontWeightProperty, value); - } - - /// <summary> - /// Gets or sets the foreground brush for level 3 headers. - /// </summary> - public Brush Header3Foreground - { - get => (Brush)GetValue(Header3ForegroundProperty); - set => SetValue(Header3ForegroundProperty, value); - } - - /// <summary> - /// Gets or sets the font weight to use for level 4 headers. - /// </summary> - public FontWeight Header4FontWeight - { - get => (FontWeight)GetValue(Header4FontWeightProperty); - set => SetValue(Header4FontWeightProperty, value); - } - - /// <summary> - /// Gets or sets the foreground brush for level 4 headers. - /// </summary> - public Brush Header4Foreground - { - get => (Brush)GetValue(Header4ForegroundProperty); - set => SetValue(Header4ForegroundProperty, value); - } - - /// <summary> - /// Gets or sets the font weight to use for level 5 headers. - /// </summary> - public FontWeight Header5FontWeight - { - get => (FontWeight)GetValue(Header5FontWeightProperty); - set => SetValue(Header5FontWeightProperty, value); - } - - /// <summary> - /// Gets or sets the foreground brush for level 5 headers. - /// </summary> - public Brush Header5Foreground - { - get => (Brush)GetValue(Header5ForegroundProperty); - set => SetValue(Header5ForegroundProperty, value); - } - - /// <summary> - /// Gets or sets the font weight to use for level 6 headers. - /// </summary> - public FontWeight Header6FontWeight - { - get => (FontWeight)GetValue(Header6FontWeightProperty); - set => SetValue(Header6FontWeightProperty, value); - } - - /// <summary> - /// Gets or sets the foreground brush for level 6 headers. - /// </summary> - public Brush Header6Foreground - { - get => (Brush)GetValue(Header6ForegroundProperty); - set => SetValue(Header6ForegroundProperty, value); - } - - /// <summary> - /// Gets or sets the brush used to render a horizontal rule. If this is <c>null</c>, then - /// <see cref="HorizontalRuleBrush"/> is used. - /// </summary> - public Brush HorizontalRuleBrush - { - get => (Brush)GetValue(HorizontalRuleBrushProperty); - set => SetValue(HorizontalRuleBrushProperty, value); - } - - /// <summary> - /// Gets or sets the brush used to fill the background of a quote block. - /// </summary> - public Brush QuoteBackground - { - get => (Brush)GetValue(QuoteBackgroundProperty); - set => SetValue(QuoteBackgroundProperty, value); - } - - /// <summary> - /// Gets or sets the brush used to render a quote border. If this is <c>null</c>, then - /// <see cref="QuoteBorderBrush"/> is used. - /// </summary> - public Brush QuoteBorderBrush - { - get => (Brush)GetValue(QuoteBorderBrushProperty); - set => SetValue(QuoteBorderBrushProperty, value); - } - - /// <summary> - /// Gets or sets the brush used to render the text inside a quote block. If this is - /// <c>null</c>, then Foreground is used. - /// </summary> - public Brush QuoteForeground - { - get => (Brush)GetValue(QuoteForegroundProperty); - set => SetValue(QuoteForegroundProperty, value); - } - - /// <summary> - /// Gets or sets the brush used to render table borders. If this is <c>null</c>, then - /// <see cref="TableBorderBrush"/> is used. - /// </summary> - public Brush TableBorderBrush - { - get => (Brush)GetValue(TableBorderBrushProperty); - set => SetValue(TableBorderBrushProperty, value); - } - - /// <summary> - /// Gets or sets the brush used to render yaml borders. If this is <c>null</c>, then - /// <see cref="TableBorderBrush"/> is used. - /// </summary> - public Brush YamlBorderBrush - { - get => (Brush)GetValue(TableBorderBrushProperty); - set => SetValue(TableBorderBrushProperty, value); - } - - /// <summary> - /// Gets or sets the Prefix of Uri. - /// </summary> - public string UriPrefix - { - get => (string)GetValue(UriPrefixProperty); - set => SetValue(UriPrefixProperty, value); - } - - /// <summary> - /// Gets or sets the SchemeList. - /// </summary> - public string SchemeList - { - get => (string)GetValue(SchemeListProperty); - set => SetValue(SchemeListProperty, value); - } - - /// <summary> - /// Holds a list of hyperlinks we are listening to. - /// </summary> - private readonly List<object> _listeningHyperlinks = new List<object>(); - - /// <summary> - /// The root element for our rendering. - /// </summary> - private Border _rootElement; - - private bool multiClickDetectionTriggered; - - private Type renderertype = typeof(MarkdownRenderer); - - //private ThemeListener themeListener; - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.cs b/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.cs deleted file mode 100644 index c39cec77c..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.cs +++ /dev/null @@ -1,130 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock - -namespace Notepads.Controls -{ - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - using Notepads.Controls.Markdown; - - /// <summary> - /// An efficient and extensible control that can parse and render markdown. - /// </summary> - public partial class MarkdownTextBlock : Control, ILinkRegister, IImageResolver, ICodeBlockResolver - { - private long _fontSizePropertyToken; - private long _flowDirectionPropertyToken; - private long _backgroundPropertyToken; - private long _borderBrushPropertyToken; - private long _borderThicknessPropertyToken; - private long _characterSpacingPropertyToken; - private long _fontFamilyPropertyToken; - private long _fontStretchPropertyToken; - private long _fontStylePropertyToken; - private long _fontWeightPropertyToken; - private long _foregroundPropertyToken; - private long _paddingPropertyToken; - private long _requestedThemePropertyToken; - - /// <summary> - /// Initializes a new instance of the <see cref="MarkdownTextBlock"/> class. - /// </summary> - public MarkdownTextBlock() - { - // Set our style. - DefaultStyleKey = typeof(MarkdownTextBlock); - - Loaded += OnLoaded; - Unloaded += OnUnloaded; - } - - //private void ThemeListener_ThemeChanged(Helpers.ThemeListener sender) - //{ - // if (ToElementTheme(sender.CurrentTheme) != RequestedTheme) - // { - // RenderMarkdown(); - // } - //} - - private void OnLoaded(object sender, RoutedEventArgs e) - { - RegisterThemeChangedHandler(); - HookListeners(); - - // Register for property callbacks that are owned by our parent class. - _fontSizePropertyToken = RegisterPropertyChangedCallback(FontSizeProperty, OnPropertyChanged); - _flowDirectionPropertyToken = RegisterPropertyChangedCallback(FlowDirectionProperty, OnPropertyChanged); - _backgroundPropertyToken = RegisterPropertyChangedCallback(BackgroundProperty, OnPropertyChanged); - _borderBrushPropertyToken = RegisterPropertyChangedCallback(BorderBrushProperty, OnPropertyChanged); - _borderThicknessPropertyToken = RegisterPropertyChangedCallback(BorderThicknessProperty, OnPropertyChanged); - _characterSpacingPropertyToken = RegisterPropertyChangedCallback(CharacterSpacingProperty, OnPropertyChanged); - _fontFamilyPropertyToken = RegisterPropertyChangedCallback(FontFamilyProperty, OnPropertyChanged); - _fontStretchPropertyToken = RegisterPropertyChangedCallback(FontStretchProperty, OnPropertyChanged); - _fontStylePropertyToken = RegisterPropertyChangedCallback(FontStyleProperty, OnPropertyChanged); - _fontWeightPropertyToken = RegisterPropertyChangedCallback(FontWeightProperty, OnPropertyChanged); - _foregroundPropertyToken = RegisterPropertyChangedCallback(ForegroundProperty, OnPropertyChanged); - _paddingPropertyToken = RegisterPropertyChangedCallback(PaddingProperty, OnPropertyChanged); - _requestedThemePropertyToken = RegisterPropertyChangedCallback(RequestedThemeProperty, OnPropertyChanged); - } - - private void OnUnloaded(object sender, RoutedEventArgs e) - { - //if (themeListener != null) - //{ - // UnhookListeners(); - // themeListener.ThemeChanged -= ThemeListener_ThemeChanged; - // themeListener.Dispose(); - // themeListener = null; - //} - - // Register for property callbacks that are owned by our parent class. - UnregisterPropertyChangedCallback(FontSizeProperty, _fontSizePropertyToken); - UnregisterPropertyChangedCallback(FlowDirectionProperty, _flowDirectionPropertyToken); - UnregisterPropertyChangedCallback(BackgroundProperty, _backgroundPropertyToken); - UnregisterPropertyChangedCallback(BorderBrushProperty, _borderBrushPropertyToken); - UnregisterPropertyChangedCallback(BorderThicknessProperty, _borderThicknessPropertyToken); - UnregisterPropertyChangedCallback(CharacterSpacingProperty, _characterSpacingPropertyToken); - UnregisterPropertyChangedCallback(FontFamilyProperty, _fontFamilyPropertyToken); - UnregisterPropertyChangedCallback(FontStretchProperty, _fontStretchPropertyToken); - UnregisterPropertyChangedCallback(FontStyleProperty, _fontStylePropertyToken); - UnregisterPropertyChangedCallback(FontWeightProperty, _fontWeightPropertyToken); - UnregisterPropertyChangedCallback(ForegroundProperty, _foregroundPropertyToken); - UnregisterPropertyChangedCallback(PaddingProperty, _paddingPropertyToken); - UnregisterPropertyChangedCallback(RequestedThemeProperty, _requestedThemePropertyToken); - } - - /// <inheritdoc /> - protected override void OnApplyTemplate() - { - RegisterThemeChangedHandler(); - - // Grab our root - _rootElement = GetTemplateChild("RootElement") as Border; - - // And make sure to render any markdown we have. - RenderMarkdown(); - } - - private void RegisterThemeChangedHandler() - { - //themeListener = themeListener ?? new ThemeListener(); - //themeListener.ThemeChanged -= ThemeListener_ThemeChanged; - //themeListener.ThemeChanged += ThemeListener_ThemeChanged; - } - - //public static ElementTheme ToElementTheme(ApplicationTheme theme) - //{ - // switch (theme) - // { - // case ApplicationTheme.Light: - // return ElementTheme.Light; - // case ApplicationTheme.Dark: - // return ElementTheme.Dark; - // default: - // return ElementTheme.Default; - // } - //} - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.xaml b/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.xaml deleted file mode 100644 index c6e00ded2..000000000 --- a/src/Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.xaml +++ /dev/null @@ -1,107 +0,0 @@ -<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:Notepads.Controls"> - - <ResourceDictionary.ThemeDictionaries> - <ResourceDictionary x:Key="Default" /> - <ResourceDictionary x:Key="Light"> - <SolidColorBrush x:Key="MarkdownBorderBrush" Color="#FFBEBEBE" /> - <SolidColorBrush x:Key="MarkdownBackgroundBrush" Color="#FFF6F8FA" /> - <SolidColorBrush x:Key="MarkdownInlineCodeBackgroundBrush" Color="#FFDDDFE1" /> - <SolidColorBrush x:Key="MarkdownInlineCodeForegroundBrush" Color="#FF6E6F70" /> - <SolidColorBrush x:Key="MarkdownQuoteForeground" Color="#FF6E747C" /> - <SolidColorBrush x:Key="MarkdownRichTextBlockBackground" Color="#FFF6F8FA" /> - </ResourceDictionary> - <ResourceDictionary x:Key="Dark"> - <SolidColorBrush x:Key="MarkdownBorderBrush" Color="#FF424242" /> - <SolidColorBrush x:Key="MarkdownBackgroundBrush" Color="#FF202020" /> - <SolidColorBrush x:Key="MarkdownInlineCodeBackgroundBrush" Color="#FF363636" /> - <SolidColorBrush x:Key="MarkdownInlineCodeForegroundBrush" Color="#FFB7B4B4" /> - <SolidColorBrush x:Key="MarkdownQuoteForeground" Color="#FFBEC1C5" /> - <SolidColorBrush x:Key="MarkdownRichTextBlockBackground" Color="#FF202020" /> - </ResourceDictionary> - <ResourceDictionary x:Key="HighContrast"> - <SolidColorBrush x:Key="MarkdownBorderBrush" Color="#FF424242" /> - <SolidColorBrush x:Key="MarkdownBackgroundBrush" Color="#FF202020" /> - <SolidColorBrush x:Key="MarkdownInlineCodeBackgroundBrush" Color="#FF363636" /> - <SolidColorBrush x:Key="MarkdownInlineCodeForegroundBrush" Color="#FFB7B4B4" /> - <SolidColorBrush x:Key="MarkdownQuoteForeground" Color="#FFBEC1C5" /> - <SolidColorBrush x:Key="MarkdownRichTextBlockBackground" Color="{ThemeResource SystemColorWindowColor}" /> - </ResourceDictionary> - </ResourceDictionary.ThemeDictionaries> - - - <Style TargetType="local:MarkdownTextBlock"> - <Setter Property="Background" Value="{ThemeResource MarkdownRichTextBlockBackground}" /> - <Setter Property="IsTabStop" Value="False" /> - <Setter Property="LinkForeground" Value="{ThemeResource SystemColorHotlightColor}" /> - <Setter Property="QuoteBackground" Value="Transparent" /> - <Setter Property="QuoteForeground" Value="{ThemeResource MarkdownQuoteForeground}" /> - <Setter Property="QuoteBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" /> - <Setter Property="QuoteBorderThickness" Value="2, 0, 0, 0" /> - <Setter Property="QuoteMargin" Value="7, 5, 0, 5" /> - <Setter Property="QuotePadding" Value="7, 2, 0, 4" /> - <Setter Property="CodeBackground" Value="{ThemeResource MarkdownBackgroundBrush}" /> - <Setter Property="CodeBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" /> - <Setter Property="CodeBorderThickness" Value="0" /> - <Setter Property="InlineCodeBorderThickness" Value="0" /> - <Setter Property="InlineCodePadding" Value="4, 2, 4, 2" /> - <Setter Property="InlineCodeMargin" Value="2,0,2,-4"/> - <Setter Property="InlineCodeBackground" Value="{ThemeResource MarkdownInlineCodeBackgroundBrush}" /> - <Setter Property="InlineCodeBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" /> - <Setter Property="InlineCodeForeground" Value="{ThemeResource MarkdownInlineCodeForegroundBrush}" /> - <Setter Property="CodeFontFamily" Value="Consolas" /> - <Setter Property="CodeMargin" Value="0, 7, 0, 7" /> - <Setter Property="CodePadding" Value="10, 6, 10, 6" /> - <Setter Property="EmojiFontFamily" Value="Segoe UI Emoji" /> - <Setter Property="Header1FontWeight" Value="Bold" /> - <Setter Property="Header1FontSize" Value="20" /> - <Setter Property="Header1Margin" Value="0, 15, 0, 15" /> - <Setter Property="Header1Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" /> - <Setter Property="Header2FontWeight" Value="Normal" /> - <Setter Property="Header2FontSize" Value="20" /> - <Setter Property="Header2Margin" Value="0, 15, 0, 15" /> - <Setter Property="Header2Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" /> - <Setter Property="Header3FontWeight" Value="Bold" /> - <Setter Property="Header3FontSize" Value="17" /> - <Setter Property="Header3Margin" Value="0, 10, 0, 10" /> - <Setter Property="Header3Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" /> - <Setter Property="Header4FontWeight" Value="Normal" /> - <Setter Property="Header4FontSize" Value="17" /> - <Setter Property="Header4Margin" Value="0, 10, 0, 10" /> - <Setter Property="Header4Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" /> - <Setter Property="Header5FontWeight" Value="Bold" /> - <Setter Property="Header5FontSize" Value="15" /> - <Setter Property="Header5Margin" Value="0, 10, 0, 5" /> - <Setter Property="Header5Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" /> - <Setter Property="Header6FontWeight" Value="Normal" /> - <Setter Property="Header6FontSize" Value="15" /> - <Setter Property="Header6Margin" Value="0, 10, 0, 0" /> - <Setter Property="Header6Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" /> - <Setter Property="HorizontalRuleBrush" Value="{ThemeResource MarkdownBorderBrush}" /> - <Setter Property="HorizontalRuleMargin" Value="0, 7, 0, 7" /> - <Setter Property="HorizontalRuleThickness" Value="2" /> - <Setter Property="ListMargin" Value="0, 5, 0, 5" /> - <Setter Property="ListGutterWidth" Value="32" /> - <Setter Property="ListBulletSpacing" Value="8" /> - <Setter Property="ParagraphMargin" Value="0, 5, 0, 5" /> - <Setter Property="ParagraphLineHeight" Value="20" /> - <Setter Property="TableBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" /> - <Setter Property="TableBorderThickness" Value="1" /> - <Setter Property="TableCellPadding" Value="9, 4, 9, 4" /> - <Setter Property="YamlBorderThickness" Value="1" /> - <Setter Property="YamlBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" /> - <Setter Property="TableMargin" Value="0, 5, 0, 5" /> - <Setter Property="TextWrapping" Value="Wrap" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="local:MarkdownTextBlock"> - <Border x:Name="RootElement" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" /> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> -</ResourceDictionary> \ No newline at end of file diff --git a/src/Notepads.Controls/Notepads.Controls.csproj b/src/Notepads.Controls/Notepads.Controls.csproj index 518ca755b..3e4901658 100644 --- a/src/Notepads.Controls/Notepads.Controls.csproj +++ b/src/Notepads.Controls/Notepads.Controls.csproj @@ -169,103 +169,6 @@ <RestoreProjectStyle>PackageReference</RestoreProjectStyle> </PropertyGroup> <ItemGroup> - <Compile Include="DropShadowPanel\DropShadowPanel.cs" /> - <Compile Include="DropShadowPanel\DropShadowPanel.Properties.cs" /> - <Compile Include="GridSplitter\GridSplitter.cs" /> - <Compile Include="GridSplitter\GridSplitter.Data.cs" /> - <Compile Include="GridSplitter\GridSplitter.Events.cs" /> - <Compile Include="GridSplitter\GridSplitter.Helper.cs" /> - <Compile Include="GridSplitter\GridSplitter.Options.cs" /> - <Compile Include="GridSplitter\GripperHoverWrapper.cs" /> - <Compile Include="Helpers\DispatcherQueueHelper.cs" /> - <Compile Include="Helpers\ThemeListener.cs" /> - <Compile Include="InAppNotification\InAppNotification.AttachedProperties.cs" /> - <Compile Include="InAppNotification\InAppNotification.Constants.cs" /> - <Compile Include="InAppNotification\InAppNotification.cs" /> - <Compile Include="InAppNotification\InAppNotification.Events.cs" /> - <Compile Include="InAppNotification\InAppNotification.Properties.cs" /> - <Compile Include="InAppNotification\InAppNotificationClosedEventArgs.cs" /> - <Compile Include="InAppNotification\InAppNotificationClosingEventArgs.cs" /> - <Compile Include="InAppNotification\InAppNotificationDismissKind.cs" /> - <Compile Include="InAppNotification\InAppNotificationOpeningEventArgs.cs" /> - <Compile Include="InAppNotification\NotificationOptions.cs" /> - <Compile Include="InAppNotification\StackMode.cs" /> - <Compile Include="MarkdownTextBlock\CodeBlockResolvingEventArgs.cs" /> - <Compile Include="MarkdownTextBlock\ImageResolvingEventArgs.cs" /> - <Compile Include="MarkdownTextBlock\LinkClickedEventArgs.cs" /> - <Compile Include="MarkdownTextBlock\MarkdownRenderedEventArgs.cs" /> - <Compile Include="MarkdownTextBlock\MarkdownTextBlock.cs" /> - <Compile Include="MarkdownTextBlock\MarkdownTextBlock.Dimensions.cs" /> - <Compile Include="MarkdownTextBlock\MarkdownTextBlock.Events.cs" /> - <Compile Include="MarkdownTextBlock\MarkdownTextBlock.Methods.cs" /> - <Compile Include="MarkdownTextBlock\MarkdownTextBlock.Properties.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Blocks\CodeBlock.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Blocks\HeaderBlock.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Blocks\HorizontalRuleBlock.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Blocks\LinkReferenceBlock.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Blocks\ListBlock.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Blocks\List\ListItemBlock.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Blocks\List\ListItemBuilder.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Blocks\List\ListItemPreamble.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Blocks\List\NestedListInfo.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Blocks\ParagraphBlock.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Blocks\QuoteBlock.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Blocks\TableBlock.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Blocks\YamlHeaderBlock.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Core\IParser.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Core\ParseHelpers.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Core\SchemaBase.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Core\StringValueAttribute.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Enums\ColumnAlignment.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Enums\HyperlinkType.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Enums\InlineParseMethod.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Enums\ListStyle.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Enums\MarkdownBlockType.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Enums\MarkdownInlineType.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Helpers\Common.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Helpers\DebuggingReporter.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Helpers\InlineParseResult.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Helpers\InlineTripCharHelper.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Helpers\LineInfo.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\BoldItalicTextInline.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\BoldTextInline.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\CodeInline.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\CommentInline.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\EmojiInline.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\EmojiInline.EmojiCodes.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\HyperlinkInline.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\IInlineContainer.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\IInlineLeaf.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\ILinkElement.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\ImageInline.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\ItalicTextInline.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\LinkAnchorInline.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\MarkdownLinkInline.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\StrikethroughTextInline.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\SubscriptTextInline.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\SuperscriptTextInline.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Inlines\TextRunInline.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\MarkdownBlock.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\MarkdownDocument.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\MarkdownElement.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\MarkdownInline.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Render\ICodeBlockResolver.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Render\IImageResolver.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Render\ILinkRegister.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Render\InlineRenderContext.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Render\IRenderContext.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Render\MarkdownRenderer.Blocks.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Render\MarkdownRenderer.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Render\MarkdownRenderer.Dimensions.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Render\MarkdownRenderer.Inlines.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Render\MarkdownRenderer.Properties.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Render\MarkdownRendererBase.Blocks.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Render\MarkdownRendererBase.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Render\MarkdownRendererBase.Inlines.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Render\MarkdownTable.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Render\RenderContext.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Render\RenderContextIncorrectException.cs" /> - <Compile Include="MarkdownTextBlock\Markdown\Render\UIElementCollectionRenderContext.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="SetsView\SetSelectedEventArgs.cs" /> <Compile Include="SetsView\SetClosingEventArgs.cs" /> @@ -286,7 +189,7 @@ <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> <Version>6.2.12</Version> </PackageReference> - <PackageReference Include="Microsoft.Toolkit.Uwp.UI"> + <PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls"> <Version>7.0.0</Version> </PackageReference> <PackageReference Include="Microsoft.UI.Xaml"> @@ -297,26 +200,6 @@ </PackageReference> </ItemGroup> <ItemGroup> - <Page Include="DropShadowPanel\DropShadowPanel.xaml"> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - <Page Include="GridSplitter\GridSplitter.xaml"> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - <Page Include="InAppNotification\InAppNotification.xaml"> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - <Page Include="InAppNotification\Styles\MSEdgeNotificationStyle.xaml"> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - <Page Include="MarkdownTextBlock\MarkdownTextBlock.xaml"> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> <Page Include="SetsView\SetsView.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> diff --git a/src/Notepads.Controls/SetsView/SetsView.cs b/src/Notepads.Controls/SetsView/SetsView.cs index b9f6433fa..005cc0a7f 100644 --- a/src/Notepads.Controls/SetsView/SetsView.cs +++ b/src/Notepads.Controls/SetsView/SetsView.cs @@ -7,6 +7,7 @@ namespace Notepads.Controls using System; using System.Linq; using Microsoft.Toolkit.Uwp.UI; + using Microsoft.Toolkit.Uwp.UI.Controls; using Windows.ApplicationModel.DataTransfer; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; diff --git a/src/Notepads.Controls/SetsView/SetsView.xaml b/src/Notepads.Controls/SetsView/SetsView.xaml index 1c4397a8a..c5e9f8876 100644 --- a/src/Notepads.Controls/SetsView/SetsView.xaml +++ b/src/Notepads.Controls/SetsView/SetsView.xaml @@ -1,8 +1,9 @@ <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters" - xmlns:ui="using:Microsoft.Toolkit.Uwp.UI" - xmlns:controls="using:Notepads.Controls"> + xmlns:wctui="using:Microsoft.Toolkit.Uwp.UI" + xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls" + xmlns:local="using:Notepads.Controls"> <ResourceDictionary.ThemeDictionaries> <ResourceDictionary x:Key="Light"> @@ -126,7 +127,7 @@ FalseValue="{StaticResource SetsViewItemHeaderCloseWidth}" TrueValue="NaN" /> - <Style x:Key="TopEdgeShadowStyle" TargetType="controls:DropShadowPanel"> + <Style x:Key="TopEdgeShadowStyle" TargetType="wctc:DropShadowPanel"> <Setter Property="BlurRadius" Value="10" /> <Setter Property="ShadowOpacity" Value="{ThemeResource SetsEdgeShadowOpacity}" /> <Setter Property="VerticalAlignment" Value="Top" /> @@ -134,7 +135,7 @@ <Setter Property="HorizontalContentAlignment" Value="Stretch" /> </Style> - <Style x:Key="BottomEdgeShadowStyle" TargetType="controls:DropShadowPanel"> + <Style x:Key="BottomEdgeShadowStyle" TargetType="wctc:DropShadowPanel"> <Setter Property="BlurRadius" Value="10" /> <Setter Property="ShadowOpacity" Value="{ThemeResource SetsEdgeShadowOpacity}" /> <Setter Property="VerticalAlignment" Value="Bottom" /> @@ -142,14 +143,14 @@ <Setter Property="HorizontalContentAlignment" Value="Stretch" /> </Style> - <Style x:Key="SideEdgeShadowStyle" TargetType="controls:DropShadowPanel"> + <Style x:Key="SideEdgeShadowStyle" TargetType="wctc:DropShadowPanel"> <Setter Property="BlurRadius" Value="8" /> <Setter Property="ShadowOpacity" Value="{ThemeResource SetsEdgeShadowOpacity}" /> <Setter Property="Visibility" Value="Collapsed" /> </Style> <!-- Default style for compatibility with WPF migrators. --> - <Style TargetType="controls:SetsView"> + <Style TargetType="local:SetsView"> <Setter Property="Background" Value="{ThemeResource SetsViewBackground}" /> <Setter Property="IsTabStop" Value="False" /> <Setter Property="TabNavigation" Value="Local" /> @@ -186,7 +187,7 @@ </Style> <ControlTemplate x:Key="SetsViewTemplate" - TargetType="controls:SetsView"> + TargetType="local:SetsView"> <Grid x:Name="SetsViewContainer"> <Grid.RowDefinitions> <!-- 0 Header --> @@ -203,15 +204,15 @@ <ColumnDefinition Width="Auto" /> <!-- 1 Sets --> <ColumnDefinition Width="Auto" - controls:SetsView.ConstrainColumn="True" - controls:SetsView.IgnoreColumn="True" /> + local:SetsView.ConstrainColumn="True" + local:SetsView.IgnoreColumn="True" /> <!-- 2 Reserved: Overflow Drop-down --> <ColumnDefinition Width="Auto" /> <!-- 3 Auto Add Button --> <ColumnDefinition Width="Auto" /> <!-- 4 Padding --> <ColumnDefinition Width="*" - controls:SetsView.IgnoreColumn="True" /> + local:SetsView.IgnoreColumn="True" /> <!-- 5 SetsEndHeader --> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> @@ -221,15 +222,15 @@ ContentTemplate="{TemplateBinding HeaderTemplate}" /> <!-- Shadow under Start Header --> - <controls:DropShadowPanel + <wctc:DropShadowPanel Style="{StaticResource BottomEdgeShadowStyle}" Grid.Row="1" Grid.Column="0"> <Grid Height="1" Margin="0,0,0,-1"/> - <controls:DropShadowPanel.Clip> + <wctc:DropShadowPanel.Clip> <RectangleGeometry Rect="0,-12,1024,12"></RectangleGeometry> - </controls:DropShadowPanel.Clip> - </controls:DropShadowPanel> + </wctc:DropShadowPanel.Clip> + </wctc:DropShadowPanel> <ContentPresenter Grid.Row="1" Grid.Column="0" @@ -259,15 +260,15 @@ </ScrollViewer> <!-- Shadow under Add Button --> - <controls:DropShadowPanel + <wctc:DropShadowPanel Style="{StaticResource BottomEdgeShadowStyle}" Grid.Row="1" Grid.Column="3"> <Grid Height="1" Margin="-1,0,0,-1"/> - <controls:DropShadowPanel.Clip> + <wctc:DropShadowPanel.Clip> <RectangleGeometry Rect="0,-12,1024,12"></RectangleGeometry> - </controls:DropShadowPanel.Clip> - </controls:DropShadowPanel> + </wctc:DropShadowPanel.Clip> + </wctc:DropShadowPanel> <ContentPresenter Grid.Row="1" Grid.Column="3" @@ -276,15 +277,15 @@ ContentTemplate="{TemplateBinding SetsActionHeaderTemplate}" /> <!-- Shadow under Padding area (23040 = 3 x 8k resolution in width just in case) --> - <controls:DropShadowPanel + <wctc:DropShadowPanel Style="{StaticResource BottomEdgeShadowStyle}" Grid.Row="1" Grid.Column="4"> <Grid Height="1" Margin="0,0,0,-1"/> - <controls:DropShadowPanel.Clip> + <wctc:DropShadowPanel.Clip> <RectangleGeometry Rect="0,-12,23040,12"></RectangleGeometry> - </controls:DropShadowPanel.Clip> - </controls:DropShadowPanel> + </wctc:DropShadowPanel.Clip> + </wctc:DropShadowPanel> <ContentPresenter Grid.Row="1" Grid.Column="4" @@ -293,15 +294,15 @@ ContentTemplate="{TemplateBinding SetsPaddingHeaderTemplate}" /> <!-- Shadow under SetsEndHeader --> - <controls:DropShadowPanel + <wctc:DropShadowPanel Style="{StaticResource BottomEdgeShadowStyle}" Grid.Row="1" Grid.Column="5"> <Grid Height="1" Margin="0,0,0,-1"/> - <controls:DropShadowPanel.Clip> + <wctc:DropShadowPanel.Clip> <RectangleGeometry Rect="0,-12,1024,12"></RectangleGeometry> - </controls:DropShadowPanel.Clip> - </controls:DropShadowPanel> + </wctc:DropShadowPanel.Clip> + </wctc:DropShadowPanel> <ContentPresenter Grid.Row="1" Grid.Column="5" @@ -318,17 +319,17 @@ BorderThickness="{TemplateBinding BorderThickness}" /> <!-- Shadow above Footer --> - <controls:DropShadowPanel + <wctc:DropShadowPanel Style="{StaticResource TopEdgeShadowStyle}" Canvas.ZIndex="50" Grid.Row="3" Grid.ColumnSpan="6" Grid.Column="0"> <Grid Height="1"/> - <controls:DropShadowPanel.Clip> + <wctc:DropShadowPanel.Clip> <RectangleGeometry Rect="0,0,23040,12"></RectangleGeometry> - </controls:DropShadowPanel.Clip> - </controls:DropShadowPanel> + </wctc:DropShadowPanel.Clip> + </wctc:DropShadowPanel> <ContentPresenter Grid.Row="3" Canvas.ZIndex="50" @@ -340,9 +341,9 @@ <!-- Based on Style for ListViewItemExpanded Template - https://msdn.microsoft.com/en-us/library/windows/apps/mt299136.aspx --> <ControlTemplate x:Key="SetsViewItemHeaderTemplate" - TargetType="controls:SetsViewItem"> + TargetType="local:SetsViewItem"> <Grid x:Name="LayoutRoot" - ui:FrameworkElementExtensions.AncestorType="controls:SetsView" + wctui:FrameworkElementExtensions.AncestorType="local:SetsView" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" @@ -356,37 +357,37 @@ <ScaleTransform x:Name="LayoutRootScale" /> </Grid.RenderTransform> - <controls:DropShadowPanel + <wctc:DropShadowPanel x:Name="ItemLeftSideShadow" Style="{StaticResource SideEdgeShadowStyle}" HorizontalAlignment="Left"> - <controls:DropShadowPanel.Clip> + <wctc:DropShadowPanel.Clip> <RectangleGeometry Rect="-8,0,8,32"></RectangleGeometry> - </controls:DropShadowPanel.Clip> + </wctc:DropShadowPanel.Clip> <Grid Width="1"/> - </controls:DropShadowPanel> + </wctc:DropShadowPanel> - <controls:DropShadowPanel + <wctc:DropShadowPanel x:Name="ItemRightSideShadow" Style="{StaticResource SideEdgeShadowStyle}" HorizontalAlignment="Right"> - <controls:DropShadowPanel.Clip> + <wctc:DropShadowPanel.Clip> <RectangleGeometry Rect="1,0,8,32"></RectangleGeometry> - </controls:DropShadowPanel.Clip> + </wctc:DropShadowPanel.Clip> <Grid Width="1"/> - </controls:DropShadowPanel> + </wctc:DropShadowPanel> - <controls:DropShadowPanel + <wctc:DropShadowPanel x:Name="ItemBottomSideShadow" Style="{StaticResource BottomEdgeShadowStyle}"> <Grid Height="1"/> - </controls:DropShadowPanel> + </wctc:DropShadowPanel> <Rectangle x:Name="SelectionIndicator" Height="2" @@ -445,7 +446,7 @@ <!-- Use grid to toggle visibility based on IsClosable property and inner border for hover animations. --> <Border x:Name="CloseButtonContainer" Grid.Column="2" - Width="{Binding (ui:FrameworkElementExtensions.Ancestor).IsCloseButtonOverlay, Converter={StaticResource CloseCollapsingSizeConverter}, ElementName=LayoutRoot}" + Width="{Binding (wctui:FrameworkElementExtensions.Ancestor).IsCloseButtonOverlay, Converter={StaticResource CloseCollapsingSizeConverter}, ElementName=LayoutRoot}" HorizontalAlignment="Center" Visibility="{Binding IsClosable, Converter={StaticResource BoolToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}"> <Border x:Name="CloseButtonBorder" @@ -765,7 +766,7 @@ </ControlTemplate> <!-- Based on Style for Windows.UI.Xaml.Controls.ListViewItem --> - <Style TargetType="controls:SetsViewItem"> + <Style TargetType="local:SetsViewItem"> <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> <Setter Property="FontWeight" Value="Normal" /> @@ -979,14 +980,14 @@ </Grid.ColumnDefinitions> <!-- Scroll to the left button bottom shadow --> - <controls:DropShadowPanel + <wctc:DropShadowPanel Style="{StaticResource BottomEdgeShadowStyle}" Grid.Column="0"> <Grid Height="1" Margin="-1,0,0,-1"/> - <controls:DropShadowPanel.Clip> + <wctc:DropShadowPanel.Clip> <RectangleGeometry Rect="-1,-12,1024,12"></RectangleGeometry> - </controls:DropShadowPanel.Clip> - </controls:DropShadowPanel> + </wctc:DropShadowPanel.Clip> + </wctc:DropShadowPanel> <RepeatButton x:Name="SetsScrollBackButton" Grid.Column="0" @@ -1003,28 +1004,28 @@ </RepeatButton> <!-- SetsItemsScrollViewer left side shadow --> - <controls:DropShadowPanel + <wctc:DropShadowPanel x:Name="SetsItemsScrollViewerLeftSideShadow" Style="{StaticResource SideEdgeShadowStyle}" Grid.Column="1" HorizontalAlignment="Left"> <Grid Width="1"/> - <controls:DropShadowPanel.Clip> + <wctc:DropShadowPanel.Clip> <RectangleGeometry Rect="-10,0,10,32"></RectangleGeometry> - </controls:DropShadowPanel.Clip> - </controls:DropShadowPanel> + </wctc:DropShadowPanel.Clip> + </wctc:DropShadowPanel> <!-- SetsItemsScrollViewer right side shadow --> - <controls:DropShadowPanel + <wctc:DropShadowPanel x:Name="SetsItemsScrollViewerRightSideShadow" Style="{StaticResource SideEdgeShadowStyle}" Grid.Column="1" HorizontalAlignment="Right"> <Grid Width="1"/> - <controls:DropShadowPanel.Clip> + <wctc:DropShadowPanel.Clip> <RectangleGeometry Rect="1,0,10,32"></RectangleGeometry> - </controls:DropShadowPanel.Clip> - </controls:DropShadowPanel> + </wctc:DropShadowPanel.Clip> + </wctc:DropShadowPanel> <ScrollContentPresenter x:Name="ScrollContentPresenter" Grid.Column="1" @@ -1032,14 +1033,14 @@ Margin="{TemplateBinding Padding}"/> <!-- Scroll to the right button bottom shadow --> - <controls:DropShadowPanel + <wctc:DropShadowPanel Style="{StaticResource BottomEdgeShadowStyle}" Grid.Column="2"> <Grid Height="1" Margin="0,0,0,-1"/> - <controls:DropShadowPanel.Clip> + <wctc:DropShadowPanel.Clip> <RectangleGeometry Rect="0,-12,1024,12"></RectangleGeometry> - </controls:DropShadowPanel.Clip> - </controls:DropShadowPanel> + </wctc:DropShadowPanel.Clip> + </wctc:DropShadowPanel> <RepeatButton x:Name="SetsScrollForwardButton" Grid.Column="2" diff --git a/src/Notepads.Controls/Themes/Generic.xaml b/src/Notepads.Controls/Themes/Generic.xaml index 31a484fa8..1ba9ebdb2 100644 --- a/src/Notepads.Controls/Themes/Generic.xaml +++ b/src/Notepads.Controls/Themes/Generic.xaml @@ -2,10 +2,6 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary.MergedDictionaries> - <ResourceDictionary Source="ms-appx:///Notepads.Controls/DropShadowPanel/DropShadowPanel.xaml" /> - <ResourceDictionary Source="ms-appx:///Notepads.Controls/GridSplitter/GridSplitter.xaml" /> - <ResourceDictionary Source="ms-appx:///Notepads.Controls/InAppNotification/InAppNotification.xaml" /> <ResourceDictionary Source="ms-appx:///Notepads.Controls/SetsView/SetsView.xaml" /> - <ResourceDictionary Source="ms-appx:///Notepads.Controls/MarkdownTextBlock/MarkdownTextBlock.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> diff --git a/src/Notepads/Brushes/HostBackdropAcrylicBrush.cs b/src/Notepads/Brushes/HostBackdropAcrylicBrush.cs index 281d0edaf..dc6decb92 100644 --- a/src/Notepads/Brushes/HostBackdropAcrylicBrush.cs +++ b/src/Notepads/Brushes/HostBackdropAcrylicBrush.cs @@ -21,7 +21,7 @@ using Microsoft.Graphics.Canvas; using Microsoft.Graphics.Canvas.Effects; using Microsoft.Graphics.Canvas.UI.Composition; - using Notepads.Controls.Helpers; + using Microsoft.Toolkit.Uwp; public sealed class HostBackdropAcrylicBrush : XamlCompositionBrushBase, IDisposable { @@ -162,7 +162,7 @@ private async Task BuildInternalAsync() private async void OnEnergySaverStatusChanged(object sender, object e) { - await _dispatcherQueue.ExecuteOnUIThreadAsync(async () => + await _dispatcherQueue.EnqueueAsync(async () => { await BuildInternalAsync(); }); @@ -170,7 +170,7 @@ await _dispatcherQueue.ExecuteOnUIThreadAsync(async () => private async void OnAdvancedEffectsEnabledChanged(UISettings sender, object args) { - await _dispatcherQueue.ExecuteOnUIThreadAsync(async () => + await _dispatcherQueue.EnqueueAsync(async () => { await BuildInternalAsync(); }); diff --git a/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml b/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml index 21e434178..837f30a9f 100644 --- a/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml +++ b/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml @@ -1,9 +1,10 @@ <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:controls="using:Notepads.Controls"> - - <Style x:Key="FindAndReplacePlaceholder" TargetType="controls:InAppNotification"> + xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls"> + <Style x:Key="FindAndReplacePlaceholder" TargetType="wctc:InAppNotification"> + <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeMediumBrush}" /> + <Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseLowBrush}" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate> @@ -16,26 +17,23 @@ Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> <EasingDoubleKeyFrame KeyTime="0" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> <EasingDoubleKeyFrame KeyTime="0" Value="20" /> - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.Opacity)"> <EasingDoubleKeyFrame KeyTime="0" Value="1" /> - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" /> </DoubleAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.Visibility)"> <DiscreteObjectKeyFrame KeyTime="0"> @@ -43,7 +41,7 @@ <Visibility>Visible</Visibility> </DiscreteObjectKeyFrame.Value> </DiscreteObjectKeyFrame> - <DiscreteObjectKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}"> + <DiscreteObjectKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}"> <DiscreteObjectKeyFrame.Value> <Visibility>Collapsed</Visibility> </DiscreteObjectKeyFrame.Value> @@ -51,30 +49,27 @@ </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> - <VisualState x:Name="Visible"> <Storyboard> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> <EasingDoubleKeyFrame KeyTime="0" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> <EasingDoubleKeyFrame KeyTime="0" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="20" /> </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.Opacity)"> <EasingDoubleKeyFrame KeyTime="0" Value="0" /> - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="1" /> </DoubleAnimationUsingKeyFrames> </Storyboard> @@ -92,13 +87,13 @@ <CompositeTransform /> </Grid.RenderTransform> - <controls:DropShadowPanel BlurRadius="10" - ShadowOpacity="0.25" - OffsetX="0" - OffsetY="0" - HorizontalContentAlignment="Stretch" - VerticalContentAlignment="Stretch" - IsMasked="True"> + <wctc:DropShadowPanel BlurRadius="10" + ShadowOpacity="0.25" + OffsetX="0" + OffsetY="0" + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch" + IsMasked="True"> <Grid Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" @@ -108,19 +103,18 @@ <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> - <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalAlignment}" + <ContentPresenter x:Name="PART_Presenter" + HorizontalAlignment="{TemplateBinding HorizontalAlignment}" HorizontalContentAlignment="Stretch" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="Center" TextWrapping="WrapWholeWords" /> </Grid> - </controls:DropShadowPanel> - + </wctc:DropShadowPanel> </Grid> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> - </ResourceDictionary> diff --git a/src/Notepads/Controls/Markdown/MarkdownExtensionView.xaml b/src/Notepads/Controls/Markdown/MarkdownExtensionView.xaml index 580d035ac..e6372efb0 100644 --- a/src/Notepads/Controls/Markdown/MarkdownExtensionView.xaml +++ b/src/Notepads/Controls/Markdown/MarkdownExtensionView.xaml @@ -4,7 +4,7 @@ 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" - xmlns:controls="using:Notepads.Controls" + xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls" mc:Ignorable="d" Background="{ThemeResource SystemControlForegroundTransparentBrush}"> @@ -16,12 +16,12 @@ BorderThickness="0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> - <controls:MarkdownTextBlock x:Name="MarkdownTextBlock" - Margin="0" - Padding="0" - Background="Transparent" - Header1Foreground="{StaticResource SystemControlForegroundAccentBrush}" - LinkForeground="{StaticResource SystemControlForegroundAccentBrush}"/> + <wctc:MarkdownTextBlock x:Name="MarkdownTextBlock" + Margin="0" + Padding="0" + Background="Transparent" + Header1Foreground="{StaticResource SystemControlForegroundAccentBrush}" + LinkForeground="{StaticResource SystemControlForegroundAccentBrush}"/> </ScrollViewer> </Grid> </UserControl> diff --git a/src/Notepads/Controls/Markdown/MarkdownExtensionView.xaml.cs b/src/Notepads/Controls/Markdown/MarkdownExtensionView.xaml.cs index 9bf790ec1..52c565832 100644 --- a/src/Notepads/Controls/Markdown/MarkdownExtensionView.xaml.cs +++ b/src/Notepads/Controls/Markdown/MarkdownExtensionView.xaml.cs @@ -3,7 +3,6 @@ using System; using System.IO; using System.Threading.Tasks; - using Notepads.Controls; using Notepads.Controls.TextEditor; using Notepads.Extensions; using Notepads.Services; @@ -11,6 +10,7 @@ using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Media; using Microsoft.Toolkit.Uwp.UI; + using Microsoft.Toolkit.Uwp.UI.Controls; public sealed partial class MarkdownExtensionView : UserControl, IContentPreviewExtension { diff --git a/src/Notepads/Controls/TextEditor/TextEditor.xaml b/src/Notepads/Controls/TextEditor/TextEditor.xaml index 7f6cdbf9d..d4fb21d6e 100644 --- a/src/Notepads/Controls/TextEditor/TextEditor.xaml +++ b/src/Notepads/Controls/TextEditor/TextEditor.xaml @@ -4,7 +4,7 @@ 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" - xmlns:controls="using:Notepads.Controls" + xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls" xmlns:textEditor="using:Notepads.Controls.TextEditor" xmlns:diffViewer="using:Notepads.Controls.DiffViewer" xmlns:findAndReplace="using:Notepads.Controls.FindAndReplace" @@ -39,7 +39,7 @@ </ResourceDictionary> </ResourceDictionary.ThemeDictionaries> - <Style x:Key="CustomGridSplitterStyle" TargetType="controls:GridSplitter"> + <Style x:Key="CustomGridSplitterStyle" TargetType="wctc:GridSplitter"> <Setter Property="IsTabStop" Value="True"/> <Setter Property="UseSystemFocusVisuals" Value="True"/> <Setter Property="HorizontalAlignment" Value="Stretch"/> @@ -51,7 +51,7 @@ <Setter Property="GripperForeground" Value="Transparent"/> <Setter Property="Template"> <Setter.Value> - <ControlTemplate TargetType="controls:GridSplitter"> + <ControlTemplate TargetType="wctc:GridSplitter"> <Grid x:Name="RootGrid" Background="Transparent"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="GridSplitterStates"> @@ -93,7 +93,7 @@ Style="{StaticResource TextEditorCore}" Grid.Column="0" Padding="6 , 6, 10, 6"/> - <controls:InAppNotification x:Name="FindAndReplacePlaceholder" + <wctc:InAppNotification x:Name="FindAndReplacePlaceholder" x:Load="false" Padding="0" Margin="0" @@ -108,16 +108,16 @@ BorderThickness="1" CornerRadius="{ThemeResource OverlayCornerRadius}" Closed="FindAndReplacePlaceholder_Closed"> - <controls:InAppNotification.Content> + <wctc:InAppNotification.Content> <findAndReplace:FindAndReplaceControl x:Name="FindAndReplaceControl" Width="340" OnDismissKeyDown="FindAndReplaceControl_OnDismissKeyDown" OnToggleReplaceModeButtonClicked="FindAndReplaceControl_OnToggleReplaceModeButtonClicked" OnFindReplaceControlKeyDown="TextEditorCore_OnKeyDown" OnFindAndReplaceButtonClicked="FindAndReplaceControl_OnFindAndReplaceButtonClicked"/> - </controls:InAppNotification.Content> - </controls:InAppNotification> - <controls:InAppNotification x:Name="GoToPlaceholder" + </wctc:InAppNotification.Content> + </wctc:InAppNotification> + <wctc:InAppNotification x:Name="GoToPlaceholder" x:Load="false" Padding="0" Margin="0" @@ -132,16 +132,16 @@ BorderThickness="1" CornerRadius="{ThemeResource OverlayCornerRadius}" Closed="GoToPlaceholder_Closed"> - <controls:InAppNotification.Content> + <wctc:InAppNotification.Content> <goTo:GoToControl x:Name="GoToControl" Width="260" OnDismissKeyDown="GoToControl_OnDismissKeyDown" OnGoToControlKeyDown="TextEditorCore_OnKeyDown" OnGoToButtonClicked="GoToControl_OnGoToButtonClicked"/> - </controls:InAppNotification.Content> - </controls:InAppNotification> + </wctc:InAppNotification.Content> + </wctc:InAppNotification> </Grid> - <controls:DropShadowPanel + <wctc:DropShadowPanel Canvas.ZIndex="50" Grid.Column="1" ShadowOpacity="0.3" @@ -149,10 +149,10 @@ VerticalAlignment="Stretch" HorizontalAlignment="Left"> <Grid Width="2"/> - <controls:DropShadowPanel.Clip> + <wctc:DropShadowPanel.Clip> <RectangleGeometry Rect="-12,0,12,12960"></RectangleGeometry> - </controls:DropShadowPanel.Clip> - </controls:DropShadowPanel> + </wctc:DropShadowPanel.Clip> + </wctc:DropShadowPanel> <ContentPresenter x:Name="SplitPanel" x:Load="False" Canvas.ZIndex="100" @@ -160,7 +160,7 @@ Background="{ThemeResource SplitViewBackgroundThemeBrush}" AutomationProperties.AccessibilityView="Raw" Grid.Column="1"/> - <controls:GridSplitter x:Name="GridSplitter" + <wctc:GridSplitter x:Name="GridSplitter" x:Load="False" Canvas.ZIndex="150" Style="{StaticResource CustomGridSplitterStyle}" @@ -172,10 +172,10 @@ ResizeBehavior="BasedOnAlignment" CursorBehavior="ChangeOnSplitterHover" Width="10"> - <controls:GridSplitter.RenderTransform> + <wctc:GridSplitter.RenderTransform> <TranslateTransform X="0" /> - </controls:GridSplitter.RenderTransform> - </controls:GridSplitter> + </wctc:GridSplitter.RenderTransform> + </wctc:GridSplitter> </Grid> <diffViewer:SideBySideDiffViewer x:Name="SideBySideDiffViewer" x:Load="False" diff --git a/src/Notepads/Controls/TextEditor/TextEditor.xaml.cs b/src/Notepads/Controls/TextEditor/TextEditor.xaml.cs index b85923151..cb7987693 100644 --- a/src/Notepads/Controls/TextEditor/TextEditor.xaml.cs +++ b/src/Notepads/Controls/TextEditor/TextEditor.xaml.cs @@ -6,6 +6,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AppCenter.Analytics; + using Microsoft.Toolkit.Uwp.UI.Controls; using Notepads.Commands; using Notepads.Controls.FindAndReplace; using Notepads.Controls.GoTo; diff --git a/src/Notepads/Notepads.csproj b/src/Notepads/Notepads.csproj index 3d36cc657..5d5744d0a 100644 --- a/src/Notepads/Notepads.csproj +++ b/src/Notepads/Notepads.csproj @@ -418,7 +418,7 @@ <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> <Version>6.2.12</Version> </PackageReference> - <PackageReference Include="Microsoft.Toolkit.Uwp.UI"> + <PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls"> <Version>7.0.0</Version> </PackageReference> <PackageReference Include="Microsoft.UI.Xaml"> @@ -464,4 +464,4 @@ <Target Name="AfterBuild"> </Target> --> -</Project> +</Project> \ No newline at end of file diff --git a/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml b/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml index c6ce9c897..262c4483a 100644 --- a/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml +++ b/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml @@ -1,9 +1,10 @@ <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:controls="using:Notepads.Controls"> - - <Style x:Key="InAppNotificationNoDismissButton" TargetType="controls:InAppNotification"> + xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls"> + <Style x:Key="InAppNotificationNoDismissButton" TargetType="wctc:InAppNotification"> + <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeMediumBrush}" /> + <Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseLowBrush}" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate> @@ -13,33 +14,32 @@ <VisualState x:Name="Collapsed"> <Storyboard> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> - <EasingDoubleKeyFrame KeyTime="0" Value="0" /> - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" + Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> + <EasingDoubleKeyFrame KeyTime="0" + Value="0" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> - <EasingDoubleKeyFrame KeyTime="0" Value="-50" /> - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" + Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> + <EasingDoubleKeyFrame KeyTime="0" + Value="-50" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}"/> </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.Opacity)"> + Storyboard.TargetProperty="(UIElement.Opacity)"> <EasingDoubleKeyFrame KeyTime="0" Value="1" /> - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" /> </DoubleAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.Visibility)"> + Storyboard.TargetProperty="(UIElement.Visibility)"> <DiscreteObjectKeyFrame KeyTime="0"> <DiscreteObjectKeyFrame.Value> <Visibility>Visible</Visibility> </DiscreteObjectKeyFrame.Value> </DiscreteObjectKeyFrame> - <DiscreteObjectKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}"> + <DiscreteObjectKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}"> <DiscreteObjectKeyFrame.Value> <Visibility>Collapsed</Visibility> </DiscreteObjectKeyFrame.Value> @@ -47,25 +47,28 @@ </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> - <VisualState x:Name="Visible"> <Storyboard> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> - <EasingDoubleKeyFrame KeyTime="0" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" /> + Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> + <EasingDoubleKeyFrame KeyTime="0" + Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" + Value="0" /> </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> - <EasingDoubleKeyFrame KeyTime="0" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="-50" /> + Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> + <EasingDoubleKeyFrame KeyTime="0" + Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" + Value="-50" /> </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.Opacity)"> - <EasingDoubleKeyFrame KeyTime="0" Value="0" /> - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="1" /> + Storyboard.TargetProperty="(UIElement.Opacity)"> + <EasingDoubleKeyFrame KeyTime="0" + Value="0" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" + Value="1" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualState> @@ -81,9 +84,12 @@ <CompositeTransform /> </Grid.RenderTransform> - <controls:DropShadowPanel BlurRadius="8" ShadowOpacity="0.3" - OffsetX="0.3" OffsetY="0.3" - HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"> + <wctc:DropShadowPanel BlurRadius="8" + ShadowOpacity="0.3" + OffsetX="0.3" + OffsetY="0.3" + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch"> <Grid Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" @@ -93,19 +99,18 @@ <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> - <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalAlignment}" - HorizontalContentAlignment="Center" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - VerticalContentAlignment="Center" - TextWrapping="WrapWholeWords" /> + <ContentPresenter x:Name="PART_Presenter" + HorizontalAlignment="{TemplateBinding HorizontalAlignment}" + HorizontalContentAlignment="Center" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + VerticalContentAlignment="Center" + TextWrapping="WrapWholeWords" /> </Grid> - </controls:DropShadowPanel> - + </wctc:DropShadowPanel> </Grid> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> - </ResourceDictionary> diff --git a/src/Notepads/Services/ThemeSettingsService.cs b/src/Notepads/Services/ThemeSettingsService.cs index 3f5a6d2ab..ec48ba2d3 100644 --- a/src/Notepads/Services/ThemeSettingsService.cs +++ b/src/Notepads/Services/ThemeSettingsService.cs @@ -2,8 +2,8 @@ { using System; using Microsoft.Toolkit.Uwp.Helpers; + using Microsoft.Toolkit.Uwp.UI.Helpers; using Notepads.Brushes; - using Notepads.Controls.Helpers; using Notepads.Extensions; using Notepads.Settings; using Notepads.Utilities; diff --git a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml index e072b4aff..058b1258d 100644 --- a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml +++ b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml @@ -5,7 +5,8 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:controls="using:Notepads.Controls" - xmlns:ui="using:Microsoft.Toolkit.Uwp.UI" + xmlns:wctui="using:Microsoft.Toolkit.Uwp.UI" + xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls" xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" xmlns:Core="using:Microsoft.Xaml.Interactions.Core" mc:Ignorable="d" @@ -236,7 +237,7 @@ </controls:SetsView> - <controls:InAppNotification x:Name="StatusNotification" + <wctc:InAppNotification x:Name="StatusNotification" x:Load="false" Style="{StaticResource InAppNotificationNoDismissButton}" Content="" @@ -247,19 +248,19 @@ FontWeight="Light" BorderThickness="1" CornerRadius="{ThemeResource OverlayCornerRadius}"> - </controls:InAppNotification> + </wctc:InAppNotification> </Grid> </SplitView.Content> <SplitView.Pane> <Border x:Name="RootBorder" Padding="12,0,0,0"> <Grid> - <controls:DropShadowPanel BlurRadius="12" + <wctc:DropShadowPanel BlurRadius="12" Color="Black" Opacity="0.3" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"> <Rectangle Fill="White" /> - </controls:DropShadowPanel> + </wctc:DropShadowPanel> <Grid x:Name="PaneContentGrid" Background="{ThemeResource SystemControlChromeMediumLowAcrylicElementMediumBrush}"> <Frame x:Name="SettingsFrame"/> @@ -296,7 +297,7 @@ <Grid x:Name="FileModificationStateIndicator" Padding="8,5,6,5" IsTapEnabled="True" - ui:FrameworkElementExtensions.Cursor="Hand" + wctui:FrameworkElementExtensions.Cursor="Hand" Tapped="StatusBarComponent_OnTapped"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> @@ -342,7 +343,7 @@ </Grid> <Grid Column="1" CornerRadius="{ThemeResource ControlCornerRadius}" - ui:FrameworkElementExtensions.Cursor="Hand"> + wctui:FrameworkElementExtensions.Cursor="Hand"> <TextBlock x:Name="PathIndicator" Style="{StaticResource StatusBarTextBlockStyle}" Padding ="4,4,8,4" IsTapEnabled="True" @@ -415,7 +416,7 @@ </Grid> <Grid Column="2" CornerRadius="{ThemeResource ControlCornerRadius}" - ui:FrameworkElementExtensions.Cursor="Hand"> + wctui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> @@ -470,7 +471,7 @@ <Grid Column="3" x:Name="LineColumnIndicatorButton" CornerRadius="{ThemeResource ControlCornerRadius}" - ui:FrameworkElementExtensions.Cursor="Hand"> + wctui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> @@ -495,7 +496,7 @@ </Grid> <Grid Column="4" CornerRadius="{ThemeResource ControlCornerRadius}" - ui:FrameworkElementExtensions.Cursor="Hand"> + wctui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> @@ -593,7 +594,7 @@ </Grid> <Grid Column="5" CornerRadius="{ThemeResource ControlCornerRadius}" - ui:FrameworkElementExtensions.Cursor="Hand"> + wctui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> @@ -631,7 +632,7 @@ </Grid> <Grid Column="6" CornerRadius="{ThemeResource ControlCornerRadius}" - ui:FrameworkElementExtensions.Cursor="Hand"> + wctui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> @@ -666,7 +667,7 @@ </Grid> <Grid Column="7" CornerRadius="{ThemeResource ControlCornerRadius}" - ui:FrameworkElementExtensions.Cursor="Hand"> + wctui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> From 6da1738be1649cc316c30a32512cba2b1e1c7b11 Mon Sep 17 00:00:00 2001 From: Soumya Ranjan Mahunt <devsoumyamahunt@gmail.com> Date: Mon, 22 Mar 2021 10:46:23 +0530 Subject: [PATCH 09/15] Temorarily disable rounded corners and add note to re-enable them later. --- src/Notepads.Controls/SetsView/SetsView.xaml | 2 + src/Notepads/App.xaml | 23 ++++- .../Controls/Dialog/FileRenameDialog.cs | 3 +- .../Controls/Dialog/NotepadsDialog.cs | 8 +- .../FindAndReplace/FindAndReplaceControl.xaml | 7 +- src/Notepads/Controls/GoTo/GoToControl.xaml | 3 +- .../Controls/TextEditor/TextEditor.xaml | 93 ++++++++++--------- .../Controls/TextEditor/TextEditorCore.xaml | 3 +- src/Notepads/Core/TabContextFlyout.cs | 2 + .../Resource/CustomFlyoutItemStyle.xaml | 5 +- .../Resource/CustomNavigationViewStyle.xaml | 6 +- .../Views/MainPage/NotepadsMainPage.xaml | 51 +++++++--- .../Settings/PersonalizationSettingsPage.xaml | 79 +++++++++------- .../Settings/TextAndEditorSettingsPage.xaml | 3 +- 14 files changed, 180 insertions(+), 108 deletions(-) diff --git a/src/Notepads.Controls/SetsView/SetsView.xaml b/src/Notepads.Controls/SetsView/SetsView.xaml index c5e9f8876..a33a516b5 100644 --- a/src/Notepads.Controls/SetsView/SetsView.xaml +++ b/src/Notepads.Controls/SetsView/SetsView.xaml @@ -342,11 +342,13 @@ <!-- Based on Style for ListViewItemExpanded Template - https://msdn.microsoft.com/en-us/library/windows/apps/mt299136.aspx --> <ControlTemplate x:Key="SetsViewItemHeaderTemplate" TargetType="local:SetsViewItem"> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <Grid x:Name="LayoutRoot" wctui:FrameworkElementExtensions.AncestorType="local:SetsView" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="0" Control.IsTemplateFocusTarget="True" FocusVisualMargin="{TemplateBinding FocusVisualMargin}" RenderTransformOrigin="0.5,0.5"> diff --git a/src/Notepads/App.xaml b/src/Notepads/App.xaml index d71f70b87..16e6ce47c 100644 --- a/src/Notepads/App.xaml +++ b/src/Notepads/App.xaml @@ -1,7 +1,8 @@ <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:muxc="using:Microsoft.UI.Xaml.Controls"> <Application.Resources> <ResourceDictionary> @@ -43,6 +44,26 @@ <Setter Property="Foreground" Value="{ThemeResource SystemBaseMediumHighColor}"/> </Style> + <!-- TODO: Remove these styles --> + <Style TargetType="MenuFlyoutPresenter"> + <Setter Property="CornerRadius" Value="0" /> + </Style> + <Style TargetType="FlyoutPresenter"> + <Setter Property="CornerRadius" Value="0" /> + </Style> + <Style x:Key="ButtonRevealStyle" TargetType="Button" BasedOn="{StaticResource ButtonRevealStyle}"> + <Setter Property="CornerRadius" Value="0" /> + </Style> + <Style TargetType="ComboBox"> + <Setter Property="CornerRadius" Value="0" /> + </Style> + <Style TargetType="muxc:ColorPicker"> + <Setter Property="CornerRadius" Value="0" /> + </Style> + <Style TargetType="TextBox"> + <Setter Property="CornerRadius" Value="0" /> + </Style> + </ResourceDictionary> </Application.Resources> </Application> \ No newline at end of file diff --git a/src/Notepads/Controls/Dialog/FileRenameDialog.cs b/src/Notepads/Controls/Dialog/FileRenameDialog.cs index 906ea0ad4..d31294e09 100644 --- a/src/Notepads/Controls/Dialog/FileRenameDialog.cs +++ b/src/Notepads/Controls/Dialog/FileRenameDialog.cs @@ -38,7 +38,8 @@ public FileRenameDialog(string filename, bool fileExists, Action<string> confirm SelectionStart = 0, SelectionLength = filename.Contains(".") ? filename.LastIndexOf(".", StringComparison.Ordinal) : filename.Length, Height = 35, - CornerRadius = (CornerRadius)Application.Current.Resources["ControlCornerRadius"] + // TODO: Uncomment to apply CornerRadius + //CornerRadius = (CornerRadius)Application.Current.Resources["ControlCornerRadius"] }; _errorMessageTextBlock = new TextBlock() diff --git a/src/Notepads/Controls/Dialog/NotepadsDialog.cs b/src/Notepads/Controls/Dialog/NotepadsDialog.cs index 7aa0f2746..2bf42e848 100644 --- a/src/Notepads/Controls/Dialog/NotepadsDialog.cs +++ b/src/Notepads/Controls/Dialog/NotepadsDialog.cs @@ -17,7 +17,8 @@ public class NotepadsDialog : ContentDialog public NotepadsDialog() { - CornerRadius = (CornerRadius)Application.Current.Resources["OverlayCornerRadius"]; + // TODO: Uncomment to apply CornerRadius + //CornerRadius = (CornerRadius)Application.Current.Resources["OverlayCornerRadius"]; PrimaryButtonStyle = GetButtonStyle(); SecondaryButtonStyle = GetButtonStyle(); CloseButtonStyle = GetButtonStyle(); @@ -42,8 +43,9 @@ private void NotepadsDialog_ActualThemeChanged(FrameworkElement sender, object a internal static Style GetButtonStyle() { var buttonStyle = new Style(typeof(Button)); - buttonStyle.Setters.Add(new Setter(Control.CornerRadiusProperty, - (CornerRadius)Application.Current.Resources["ControlCornerRadius"])); + // TODO: Uncomment to apply CornerRadius + //buttonStyle.Setters.Add(new Setter(Control.CornerRadiusProperty, + // (CornerRadius)Application.Current.Resources["ControlCornerRadius"])); return buttonStyle; } diff --git a/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml b/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml index 661fb42c3..4b0359d0e 100644 --- a/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml +++ b/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml @@ -38,6 +38,7 @@ <RelativePanel Grid.Row="0" Grid.Column="1" Padding="1, 1, 1, 1" Height="36" x:Name="FindBarPlaceHolder"> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <findAndReplace:FindAndReplaceTextBox x:Name="FindBar" x:Uid="FindAndReplace_FindBar" Style="{StaticResource TransparentTextBoxStyle}" @@ -51,7 +52,7 @@ TextAlignment="Left" BorderThickness="0" FontSize="15" - CornerRadius="{ThemeResource ControlCornerRadius}" + CornerRadius="0" TextChanged="FindBar_OnTextChanged" KeyDown="FindBar_OnKeyDown" GotFocus="FindBar_GotFocus" @@ -102,6 +103,8 @@ </RelativePanel> <Grid Grid.Row="1" Grid.Column="1" Padding="1, 1, 1, 1" Height="36" x:Name="ReplaceBarPlaceHolder"> + + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <findAndReplace:FindAndReplaceTextBox x:Name="ReplaceBar" x:Uid="FindAndReplace_ReplaceBar" Style="{StaticResource TransparentTextBoxStyle}" @@ -112,7 +115,7 @@ TextAlignment="Left" BorderThickness="0" FontSize="15" - CornerRadius="{ThemeResource ControlCornerRadius}" + CornerRadius="0" TextChanged="ReplaceBar_OnTextChanged" KeyDown="ReplaceBar_OnKeyDown" GotFocus="ReplaceBar_GotFocus" diff --git a/src/Notepads/Controls/GoTo/GoToControl.xaml b/src/Notepads/Controls/GoTo/GoToControl.xaml index 7d598cf66..6782cc8f9 100644 --- a/src/Notepads/Controls/GoTo/GoToControl.xaml +++ b/src/Notepads/Controls/GoTo/GoToControl.xaml @@ -19,6 +19,7 @@ <TextBlock Grid.Column="0" x:Uid="GoTo_GoToBarLabel" Margin="5,0,8,3" FontSize="15" VerticalAlignment="Center" TextAlignment="Center"/> <Grid Grid.Column="1"> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <TextBox x:Name="GoToBar" x:Uid="GoTo_GoToBar" Style="{StaticResource TransparentTextBoxStyle}" @@ -29,7 +30,7 @@ TextAlignment="Left" BorderThickness="0" FontSize="15" - CornerRadius="{ThemeResource ControlCornerRadius}" + CornerRadius="0" BeforeTextChanging="GoToBar_BeforeTextChanging" TextChanged="GoToBar_OnTextChanged" KeyDown="GoToBar_OnKeyDown" diff --git a/src/Notepads/Controls/TextEditor/TextEditor.xaml b/src/Notepads/Controls/TextEditor/TextEditor.xaml index d4fb21d6e..fff9054bb 100644 --- a/src/Notepads/Controls/TextEditor/TextEditor.xaml +++ b/src/Notepads/Controls/TextEditor/TextEditor.xaml @@ -93,21 +93,22 @@ Style="{StaticResource TextEditorCore}" Grid.Column="0" Padding="6 , 6, 10, 6"/> + <!-- TODO: Change CornerRadius to {ThemeResource OverlayCornerRadius}--> <wctc:InAppNotification x:Name="FindAndReplacePlaceholder" - x:Load="false" - Padding="0" - Margin="0" - HorizontalAlignment="Right" - VerticalAlignment="Top" - Style="{StaticResource FindAndReplacePlaceholder}" - ShowDismissButton="True" - AnimationDuration="0:0:0.050" - VerticalOffset="10" - HorizontalOffset="-22" - FontWeight="Light" - BorderThickness="1" - CornerRadius="{ThemeResource OverlayCornerRadius}" - Closed="FindAndReplacePlaceholder_Closed"> + x:Load="false" + Padding="0" + Margin="0" + HorizontalAlignment="Right" + VerticalAlignment="Top" + Style="{StaticResource FindAndReplacePlaceholder}" + ShowDismissButton="True" + AnimationDuration="0:0:0.050" + VerticalOffset="10" + HorizontalOffset="-22" + FontWeight="Light" + BorderThickness="1" + CornerRadius="0" + Closed="FindAndReplacePlaceholder_Closed"> <wctc:InAppNotification.Content> <findAndReplace:FindAndReplaceControl x:Name="FindAndReplaceControl" Width="340" @@ -117,21 +118,22 @@ OnFindAndReplaceButtonClicked="FindAndReplaceControl_OnFindAndReplaceButtonClicked"/> </wctc:InAppNotification.Content> </wctc:InAppNotification> + <!-- TODO: Change CornerRadius to {ThemeResource OverlayCornerRadius}--> <wctc:InAppNotification x:Name="GoToPlaceholder" - x:Load="false" - Padding="0" - Margin="0" - HorizontalAlignment="Right" - VerticalAlignment="Top" - Style="{StaticResource FindAndReplacePlaceholder}" - ShowDismissButton="True" - AnimationDuration="0:0:0.050" - VerticalOffset="0" - HorizontalOffset="-22" - FontWeight="Light" - BorderThickness="1" - CornerRadius="{ThemeResource OverlayCornerRadius}" - Closed="GoToPlaceholder_Closed"> + x:Load="false" + Padding="0" + Margin="0" + HorizontalAlignment="Right" + VerticalAlignment="Top" + Style="{StaticResource FindAndReplacePlaceholder}" + ShowDismissButton="True" + AnimationDuration="0:0:0.050" + VerticalOffset="0" + HorizontalOffset="-22" + FontWeight="Light" + BorderThickness="1" + CornerRadius="0" + Closed="GoToPlaceholder_Closed"> <wctc:InAppNotification.Content> <goTo:GoToControl x:Name="GoToControl" Width="260" @@ -141,13 +143,12 @@ </wctc:InAppNotification.Content> </wctc:InAppNotification> </Grid> - <wctc:DropShadowPanel - Canvas.ZIndex="50" - Grid.Column="1" - ShadowOpacity="0.3" - BlurRadius="12" - VerticalAlignment="Stretch" - HorizontalAlignment="Left"> + <wctc:DropShadowPanel Canvas.ZIndex="50" + Grid.Column="1" + ShadowOpacity="0.3" + BlurRadius="12" + VerticalAlignment="Stretch" + HorizontalAlignment="Left"> <Grid Width="2"/> <wctc:DropShadowPanel.Clip> <RectangleGeometry Rect="-12,0,12,12960"></RectangleGeometry> @@ -161,17 +162,17 @@ AutomationProperties.AccessibilityView="Raw" Grid.Column="1"/> <wctc:GridSplitter x:Name="GridSplitter" - x:Load="False" - Canvas.ZIndex="150" - Style="{StaticResource CustomGridSplitterStyle}" - MinWidth="10" - GripperCursor="Default" - HorizontalAlignment="Left" - Grid.Column="1" - ResizeDirection="Auto" - ResizeBehavior="BasedOnAlignment" - CursorBehavior="ChangeOnSplitterHover" - Width="10"> + x:Load="False" + Canvas.ZIndex="150" + Style="{StaticResource CustomGridSplitterStyle}" + MinWidth="10" + GripperCursor="Default" + HorizontalAlignment="Left" + Grid.Column="1" + ResizeDirection="Auto" + ResizeBehavior="BasedOnAlignment" + CursorBehavior="ChangeOnSplitterHover" + Width="10"> <wctc:GridSplitter.RenderTransform> <TranslateTransform X="0" /> </wctc:GridSplitter.RenderTransform> diff --git a/src/Notepads/Controls/TextEditor/TextEditorCore.xaml b/src/Notepads/Controls/TextEditor/TextEditorCore.xaml index f19e8e4c7..d97895778 100644 --- a/src/Notepads/Controls/TextEditor/TextEditorCore.xaml +++ b/src/Notepads/Controls/TextEditor/TextEditorCore.xaml @@ -85,9 +85,10 @@ <Border x:Name="LineIndicator" BorderBrush="{StaticResource SystemControlForegroundAccentBrush}" Visibility="Collapsed"/> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <Grid x:Name="LineHighlighter" Background="{ThemeResource SystemControlBackgroundListLowBrush}" - CornerRadius="{ThemeResource ControlCornerRadius}" + CornerRadius="0" Opacity="0.65" BorderThickness="0" Visibility="Collapsed"/> diff --git a/src/Notepads/Core/TabContextFlyout.cs b/src/Notepads/Core/TabContextFlyout.cs index 1c3a61917..a85d4096a 100644 --- a/src/Notepads/Core/TabContextFlyout.cs +++ b/src/Notepads/Core/TabContextFlyout.cs @@ -49,6 +49,8 @@ public TabContextFlyout(INotepadsCore notepadsCore, ITextEditor textEditor) var style = new Style(typeof(MenuFlyoutPresenter)); style.Setters.Add(new Setter(Control.BorderThicknessProperty, 0)); + // TODO: Remove CornerRadius property setter + style.Setters.Add(new Setter(Control.CornerRadiusProperty, 0)); MenuFlyoutPresenterStyle = style; Opening += TabContextFlyout_Opening; diff --git a/src/Notepads/Resource/CustomFlyoutItemStyle.xaml b/src/Notepads/Resource/CustomFlyoutItemStyle.xaml index a8fb642e6..7f8437fe9 100644 --- a/src/Notepads/Resource/CustomFlyoutItemStyle.xaml +++ b/src/Notepads/Resource/CustomFlyoutItemStyle.xaml @@ -3,9 +3,10 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:media="using:Microsoft.UI.Xaml.Media" xmlns:local="using:Notepads"> - <Style TargetType="MenuFlyoutItem" BasedOn="{StaticResource CustomMenuFlyoutItemStyle}" /> + <!-- TODO: Apply these styles to enable rounded corners --> + <!--<Style TargetType="MenuFlyoutItem" BasedOn="{StaticResource CustomMenuFlyoutItemStyle}" /> <Style TargetType="MenuFlyoutSubItem" BasedOn="{StaticResource CustomMenuFlyoutSubItemStyle}" /> - <Style TargetType="ComboBoxItem" BasedOn="{StaticResource CustomComboBoxItemStyle}" /> + <Style TargetType="ComboBoxItem" BasedOn="{StaticResource CustomComboBoxItemStyle}" />--> <Style TargetType="MenuFlyoutItem" x:Key="CustomMenuFlyoutItemStyle"> <Setter Property="Background" Value="{ThemeResource MenuFlyoutItemRevealBackground}" /> diff --git a/src/Notepads/Resource/CustomNavigationViewStyle.xaml b/src/Notepads/Resource/CustomNavigationViewStyle.xaml index c46bc0cf4..3cb5ea3a1 100644 --- a/src/Notepads/Resource/CustomNavigationViewStyle.xaml +++ b/src/Notepads/Resource/CustomNavigationViewStyle.xaml @@ -20,12 +20,13 @@ <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <Grid x:Name="LayoutRoot" MinWidth="{TemplateBinding MinWidth}" Height="{TemplateBinding MinHeight}" Margin="{TemplateBinding Padding}" Background="{TemplateBinding Background}" - CornerRadius="{ThemeResource ControlCornerRadius}" + CornerRadius="0" HorizontalAlignment="Stretch"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> @@ -141,7 +142,8 @@ <Setter Property="UseSystemFocusVisuals" Value="True" /> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property="TabNavigation" Value="Once"/> - <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> + <Setter Property="CornerRadius" Value="0" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="muxc:NavigationViewItem"> diff --git a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml index 058b1258d..050f93a24 100644 --- a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml +++ b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml @@ -200,6 +200,8 @@ <MenuFlyout.MenuFlyoutPresenterStyle> <Style TargetType="MenuFlyoutPresenter"> <Setter Property="BorderThickness" Value="0" /> + <!-- TODO: Remove CornerRadius property setter --> + <Setter Property="CornerRadius" Value="0" /> <Setter Property="MaxWidth" Value="1200" /> </Style> </MenuFlyout.MenuFlyoutPresenterStyle> @@ -237,6 +239,7 @@ </controls:SetsView> + <!-- TODO: Change CornerRadius to {ThemeResource OverlayCornerRadius}--> <wctc:InAppNotification x:Name="StatusNotification" x:Load="false" Style="{StaticResource InAppNotificationNoDismissButton}" @@ -247,7 +250,7 @@ HorizontalOffset="0" FontWeight="Light" BorderThickness="1" - CornerRadius="{ThemeResource OverlayCornerRadius}"> + CornerRadius="0"> </wctc:InAppNotification> </Grid> </SplitView.Content> @@ -292,8 +295,9 @@ <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <Grid Column="0" - CornerRadius="{ThemeResource ControlCornerRadius}"> + CornerRadius="0"> <Grid x:Name="FileModificationStateIndicator" Padding="8,5,6,5" IsTapEnabled="True" @@ -334,6 +338,8 @@ </MenuFlyoutItem> <MenuFlyout.MenuFlyoutPresenterStyle> <Style TargetType="MenuFlyoutPresenter"> + <!-- TODO: Remove CornerRadius property setter --> + <Setter Property="CornerRadius" Value="0" /> <Setter Property="BorderThickness" Value="0" /> </Style> </MenuFlyout.MenuFlyoutPresenterStyle> @@ -341,8 +347,9 @@ </Grid.ContextFlyout> </Grid> </Grid> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <Grid Column="1" - CornerRadius="{ThemeResource ControlCornerRadius}" + CornerRadius="0" wctui:FrameworkElementExtensions.Cursor="Hand"> <TextBlock x:Name="PathIndicator" Style="{StaticResource StatusBarTextBlockStyle}" Padding ="4,4,8,4" @@ -407,6 +414,8 @@ </MenuFlyoutItem> <MenuFlyout.MenuFlyoutPresenterStyle> <Style TargetType="MenuFlyoutPresenter"> + <!-- TODO: Remove CornerRadius property setter --> + <Setter Property="CornerRadius" Value="0" /> <Setter Property="BorderThickness" Value="0" /> </Style> </MenuFlyout.MenuFlyoutPresenterStyle> @@ -414,8 +423,9 @@ </TextBlock.ContextFlyout> </TextBlock> </Grid> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <Grid Column="2" - CornerRadius="{ThemeResource ControlCornerRadius}" + CornerRadius="0" wctui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> @@ -461,6 +471,8 @@ <MenuFlyout.MenuFlyoutPresenterStyle> <Style TargetType="MenuFlyoutPresenter"> + <!-- TODO: Remove CornerRadius property setter --> + <Setter Property="CornerRadius" Value="0" /> <Setter Property="BorderThickness" Value="0" /> </Style> </MenuFlyout.MenuFlyoutPresenterStyle> @@ -468,9 +480,10 @@ </TextBlock.ContextFlyout> </TextBlock> </Grid> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <Grid Column="3" x:Name="LineColumnIndicatorButton" - CornerRadius="{ThemeResource ControlCornerRadius}" + CornerRadius="0" wctui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> @@ -494,8 +507,9 @@ Tapped="StatusBarComponent_OnTapped"> </TextBlock> </Grid> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <Grid Column="4" - CornerRadius="{ThemeResource ControlCornerRadius}" + CornerRadius="0" wctui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> @@ -522,12 +536,13 @@ <Flyout x:Name="FontZoomIndicatorFlyout" Placement="TopEdgeAlignedRight" Closing="StatusBarFlyout_OnClosing"> <StackPanel> <StackPanel Orientation="Horizontal" Margin="-10,0,-10,0"> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <AppBarButton x:Name="ZoomOut" x:Uid="TextEditor_FontZoomIndicator_FlyoutItem_ZoomOut" LabelPosition="Collapsed" VerticalAlignment="Center" BorderBrush="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}" - CornerRadius="{ThemeResource ControlCornerRadius}" + CornerRadius="0" Width="40" KeyboardAcceleratorTextOverride="Ctrl+Minus" Click="FontZoomIndicatorFlyoutSelection_OnClick"> @@ -544,12 +559,13 @@ VerticalAlignment="Center" Width="150" Margin="5" ValueChanged="FontZoomSlider_ValueChanged"/> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <AppBarButton x:Name="ZoomIn" x:Uid="TextEditor_FontZoomIndicator_FlyoutItem_ZoomIn" LabelPosition="Collapsed" VerticalAlignment="Center" BorderBrush="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}" - CornerRadius="{ThemeResource ControlCornerRadius}" + CornerRadius="0" Width="40" KeyboardAcceleratorTextOverride="Ctrl+Plus" Click="FontZoomIndicatorFlyoutSelection_OnClick"> @@ -569,10 +585,11 @@ <TextBlock Text="{x:Bind FontZoomSlider.Value,Mode=OneWay}" VerticalAlignment="Center" FontSize="15"/> <TextBlock Text="%" VerticalAlignment="Center" FontSize="15"/> </StackPanel> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <AppBarButton x:Name="RestoreDefaultZoom" x:Uid="TextEditor_FontZoomIndicator_FlyoutItem_RestoreDefaultZoom" Style="{StaticResource CustomAppBarButtonLabelToRightStyle}" - CornerRadius="{ThemeResource ControlCornerRadius}" + CornerRadius="0" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="-10,5,-10,-5" @@ -592,8 +609,9 @@ </TextBlock.ContextFlyout> </TextBlock> </Grid> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <Grid Column="5" - CornerRadius="{ThemeResource ControlCornerRadius}" + CornerRadius="0" wctui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> @@ -623,6 +641,8 @@ <MenuFlyoutItem Text="Unix (LF)" Tag="LF" Click="LineEndingSelection_OnClick"/> <MenuFlyout.MenuFlyoutPresenterStyle> <Style TargetType="MenuFlyoutPresenter"> + <!-- TODO: Remove CornerRadius property setter --> + <Setter Property="CornerRadius" Value="0" /> <Setter Property="BorderThickness" Value="0" /> </Style> </MenuFlyout.MenuFlyoutPresenterStyle> @@ -630,8 +650,9 @@ </TextBlock.ContextFlyout> </TextBlock> </Grid> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <Grid Column="6" - CornerRadius="{ThemeResource ControlCornerRadius}" + CornerRadius="0" wctui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> @@ -658,6 +679,8 @@ <MenuFlyout x:Name="EncodingSelectionFlyout" Placement="TopEdgeAlignedRight" Closing="StatusBarFlyout_OnClosing"> <MenuFlyout.MenuFlyoutPresenterStyle> <Style TargetType="MenuFlyoutPresenter"> + <!-- TODO: Remove CornerRadius property setter --> + <Setter Property="CornerRadius" Value="0" /> <Setter Property="BorderThickness" Value="0" /> </Style> </MenuFlyout.MenuFlyoutPresenterStyle> @@ -665,8 +688,9 @@ </TextBlock.ContextFlyout> </TextBlock> </Grid> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <Grid Column="7" - CornerRadius="{ThemeResource ControlCornerRadius}" + CornerRadius="0" wctui:FrameworkElementExtensions.Cursor="Hand"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> @@ -686,8 +710,9 @@ </Core:EventTriggerBehavior> </Interactivity:Interaction.Behaviors> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> <Grid x:Name="ShadowWindowIndicator" - CornerRadius="{ThemeResource ControlCornerRadius}" + CornerRadius="0" Visibility="Collapsed" Padding="6,6,6,6" IsTapEnabled="True" diff --git a/src/Notepads/Views/Settings/PersonalizationSettingsPage.xaml b/src/Notepads/Views/Settings/PersonalizationSettingsPage.xaml index cb1549d32..8d4d86ed9 100644 --- a/src/Notepads/Views/Settings/PersonalizationSettingsPage.xaml +++ b/src/Notepads/Views/Settings/PersonalizationSettingsPage.xaml @@ -18,29 +18,36 @@ <BrushTransition /> </Grid.BackgroundTransition> - <ScrollViewer - Grid.Row="0" - Padding="20,0,20,0" - IsTabStop="False" - UseSystemFocusVisuals="False" - VerticalScrollBarVisibility="Auto" - VerticalScrollMode="Auto"> + <ScrollViewer Grid.Row="0" + Padding="20,0,20,0" + IsTabStop="False" + UseSystemFocusVisuals="False" + VerticalScrollBarVisibility="Auto" + VerticalScrollMode="Auto"> <StackPanel HorizontalAlignment="Left" Margin="0,0,0,40"> - <TextBlock - x:Uid="/Settings/PersonalizationPage_ThemeModeSettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" - Margin="0,15,0,0" - FontWeight="Normal"/> + <TextBlock x:Uid="/Settings/PersonalizationPage_ThemeModeSettings_Title" + Style="{StaticResource CompactSubtitleTextBlockStyle}" + Margin="0,15,0,0" + FontWeight="Normal"/> <StackPanel x:Name="ThemePanel" Margin="0,10,0,0"> - <RadioButton x:Uid="/Settings/PersonalizationPage_ThemeModeSettings_LightModeRadioButton" Style="{StaticResource CustomRadioButtonStyle}" x:Name="ThemeModeLightButton" Tag="Light" /> - <RadioButton x:Uid="/Settings/PersonalizationPage_ThemeModeSettings_DarkModeRadioButton" Style="{StaticResource CustomRadioButtonStyle}" x:Name="ThemeModeDarkButton" Tag="Dark" /> - <RadioButton x:Uid="/Settings/PersonalizationPage_ThemeModeSettings_WindowsModeRadioButton" Style="{StaticResource CustomRadioButtonStyle}" x:Name="ThemeModeDefaultButton" Tag="Default" /> + <RadioButton x:Uid="/Settings/PersonalizationPage_ThemeModeSettings_LightModeRadioButton" + Style="{StaticResource CustomRadioButtonStyle}" + x:Name="ThemeModeLightButton" + Tag="Light" /> + <RadioButton x:Uid="/Settings/PersonalizationPage_ThemeModeSettings_DarkModeRadioButton" + Style="{StaticResource CustomRadioButtonStyle}" + x:Name="ThemeModeDarkButton" + Tag="Dark" /> + <RadioButton x:Uid="/Settings/PersonalizationPage_ThemeModeSettings_WindowsModeRadioButton" + Style="{StaticResource CustomRadioButtonStyle}" + x:Name="ThemeModeDefaultButton" + Tag="Default" /> </StackPanel> <TextBlock x:Name="BackgroundTintOpacityTitle" - x:Uid="/Settings/PersonalizationPage_BackgroundTintOpacitySettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" - Margin="0,20,0,0" - FontWeight="Normal"/> + x:Uid="/Settings/PersonalizationPage_BackgroundTintOpacitySettings_Title" + Style="{StaticResource CompactSubtitleTextBlockStyle}" + Margin="0,20,0,0" + FontWeight="Normal"/> <StackPanel x:Name="BackgroundTintOpacityControls" Margin="0,10,0,0"> <StackPanel Orientation="Horizontal"> <Slider Style="{StaticResource CustomSliderStyle}" @@ -58,25 +65,27 @@ VerticalAlignment="Center" FontSize="18"/> </StackPanel> - <TextBlock x:Uid="/Settings/PersonalizationPage_BackgroundTintOpacitySettings_Description" Style="{ThemeResource DescriptionTextBlockStyle}" Margin="0,8,0,0"/> + <TextBlock x:Uid="/Settings/PersonalizationPage_BackgroundTintOpacitySettings_Description" + Style="{ThemeResource DescriptionTextBlockStyle}" + Margin="0,8,0,0"/> </StackPanel> - <TextBlock - x:Uid="/Settings/PersonalizationPage_AccentColorSettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" - Margin="0,20,0,0" - FontWeight="Normal"/> + <TextBlock x:Uid="/Settings/PersonalizationPage_AccentColorSettings_Title" + Style="{StaticResource CompactSubtitleTextBlockStyle}" + Margin="0,20,0,0" + FontWeight="Normal"/> <StackPanel Margin="0,10,0,0"> - <ToggleSwitch x:Uid="/Settings/PersonalizationPage_AccentColorSettings_UseWindowsAccentColorToggleSwitch" Style="{StaticResource CustomToggleSwitchStyle}" x:Name="AccentColorToggle" Margin="0,0,0,8"/> + <ToggleSwitch x:Uid="/Settings/PersonalizationPage_AccentColorSettings_UseWindowsAccentColorToggleSwitch" + Style="{StaticResource CustomToggleSwitchStyle}" + x:Name="AccentColorToggle" Margin="0,0,0,8"/> <Viewbox MaxWidth="300" Stretch="Fill"> - <muxc:ColorPicker - x:Name="AccentColorPicker" - ColorSpectrumShape="Ring" - IsColorSliderVisible="True" - IsColorChannelTextInputVisible="True" - IsHexInputVisible="True" - IsAlphaEnabled="False" - IsAlphaSliderVisible="True" - IsAlphaTextInputVisible="True"> + <muxc:ColorPicker x:Name="AccentColorPicker" + ColorSpectrumShape="Ring" + IsColorSliderVisible="True" + IsColorChannelTextInputVisible="True" + IsHexInputVisible="True" + IsAlphaEnabled="False" + IsAlphaSliderVisible="True" + IsAlphaTextInputVisible="True"> </muxc:ColorPicker> </Viewbox> </StackPanel> diff --git a/src/Notepads/Views/Settings/TextAndEditorSettingsPage.xaml b/src/Notepads/Views/Settings/TextAndEditorSettingsPage.xaml index 6d42561ac..450cc2ffd 100644 --- a/src/Notepads/Views/Settings/TextAndEditorSettingsPage.xaml +++ b/src/Notepads/Views/Settings/TextAndEditorSettingsPage.xaml @@ -215,7 +215,8 @@ </StackPanel> </RadioButton> <StackPanel Margin="28,5,0,10"> - <TextBox Style="{StaticResource TransparentTextBoxStyle}" BorderThickness="0" CornerRadius="{ThemeResource ControlCornerRadius}" x:Name="CustomSearchUrl" PlaceholderText="https://www.example.com/search?q={0}" IsSpellCheckEnabled="False" TextChanged="CustomSearchUrl_TextChanged" LostFocus="CustomSearchUrl_LostFocus"/> + <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> + <TextBox Style="{StaticResource TransparentTextBoxStyle}" BorderThickness="0" CornerRadius="0" x:Name="CustomSearchUrl" PlaceholderText="https://www.example.com/search?q={0}" IsSpellCheckEnabled="False" TextChanged="CustomSearchUrl_TextChanged" LostFocus="CustomSearchUrl_LostFocus"/> <TextBlock x:Name="CustomUrlErrorReport" x:Uid="/Settings/TextAndEditorPage_SearchEngineSettings_CustomSearchUrlRadioButton_CustomUrlErrorReport" Style="{ThemeResource DescriptionTextBlockStyle}" Foreground="Red" Visibility="Collapsed"/> </StackPanel> </StackPanel> From 90fef839bbe5e43fd91ff1402b77b41cb7927792 Mon Sep 17 00:00:00 2001 From: Soumya Ranjan Mahunt <devsoumyamahunt@gmail.com> Date: Mon, 22 Mar 2021 18:47:05 +0530 Subject: [PATCH 10/15] Remove unnecessary dependencies. --- src/Notepads.Controls/Notepads.Controls.csproj | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/Notepads.Controls/Notepads.Controls.csproj b/src/Notepads.Controls/Notepads.Controls.csproj index 3e4901658..e92f4fa3f 100644 --- a/src/Notepads.Controls/Notepads.Controls.csproj +++ b/src/Notepads.Controls/Notepads.Controls.csproj @@ -183,9 +183,6 @@ <EmbeddedResource Include="Properties\Notepads.Controls.rd.xml" /> </ItemGroup> <ItemGroup> - <PackageReference Include="ColorCode.UWP"> - <Version>2.0.6</Version> - </PackageReference> <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> <Version>6.2.12</Version> </PackageReference> @@ -195,9 +192,6 @@ <PackageReference Include="Microsoft.UI.Xaml"> <Version>2.5.0</Version> </PackageReference> - <PackageReference Include="Win2D.uwp"> - <Version>1.25.0</Version> - </PackageReference> </ItemGroup> <ItemGroup> <Page Include="SetsView\SetsView.xaml"> From 7d3ebd58e6498742959c17b464cb7bb4f8c64430 Mon Sep 17 00:00:00 2001 From: Soumya Ranjan Mahunt <devsoumyamahunt@gmail.com> Date: Mon, 22 Mar 2021 19:27:26 +0530 Subject: [PATCH 11/15] Remove redundant dependencies and modify tooltip style. --- src/Notepads/App.xaml | 3 +++ src/Notepads/Notepads.csproj | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Notepads/App.xaml b/src/Notepads/App.xaml index 16e6ce47c..b3d22184e 100644 --- a/src/Notepads/App.xaml +++ b/src/Notepads/App.xaml @@ -63,6 +63,9 @@ <Style TargetType="TextBox"> <Setter Property="CornerRadius" Value="0" /> </Style> + <Style TargetType="ToolTip"> + <Setter Property="CornerRadius" Value="0" /> + </Style> </ResourceDictionary> </Application.Resources> diff --git a/src/Notepads/Notepads.csproj b/src/Notepads/Notepads.csproj index 8462d923b..80a94be9f 100644 --- a/src/Notepads/Notepads.csproj +++ b/src/Notepads/Notepads.csproj @@ -431,9 +431,6 @@ <PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed"> <Version>2.0.1</Version> </PackageReference> - <PackageReference Include="Newtonsoft.Json"> - <Version>12.0.3</Version> - </PackageReference> <PackageReference Include="System.Text.Json"> <Version>5.0.1</Version> </PackageReference> From 649273c22cc5aef21a5afa09052045082c7160da Mon Sep 17 00:00:00 2001 From: Soumya Ranjan Mahunt <devsoumyamahunt@gmail.com> Date: Sun, 18 Apr 2021 16:03:21 +0530 Subject: [PATCH 12/15] feat: apply more style changes --- .../Notepads.Controls.csproj | 2 +- src/Notepads.Controls/SetsView/SetsView.xaml | 974 +++++++++--------- src/Notepads.Controls/Themes/Generic.xaml | 5 +- src/Notepads/App.xaml | 60 +- .../Controls/Dialog/FileRenameDialog.cs | 5 +- .../Controls/Dialog/NotepadsDialog.cs | 10 +- .../DiffViewer/SideBySideDiffViewer.xaml | 137 +-- .../FindAndReplace/FindAndReplaceControl.xaml | 310 +++--- .../FindAndReplacePlaceHolder.xaml | 136 ++- src/Notepads/Controls/GoTo/GoToControl.xaml | 99 +- .../Markdown/MarkdownExtensionView.xaml | 32 +- .../Print/ContinuationPageFormat.xaml | 31 +- .../Controls/Print/PrintPageFormat.xaml | 48 +- .../Controls/TextEditor/TextEditor.xaml | 245 ++--- .../Controls/TextEditor/TextEditorCore.xaml | 168 ++- src/Notepads/Core/TabContextFlyout.cs | 3 +- src/Notepads/Notepads.csproj | 8 +- .../Resource/CustomAppBarButtonStyle.xaml | 347 +++---- .../Resource/CustomFlyoutItemStyle.xaml | 465 ++++----- .../Resource/CustomNavigationViewStyle.xaml | 302 +++--- .../Resource/CustomRadioButtonStyle.xaml | 85 +- src/Notepads/Resource/CustomSliderStyle.xaml | 468 ++++----- .../Resource/CustomSplitViewStyle.xaml | 541 ++++++---- .../Resource/CustomToggleSwitchStyle.xaml | 509 +++++---- src/Notepads/Resource/DismissButtonStyle.xaml | 64 +- .../InAppNotificationNoDismissButton.xaml | 125 +-- .../Resource/TransparentTextBoxStyle.xaml | 163 ++- .../Views/MainPage/NotepadsMainPage.xaml | 812 +++++++++------ src/Notepads/Views/Settings/AboutPage.xaml | 77 +- .../Views/Settings/AdvancedSettingsPage.xaml | 104 +- .../Settings/PersonalizationSettingsPage.xaml | 137 +-- src/Notepads/Views/Settings/SettingsPage.xaml | 57 +- .../Views/Settings/SettingsPanel.xaml | 37 +- .../Settings/TextAndEditorSettingsPage.xaml | 325 +++--- 34 files changed, 3585 insertions(+), 3306 deletions(-) diff --git a/src/Notepads.Controls/Notepads.Controls.csproj b/src/Notepads.Controls/Notepads.Controls.csproj index e92f4fa3f..b8bc24640 100644 --- a/src/Notepads.Controls/Notepads.Controls.csproj +++ b/src/Notepads.Controls/Notepads.Controls.csproj @@ -187,7 +187,7 @@ <Version>6.2.12</Version> </PackageReference> <PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls"> - <Version>7.0.0</Version> + <Version>7.0.1</Version> </PackageReference> <PackageReference Include="Microsoft.UI.Xaml"> <Version>2.5.0</Version> diff --git a/src/Notepads.Controls/SetsView/SetsView.xaml b/src/Notepads.Controls/SetsView/SetsView.xaml index a33a516b5..4d2245f51 100644 --- a/src/Notepads.Controls/SetsView/SetsView.xaml +++ b/src/Notepads.Controls/SetsView/SetsView.xaml @@ -1,106 +1,86 @@ -<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters" - xmlns:wctui="using:Microsoft.Toolkit.Uwp.UI" - xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls" - xmlns:local="using:Notepads.Controls"> +<ResourceDictionary + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters" + xmlns:local="using:Notepads.Controls" + xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls" + xmlns:wctui="using:Microsoft.Toolkit.Uwp.UI"> <ResourceDictionary.ThemeDictionaries> <ResourceDictionary x:Key="Light"> - <SolidColorBrush x:Key="SetsViewBackground" Color="Transparent"/> - <SolidColorBrush x:Key="SetsViewItemHeaderBackgroundSelected" - Opacity="0.25" - Color="White"/> - <SolidColorBrush x:Key="SetsViewItemHeaderBackgroundPointerOver" - Opacity="0.15" - Color="White"/> - <SolidColorBrush x:Key="SetsViewItemHeaderBackgroundPressed" - Opacity="0.25" - Color="White"/> - <StaticResource x:Key="SetsViewItemHeaderBackground" - ResourceKey="SystemControlTransparentBrush" /> - <StaticResource x:Key="SetsViewSelectionIndicatorForeground" - ResourceKey="SystemControlForegroundAccentBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForeground" - ResourceKey="SystemControlForegroundBaseMediumBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundPressed" - ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundSelected" - ResourceKey="SystemControlForegroundBaseHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundPointerOver" - ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundDisabled" - ResourceKey="SystemControlDisabledBaseMediumLowBrush" /> - <StaticResource x:Key="SetsViewItemHeaderRevealBorderBrush" - ResourceKey="SystemControlBackgroundTransparentRevealBorderBrush" /> + <SolidColorBrush x:Key="SetsViewBackground" Color="Transparent" /> + <SolidColorBrush + x:Key="SetsViewItemHeaderBackgroundSelected" + Opacity="0.25" + Color="White" /> + <SolidColorBrush + x:Key="SetsViewItemHeaderBackgroundPointerOver" + Opacity="0.15" + Color="White" /> + <SolidColorBrush + x:Key="SetsViewItemHeaderBackgroundPressed" + Opacity="0.25" + Color="White" /> + <StaticResource x:Key="SetsViewItemHeaderBackground" ResourceKey="SystemControlTransparentBrush" /> + <StaticResource x:Key="SetsViewSelectionIndicatorForeground" ResourceKey="SystemControlForegroundAccentBrush" /> + <StaticResource x:Key="SetsViewItemHeaderForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" /> + <StaticResource x:Key="SetsViewItemHeaderForegroundPressed" ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> + <StaticResource x:Key="SetsViewItemHeaderForegroundSelected" ResourceKey="SystemControlForegroundBaseHighBrush" /> + <StaticResource x:Key="SetsViewItemHeaderForegroundPointerOver" ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> + <StaticResource x:Key="SetsViewItemHeaderForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" /> + <StaticResource x:Key="SetsViewItemHeaderRevealBorderBrush" ResourceKey="SystemControlBackgroundTransparentRevealBorderBrush" /> <x:Double x:Key="SetsEdgeShadowOpacity">0.55</x:Double> - <RevealBackgroundBrush x:Key="SetsViewItemRevealBackgroundBrush" - Color="Gray" - Opacity="0.3" - FallbackColor="Gray" /> + <RevealBackgroundBrush + x:Key="SetsViewItemRevealBackgroundBrush" + FallbackColor="Gray" + Opacity="0.3" + Color="Gray" /> </ResourceDictionary> <ResourceDictionary x:Key="Dark"> - <SolidColorBrush x:Key="SetsViewBackground" Color="Transparent"/> - <SolidColorBrush x:Key="SetsViewItemHeaderBackgroundSelected" - Opacity="0.25" - Color="Black"/> - <SolidColorBrush x:Key="SetsViewItemHeaderBackgroundPointerOver" - Opacity="0.20" - Color="Black"/> - <SolidColorBrush x:Key="SetsViewItemHeaderBackgroundPressed" - Opacity="0.25" - Color="Black"/> - <StaticResource x:Key="SetsViewItemHeaderBackground" - ResourceKey="SystemControlTransparentBrush" /> - <StaticResource x:Key="SetsViewSelectionIndicatorForeground" - ResourceKey="SystemControlForegroundAccentBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForeground" - ResourceKey="SystemControlForegroundBaseMediumBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundPressed" - ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundSelected" - ResourceKey="SystemControlForegroundBaseHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundPointerOver" - ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundDisabled" - ResourceKey="SystemControlDisabledBaseMediumLowBrush" /> - <StaticResource x:Key="SetsViewItemHeaderRevealBorderBrush" - ResourceKey="SystemControlBackgroundTransparentRevealBorderBrush" /> + <SolidColorBrush x:Key="SetsViewBackground" Color="Transparent" /> + <SolidColorBrush + x:Key="SetsViewItemHeaderBackgroundSelected" + Opacity="0.25" + Color="Black" /> + <SolidColorBrush + x:Key="SetsViewItemHeaderBackgroundPointerOver" + Opacity="0.20" + Color="Black" /> + <SolidColorBrush + x:Key="SetsViewItemHeaderBackgroundPressed" + Opacity="0.25" + Color="Black" /> + <StaticResource x:Key="SetsViewItemHeaderBackground" ResourceKey="SystemControlTransparentBrush" /> + <StaticResource x:Key="SetsViewSelectionIndicatorForeground" ResourceKey="SystemControlForegroundAccentBrush" /> + <StaticResource x:Key="SetsViewItemHeaderForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" /> + <StaticResource x:Key="SetsViewItemHeaderForegroundPressed" ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> + <StaticResource x:Key="SetsViewItemHeaderForegroundSelected" ResourceKey="SystemControlForegroundBaseHighBrush" /> + <StaticResource x:Key="SetsViewItemHeaderForegroundPointerOver" ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> + <StaticResource x:Key="SetsViewItemHeaderForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" /> + <StaticResource x:Key="SetsViewItemHeaderRevealBorderBrush" ResourceKey="SystemControlBackgroundTransparentRevealBorderBrush" /> <x:Double x:Key="SetsEdgeShadowOpacity">0.7</x:Double> - <RevealBackgroundBrush x:Key="SetsViewItemRevealBackgroundBrush" - Color="Transparent" - FallbackColor="Transparent" /> + <RevealBackgroundBrush + x:Key="SetsViewItemRevealBackgroundBrush" + FallbackColor="Transparent" + Color="Transparent" /> </ResourceDictionary> <ResourceDictionary x:Key="HighContrast"> - <SolidColorBrush x:Key="SetsViewBackground" - Color="{ThemeResource SystemChromeLowColor}" /> - <SolidColorBrush x:Key="SetsViewItemHeaderBackgroundSelected" - Color="{ThemeResource SystemColorHighlightColor}" /> - <SolidColorBrush x:Key="SetsViewItemHeaderBackgroundPointerOver" - Color="{ThemeResource SystemColorHighlightColor}" /> - <SolidColorBrush x:Key="SetsViewItemHeaderBackgroundPressed" - Color="{ThemeResource SystemColorHighlightColor}" /> - <StaticResource x:Key="SetsViewItemHeaderBackground" - ResourceKey="SystemControlTransparentBrush" /> - <StaticResource x:Key="SetsViewSelectionIndicatorForeground" - ResourceKey="SystemControlForegroundAccentBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForeground" - ResourceKey="SystemControlForegroundBaseMediumBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundPressed" - ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundSelected" - ResourceKey="SystemControlForegroundBaseHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundPointerOver" - ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundDisabled" - ResourceKey="SystemControlDisabledBaseMediumLowBrush" /> - <StaticResource x:Key="SetsViewItemHeaderRevealBorderBrush" - ResourceKey="SystemControlBackgroundTransparentRevealBorderBrush" /> + <SolidColorBrush x:Key="SetsViewBackground" Color="{ThemeResource SystemChromeLowColor}" /> + <SolidColorBrush x:Key="SetsViewItemHeaderBackgroundSelected" Color="{ThemeResource SystemColorHighlightColor}" /> + <SolidColorBrush x:Key="SetsViewItemHeaderBackgroundPointerOver" Color="{ThemeResource SystemColorHighlightColor}" /> + <SolidColorBrush x:Key="SetsViewItemHeaderBackgroundPressed" Color="{ThemeResource SystemColorHighlightColor}" /> + <StaticResource x:Key="SetsViewItemHeaderBackground" ResourceKey="SystemControlTransparentBrush" /> + <StaticResource x:Key="SetsViewSelectionIndicatorForeground" ResourceKey="SystemControlForegroundAccentBrush" /> + <StaticResource x:Key="SetsViewItemHeaderForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" /> + <StaticResource x:Key="SetsViewItemHeaderForegroundPressed" ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> + <StaticResource x:Key="SetsViewItemHeaderForegroundSelected" ResourceKey="SystemControlForegroundBaseHighBrush" /> + <StaticResource x:Key="SetsViewItemHeaderForegroundPointerOver" ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> + <StaticResource x:Key="SetsViewItemHeaderForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" /> + <StaticResource x:Key="SetsViewItemHeaderRevealBorderBrush" ResourceKey="SystemControlBackgroundTransparentRevealBorderBrush" /> <x:Double x:Key="SetsEdgeShadowOpacity">0.0</x:Double> - <SolidColorBrush x:Key="SetsViewItemRevealBackgroundBrush" - Color="Transparent" /> + <SolidColorBrush x:Key="SetsViewItemRevealBackgroundBrush" Color="Transparent" /> </ResourceDictionary> </ResourceDictionary.ThemeDictionaries> @@ -114,18 +94,19 @@ <x:Double x:Key="SetsViewItemHeaderMaxWidth">NaN</x:Double> <x:Double x:Key="SetsViewItemHeaderCloseWidth">24</x:Double> - <converters:EmptyObjectToObjectConverter x:Key="NullVisibilityConverter" - EmptyValue="Collapsed" - NotEmptyValue="Visible" /> + <converters:EmptyObjectToObjectConverter + x:Key="NullVisibilityConverter" + EmptyValue="Collapsed" + NotEmptyValue="Visible" /> <converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" /> <!-- 65 is the size of both scroll buttons + 1 for layout rounding. --> - <converters:DoubleToVisibilityConverter x:Key="GreaterThanToleranceVisibilityConverter" - GreaterThan="65.0" /> + <converters:DoubleToVisibilityConverter x:Key="GreaterThanToleranceVisibilityConverter" GreaterThan="65.0" /> - <converters:BoolToObjectConverter x:Key="CloseCollapsingSizeConverter" - FalseValue="{StaticResource SetsViewItemHeaderCloseWidth}" - TrueValue="NaN" /> + <converters:BoolToObjectConverter + x:Key="CloseCollapsingSizeConverter" + FalseValue="{StaticResource SetsViewItemHeaderCloseWidth}" + TrueValue="NaN" /> <Style x:Key="TopEdgeShadowStyle" TargetType="wctc:DropShadowPanel"> <Setter Property="BlurRadius" Value="10" /> @@ -186,8 +167,7 @@ <Setter Property="Template" Value="{StaticResource SetsViewTemplate}" /> </Style> - <ControlTemplate x:Key="SetsViewTemplate" - TargetType="local:SetsView"> + <ControlTemplate x:Key="SetsViewTemplate" TargetType="local:SetsView"> <Grid x:Name="SetsViewContainer"> <Grid.RowDefinitions> <!-- 0 Header --> @@ -203,155 +183,162 @@ <!-- 0 SetsStartHeader --> <ColumnDefinition Width="Auto" /> <!-- 1 Sets --> - <ColumnDefinition Width="Auto" - local:SetsView.ConstrainColumn="True" - local:SetsView.IgnoreColumn="True" /> + <ColumnDefinition + Width="Auto" + local:SetsView.ConstrainColumn="True" + local:SetsView.IgnoreColumn="True" /> <!-- 2 Reserved: Overflow Drop-down --> <ColumnDefinition Width="Auto" /> <!-- 3 Auto Add Button --> <ColumnDefinition Width="Auto" /> <!-- 4 Padding --> - <ColumnDefinition Width="*" - local:SetsView.IgnoreColumn="True" /> + <ColumnDefinition Width="*" local:SetsView.IgnoreColumn="True" /> <!-- 5 SetsEndHeader --> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> - <ContentPresenter Grid.Row="0" - Grid.ColumnSpan="6" - Content="{TemplateBinding Header}" - ContentTemplate="{TemplateBinding HeaderTemplate}" /> + <ContentPresenter + Grid.Row="0" + Grid.ColumnSpan="6" + Content="{TemplateBinding Header}" + ContentTemplate="{TemplateBinding HeaderTemplate}" /> <!-- Shadow under Start Header --> <wctc:DropShadowPanel - Style="{StaticResource BottomEdgeShadowStyle}" Grid.Row="1" - Grid.Column="0"> - <Grid Height="1" Margin="0,0,0,-1"/> + Grid.Column="0" + Style="{StaticResource BottomEdgeShadowStyle}"> + <Grid Height="1" Margin="0,0,0,-1" /> <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="0,-12,1024,12"></RectangleGeometry> + <RectangleGeometry Rect="0,-12,1024,12" /> </wctc:DropShadowPanel.Clip> </wctc:DropShadowPanel> - <ContentPresenter Grid.Row="1" - Grid.Column="0" - Content="{TemplateBinding SetsStartHeader}" - ContentTemplate="{TemplateBinding SetsStartHeaderTemplate}" /> - - <ScrollViewer x:Name="ScrollViewer" - Grid.Row="1" - Grid.Column="1" - BorderThickness="0" - AutomationProperties.AccessibilityView="Raw" - BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}" - HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" - HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" - IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" - IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" - IsHorizontalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsHorizontalScrollChainingEnabled}" - IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" - IsVerticalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsVerticalScrollChainingEnabled}" - Style="{StaticResource SetsViewScrollViewer}" - TabNavigation="{TemplateBinding TabNavigation}" - VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" - VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" - ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"> - <ItemsPresenter x:Name="SetsItemsPresenter" - Padding="{TemplateBinding Padding}" /> + <ContentPresenter + Grid.Row="1" + Grid.Column="0" + Content="{TemplateBinding SetsStartHeader}" + ContentTemplate="{TemplateBinding SetsStartHeaderTemplate}" /> + + <ScrollViewer + x:Name="ScrollViewer" + Grid.Row="1" + Grid.Column="1" + AutomationProperties.AccessibilityView="Raw" + BorderThickness="0" + BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}" + HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" + HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" + IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" + IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" + IsHorizontalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsHorizontalScrollChainingEnabled}" + IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" + IsVerticalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsVerticalScrollChainingEnabled}" + Style="{StaticResource SetsViewScrollViewer}" + TabNavigation="{TemplateBinding TabNavigation}" + VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" + VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" + ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"> + <ItemsPresenter x:Name="SetsItemsPresenter" Padding="{TemplateBinding Padding}" /> </ScrollViewer> <!-- Shadow under Add Button --> - <wctc:DropShadowPanel - Style="{StaticResource BottomEdgeShadowStyle}" + <wctc:DropShadowPanel Grid.Row="1" - Grid.Column="3"> - <Grid Height="1" Margin="-1,0,0,-1"/> + Grid.Column="3" + Style="{StaticResource BottomEdgeShadowStyle}"> + <Grid Height="1" Margin="-1,0,0,-1" /> <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="0,-12,1024,12"></RectangleGeometry> + <RectangleGeometry Rect="0,-12,1024,12" /> </wctc:DropShadowPanel.Clip> </wctc:DropShadowPanel> - <ContentPresenter Grid.Row="1" - Grid.Column="3" - HorizontalAlignment="Left" - Content="{TemplateBinding SetsActionHeader}" - ContentTemplate="{TemplateBinding SetsActionHeaderTemplate}" /> + <ContentPresenter + Grid.Row="1" + Grid.Column="3" + HorizontalAlignment="Left" + Content="{TemplateBinding SetsActionHeader}" + ContentTemplate="{TemplateBinding SetsActionHeaderTemplate}" /> - <!-- Shadow under Padding area (23040 = 3 x 8k resolution in width just in case) --> - <wctc:DropShadowPanel - Style="{StaticResource BottomEdgeShadowStyle}" + <!-- Shadow under Padding area (23040 = 3 x 8k resolution in width just in case) --> + <wctc:DropShadowPanel Grid.Row="1" - Grid.Column="4"> - <Grid Height="1" Margin="0,0,0,-1"/> + Grid.Column="4" + Style="{StaticResource BottomEdgeShadowStyle}"> + <Grid Height="1" Margin="0,0,0,-1" /> <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="0,-12,23040,12"></RectangleGeometry> + <RectangleGeometry Rect="0,-12,23040,12" /> </wctc:DropShadowPanel.Clip> </wctc:DropShadowPanel> - <ContentPresenter Grid.Row="1" - Grid.Column="4" - HorizontalAlignment="Stretch" - Content="{TemplateBinding SetsPaddingHeader}" - ContentTemplate="{TemplateBinding SetsPaddingHeaderTemplate}" /> + <ContentPresenter + Grid.Row="1" + Grid.Column="4" + HorizontalAlignment="Stretch" + Content="{TemplateBinding SetsPaddingHeader}" + ContentTemplate="{TemplateBinding SetsPaddingHeaderTemplate}" /> <!-- Shadow under SetsEndHeader --> <wctc:DropShadowPanel - Style="{StaticResource BottomEdgeShadowStyle}" Grid.Row="1" - Grid.Column="5"> - <Grid Height="1" Margin="0,0,0,-1"/> + Grid.Column="5" + Style="{StaticResource BottomEdgeShadowStyle}"> + <Grid Height="1" Margin="0,0,0,-1" /> <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="0,-12,1024,12"></RectangleGeometry> + <RectangleGeometry Rect="0,-12,1024,12" /> </wctc:DropShadowPanel.Clip> </wctc:DropShadowPanel> - <ContentPresenter Grid.Row="1" - Grid.Column="5" - Content="{TemplateBinding SetsEndHeader}" - ContentTemplate="{TemplateBinding SetsEndHeaderTemplate}" /> - - <ContentPresenter x:Name="SetsContentPresenter" - Canvas.ZIndex="100" - Grid.Row="2" - Grid.ColumnSpan="6" - Grid.Column="0" - Background="{ThemeResource SetsViewItemHeaderBackgroundPressed}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" /> + <ContentPresenter + Grid.Row="1" + Grid.Column="5" + Content="{TemplateBinding SetsEndHeader}" + ContentTemplate="{TemplateBinding SetsEndHeaderTemplate}" /> + + <ContentPresenter + x:Name="SetsContentPresenter" + Grid.Row="2" + Grid.Column="0" + Grid.ColumnSpan="6" + Background="{ThemeResource SetsViewItemHeaderBackgroundPressed}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Canvas.ZIndex="100" /> <!-- Shadow above Footer --> - <wctc:DropShadowPanel - Style="{StaticResource TopEdgeShadowStyle}" - Canvas.ZIndex="50" + <wctc:DropShadowPanel Grid.Row="3" - Grid.ColumnSpan="6" - Grid.Column="0"> - <Grid Height="1"/> + Grid.Column="0" + Grid.ColumnSpan="6" + Canvas.ZIndex="50" + Style="{StaticResource TopEdgeShadowStyle}"> + <Grid Height="1" /> <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="0,0,23040,12"></RectangleGeometry> + <RectangleGeometry Rect="0,0,23040,12" /> </wctc:DropShadowPanel.Clip> </wctc:DropShadowPanel> - <ContentPresenter Grid.Row="3" - Canvas.ZIndex="50" - Grid.ColumnSpan="6" Grid.Column="0" - Content="{TemplateBinding Footer}" - ContentTemplate="{TemplateBinding FooterTemplate}" /> + <ContentPresenter + Grid.Row="3" + Grid.Column="0" + Grid.ColumnSpan="6" + Canvas.ZIndex="50" + Content="{TemplateBinding Footer}" + ContentTemplate="{TemplateBinding FooterTemplate}" /> </Grid> </ControlTemplate> <!-- Based on Style for ListViewItemExpanded Template - https://msdn.microsoft.com/en-us/library/windows/apps/mt299136.aspx --> - <ControlTemplate x:Key="SetsViewItemHeaderTemplate" - TargetType="local:SetsViewItem"> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <Grid x:Name="LayoutRoot" - wctui:FrameworkElementExtensions.AncestorType="local:SetsView" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="0" - Control.IsTemplateFocusTarget="True" - FocusVisualMargin="{TemplateBinding FocusVisualMargin}" - RenderTransformOrigin="0.5,0.5"> + <ControlTemplate x:Key="SetsViewItemHeaderTemplate" TargetType="local:SetsViewItem"> + <Grid + x:Name="LayoutRoot" + wctui:FrameworkElementExtensions.AncestorType="local:SetsView" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Control.IsTemplateFocusTarget="True" + CornerRadius="{ThemeResource ControlCornerRadius}" + FocusVisualMargin="{TemplateBinding FocusVisualMargin}" + RenderTransformOrigin="0.5,0.5"> <Grid.BackgroundTransition> <BrushTransition /> </Grid.BackgroundTransition> @@ -359,62 +346,62 @@ <ScaleTransform x:Name="LayoutRootScale" /> </Grid.RenderTransform> - <wctc:DropShadowPanel + <wctc:DropShadowPanel x:Name="ItemLeftSideShadow" - Style="{StaticResource SideEdgeShadowStyle}" - HorizontalAlignment="Left"> + HorizontalAlignment="Left" + Style="{StaticResource SideEdgeShadowStyle}"> <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="-8,0,8,32"></RectangleGeometry> + <RectangleGeometry Rect="-8,0,8,32" /> </wctc:DropShadowPanel.Clip> - <Grid Width="1"/> + <Grid Width="1" /> </wctc:DropShadowPanel> - <wctc:DropShadowPanel + <wctc:DropShadowPanel x:Name="ItemRightSideShadow" - Style="{StaticResource SideEdgeShadowStyle}" - HorizontalAlignment="Right"> + HorizontalAlignment="Right" + Style="{StaticResource SideEdgeShadowStyle}"> <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="1,0,8,32"></RectangleGeometry> + <RectangleGeometry Rect="1,0,8,32" /> </wctc:DropShadowPanel.Clip> - <Grid Width="1"/> + <Grid Width="1" /> </wctc:DropShadowPanel> - <wctc:DropShadowPanel - x:Name="ItemBottomSideShadow" - Style="{StaticResource BottomEdgeShadowStyle}"> - <Grid Height="1"/> + <wctc:DropShadowPanel x:Name="ItemBottomSideShadow" Style="{StaticResource BottomEdgeShadowStyle}"> + <Grid Height="1" /> </wctc:DropShadowPanel> - <Rectangle x:Name="SelectionIndicator" - Height="2" - Margin="0,-1" - VerticalAlignment="Top" - Fill="{TemplateBinding SelectionIndicatorForeground}" - Opacity="0"> - </Rectangle> - - <Border x:Name="LeftSideSeparator" - Grid.Column="0" - HorizontalAlignment="Left" - Visibility="Collapsed" - Width="1" - BorderBrush="{ThemeResource SystemControlBackgroundBaseLowRevealBorderBrush}" - BorderThickness="1" - Margin="0,6,0,6"/> - - <Border x:Name="RightSideSeparator" - HorizontalAlignment="Right" - Visibility="Collapsed" - Width="1" - BorderBrush="{ThemeResource SystemControlBackgroundBaseLowRevealBorderBrush}" - BorderThickness="1" - Margin="0,6,0,6"/> + <Rectangle + x:Name="SelectionIndicator" + Height="2" + Margin="0,-1" + VerticalAlignment="Top" + Fill="{TemplateBinding SelectionIndicatorForeground}" + Opacity="0" /> + + <Border + x:Name="LeftSideSeparator" + Grid.Column="0" + Width="1" + Margin="0,6,0,6" + HorizontalAlignment="Left" + BorderBrush="{ThemeResource SystemControlBackgroundBaseLowRevealBorderBrush}" + BorderThickness="1" + Visibility="Collapsed" /> + + <Border + x:Name="RightSideSeparator" + Width="1" + Margin="0,6,0,6" + HorizontalAlignment="Right" + BorderBrush="{ThemeResource SystemControlBackgroundBaseLowRevealBorderBrush}" + BorderThickness="1" + Visibility="Collapsed" /> <Grid Padding="{TemplateBinding Padding}"> <Grid x:Name="ContentPresenterGrid"> @@ -427,38 +414,44 @@ <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <!-- Modifications of default ListViewItem Template for our Set Here --> - <Viewbox x:Name="IconBox" - MaxWidth="{ThemeResource SetsViewItemHeaderIconSize}" - MaxHeight="{ThemeResource SetsViewItemHeaderIconSize}" - Margin="{ThemeResource SetsViewItemHeaderIconMargin}" - Visibility="{Binding Icon, Converter={StaticResource NullVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}"> - <ContentPresenter x:Name="Icon" - Content="{TemplateBinding Icon}" - Foreground="{TemplateBinding Foreground}" /> + <Viewbox + x:Name="IconBox" + MaxWidth="{ThemeResource SetsViewItemHeaderIconSize}" + MaxHeight="{ThemeResource SetsViewItemHeaderIconSize}" + Margin="{ThemeResource SetsViewItemHeaderIconMargin}" + Visibility="{Binding Icon, Converter={StaticResource NullVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}"> + <ContentPresenter + x:Name="Icon" + Content="{TemplateBinding Icon}" + Foreground="{TemplateBinding Foreground}" /> </Viewbox> - <ContentPresenter x:Name="ContentPresenter" - Grid.Column="1" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - Content="{TemplateBinding Header}" - ContentTemplate="{TemplateBinding HeaderTemplate}" - ContentTransitions="{TemplateBinding ContentTransitions}" - FontWeight="{TemplateBinding FontWeight}" - OpticalMarginAlignment="TrimSideBearings" /> + <ContentPresenter + x:Name="ContentPresenter" + Grid.Column="1" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + Content="{TemplateBinding Header}" + ContentTemplate="{TemplateBinding HeaderTemplate}" + ContentTransitions="{TemplateBinding ContentTransitions}" + FontWeight="{TemplateBinding FontWeight}" + OpticalMarginAlignment="TrimSideBearings" /> <!-- Use grid to toggle visibility based on IsClosable property and inner border for hover animations. --> - <Border x:Name="CloseButtonContainer" - Grid.Column="2" - Width="{Binding (wctui:FrameworkElementExtensions.Ancestor).IsCloseButtonOverlay, Converter={StaticResource CloseCollapsingSizeConverter}, ElementName=LayoutRoot}" - HorizontalAlignment="Center" - Visibility="{Binding IsClosable, Converter={StaticResource BoolToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}"> - <Border x:Name="CloseButtonBorder" - Width="{StaticResource SetsViewItemHeaderCloseWidth}" - Margin="{ThemeResource SetsViewItemHeaderCloseMargin}" - Background="{TemplateBinding Background}" - Visibility="Collapsed"> - <Button x:Name="CloseButton" - x:Uid="/SetsView/Resources/SetsView_CloseButton" - Style="{StaticResource SetsViewItemCloseButtonStyle}"> + <Border + x:Name="CloseButtonContainer" + Grid.Column="2" + Width="{Binding (wctui:FrameworkElementExtensions.Ancestor).IsCloseButtonOverlay, Converter={StaticResource CloseCollapsingSizeConverter}, ElementName=LayoutRoot}" + HorizontalAlignment="Center" + Visibility="{Binding IsClosable, Converter={StaticResource BoolToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}"> + <Border + x:Name="CloseButtonBorder" + Width="{StaticResource SetsViewItemHeaderCloseWidth}" + Margin="{ThemeResource SetsViewItemHeaderCloseMargin}" + Background="{TemplateBinding Background}" + Visibility="Collapsed"> + <Button + x:Name="CloseButton" + x:Uid="/SetsView/Resources/SetsView_CloseButton" + Style="{StaticResource SetsViewItemCloseButtonStyle}">  </Button> </Border> @@ -480,15 +473,11 @@ <Storyboard> <!-- Close Button --> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SystemControlHighlightTransparentBrush}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" - Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="Visible" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> @@ -512,38 +501,29 @@ <Storyboard> <!-- Selected Bar --> - <DoubleAnimation Storyboard.TargetName="SelectionIndicator" - Storyboard.TargetProperty="Opacity" - To="1" - Duration="0" /> + <DoubleAnimation + Storyboard.TargetName="SelectionIndicator" + Storyboard.TargetProperty="Opacity" + To="1" + Duration="0" /> <!-- Close Button --> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SystemControlHighlightTransparentBrush}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" - Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="Visible" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <!-- Left, right and bottom shadows --> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemLeftSideShadow" - Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="Visible" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemLeftSideShadow" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemRightSideShadow" - Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="Visible" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemRightSideShadow" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemBottomSideShadow" - Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="Collapsed" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemBottomSideShadow" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> @@ -557,38 +537,29 @@ <Storyboard> <!-- Selected Bar --> - <DoubleAnimation Storyboard.TargetName="SelectionIndicator" - Storyboard.TargetProperty="Opacity" - To="1" - Duration="0" /> + <DoubleAnimation + Storyboard.TargetName="SelectionIndicator" + Storyboard.TargetProperty="Opacity" + To="1" + Duration="0" /> <!-- Close Button --> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SystemControlHighlightTransparentBrush}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" - Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="Visible" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <!-- Left, right and bottom shadows --> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemLeftSideShadow" - Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="Visible" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemLeftSideShadow" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemRightSideShadow" - Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="Visible" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemRightSideShadow" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemBottomSideShadow" - Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="Collapsed" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemBottomSideShadow" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> @@ -602,38 +573,29 @@ <Storyboard> <!-- Selected Bar --> - <DoubleAnimation Storyboard.TargetName="SelectionIndicator" - Storyboard.TargetProperty="Opacity" - To="1" - Duration="0" /> + <DoubleAnimation + Storyboard.TargetName="SelectionIndicator" + Storyboard.TargetProperty="Opacity" + To="1" + Duration="0" /> <!-- Close Button --> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SystemControlHighlightTransparentBrush}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" - Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="Visible" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <!-- Left, right and bottom shadows --> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemLeftSideShadow" - Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="Visible" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemLeftSideShadow" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemRightSideShadow" - Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="Visible" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemRightSideShadow" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemBottomSideShadow" - Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="Collapsed" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemBottomSideShadow" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> @@ -661,39 +623,42 @@ <VisualState x:Name="BottomReorderHint"> <Storyboard> - <DragOverThemeAnimation Direction="Bottom" - ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" - TargetName="LayoutRoot" /> + <DragOverThemeAnimation + Direction="Bottom" + ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" + TargetName="LayoutRoot" /> </Storyboard> </VisualState> <VisualState x:Name="TopReorderHint"> <Storyboard> - <DragOverThemeAnimation Direction="Top" - ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" - TargetName="LayoutRoot" /> + <DragOverThemeAnimation + Direction="Top" + ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" + TargetName="LayoutRoot" /> </Storyboard> </VisualState> <VisualState x:Name="RightReorderHint"> <Storyboard> - <DragOverThemeAnimation Direction="Right" - ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" - TargetName="LayoutRoot" /> + <DragOverThemeAnimation + Direction="Right" + ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" + TargetName="LayoutRoot" /> </Storyboard> </VisualState> <VisualState x:Name="LeftReorderHint"> <Storyboard> - <DragOverThemeAnimation Direction="Left" - ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" - TargetName="LayoutRoot" /> + <DragOverThemeAnimation + Direction="Left" + ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" + TargetName="LayoutRoot" /> </Storyboard> </VisualState> <VisualStateGroup.Transitions> - <VisualTransition GeneratedDuration="0:0:0.2" - To="NoReorderHint" /> + <VisualTransition GeneratedDuration="0:0:0.2" To="NoReorderHint" /> </VisualStateGroup.Transitions> </VisualStateGroup> @@ -702,10 +667,11 @@ <VisualState x:Name="Dragging"> <Storyboard> - <DoubleAnimation Storyboard.TargetName="LayoutRoot" - Storyboard.TargetProperty="Opacity" - To="{ThemeResource ListViewItemDragThemeOpacity}" - Duration="0" /> + <DoubleAnimation + Storyboard.TargetName="LayoutRoot" + Storyboard.TargetProperty="Opacity" + To="{ThemeResource ListViewItemDragThemeOpacity}" + Duration="0" /> <DragItemThemeAnimation TargetName="LayoutRoot" /> </Storyboard> </VisualState> @@ -720,27 +686,31 @@ <VisualState x:Name="Reordering"> <Storyboard> - <DoubleAnimation Storyboard.TargetName="LayoutRoot" - Storyboard.TargetProperty="Opacity" - To="{ThemeResource ListViewItemReorderThemeOpacity}" - Duration="0:0:0.240" /> + <DoubleAnimation + Storyboard.TargetName="LayoutRoot" + Storyboard.TargetProperty="Opacity" + To="{ThemeResource ListViewItemReorderThemeOpacity}" + Duration="0:0:0.240" /> </Storyboard> </VisualState> <VisualState x:Name="ReorderingTarget"> <Storyboard> - <DoubleAnimation Storyboard.TargetName="LayoutRoot" - Storyboard.TargetProperty="Opacity" - To="{ThemeResource ListViewItemReorderTargetThemeOpacity}" - Duration="0:0:0.240" /> - <DoubleAnimation Storyboard.TargetName="LayoutRootScale" - Storyboard.TargetProperty="ScaleX" - To="{ThemeResource ListViewItemReorderTargetThemeScale}" - Duration="0:0:0.240" /> - <DoubleAnimation Storyboard.TargetName="LayoutRootScale" - Storyboard.TargetProperty="ScaleY" - To="{ThemeResource ListViewItemReorderTargetThemeScale}" - Duration="0:0:0.240" /> + <DoubleAnimation + Storyboard.TargetName="LayoutRoot" + Storyboard.TargetProperty="Opacity" + To="{ThemeResource ListViewItemReorderTargetThemeOpacity}" + Duration="0:0:0.240" /> + <DoubleAnimation + Storyboard.TargetName="LayoutRootScale" + Storyboard.TargetProperty="ScaleX" + To="{ThemeResource ListViewItemReorderTargetThemeScale}" + Duration="0:0:0.240" /> + <DoubleAnimation + Storyboard.TargetName="LayoutRootScale" + Storyboard.TargetProperty="ScaleY" + To="{ThemeResource ListViewItemReorderTargetThemeScale}" + Duration="0:0:0.240" /> </Storyboard> </VisualState> @@ -759,8 +729,7 @@ </VisualState> <VisualStateGroup.Transitions> - <VisualTransition GeneratedDuration="0:0:0.2" - To="NotDragging" /> + <VisualTransition GeneratedDuration="0:0:0.2" To="NotDragging" /> </VisualStateGroup.Transitions> </VisualStateGroup> </VisualStateManager.VisualStateGroups> @@ -788,12 +757,11 @@ <Setter Property="UseSystemFocusVisuals" Value="True" /> <Setter Property="FocusVisualMargin" Value="0" /> <Setter Property="IsClosable" Value="False" /> - <Setter Property="SelectionIndicatorForeground" Value="{ThemeResource SetsViewSelectionIndicatorForeground}"/> + <Setter Property="SelectionIndicatorForeground" Value="{ThemeResource SetsViewSelectionIndicatorForeground}" /> <Setter Property="Template" Value="{StaticResource SetsViewItemHeaderTemplate}" /> </Style> - <Style x:Key="SetsViewItemCloseButtonStyle" - TargetType="Button"> + <Style x:Key="SetsViewItemCloseButtonStyle" TargetType="Button"> <Setter Property="Background" Value="Transparent" /> <Setter Property="BorderThickness" Value="0" /> <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseMediumHighBrush}" /> @@ -808,18 +776,18 @@ <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> - <Grid x:Name="RootGrid" - Background="{TemplateBinding Background}"> - <ContentPresenter x:Name="ContentPresenter" - Padding="{TemplateBinding Padding}" - HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" - AutomationProperties.AccessibilityView="Raw" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - Content="{TemplateBinding Content}" - ContentTemplate="{TemplateBinding ContentTemplate}" - ContentTransitions="{TemplateBinding ContentTransitions}" /> + <Grid x:Name="RootGrid" Background="{TemplateBinding Background}"> + <ContentPresenter + x:Name="ContentPresenter" + Padding="{TemplateBinding Padding}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + AutomationProperties.AccessibilityView="Raw" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Content="{TemplateBinding Content}" + ContentTemplate="{TemplateBinding ContentTemplate}" + ContentTransitions="{TemplateBinding ContentTransitions}" /> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal"> @@ -829,10 +797,8 @@ </VisualState> <VisualState x:Name="PointerOver"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" - Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ButtonPointerOverForegroundThemeBrush}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonPointerOverForegroundThemeBrush}" /> </ObjectAnimationUsingKeyFrames> <PointerUpThemeAnimation Storyboard.TargetName="RootGrid" /> </Storyboard> @@ -843,35 +809,25 @@ Storyboard.TargetProperty="Background"> <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlBackgroundBaseMediumLowBrush}" /> </ObjectAnimationUsingKeyFrames>--> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" - Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SystemControlHighlightTransparentBrush}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" - Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SystemControlHighlightBaseHighBrush}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseHighBrush}" /> </ObjectAnimationUsingKeyFrames> <PointerDownThemeAnimation Storyboard.TargetName="RootGrid" /> </Storyboard> </VisualState> <VisualState x:Name="Disabled"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SystemControlBackgroundBaseLowBrush}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlBackgroundBaseLowBrush}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" - Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" - Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SystemControlDisabledTransparentBrush}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledTransparentBrush}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> @@ -884,62 +840,75 @@ </Style> <Style x:Key="SetsViewRepeatButtonStyle" TargetType="RepeatButton"> - <Setter Property="Background" Value="{ThemeResource RepeatButtonRevealBackground}"/> - <Setter Property="BackgroundSizing" Value="OuterBorderEdge"/> - <Setter Property="Foreground" Value="{ThemeResource RepeatButtonForeground}"/> - <Setter Property="BorderBrush" Value="{ThemeResource RepeatButtonRevealBorderBrush}"/> - <Setter Property="BorderThickness" Value="{ThemeResource ButtonBorderThemeThickness}"/> - <Setter Property="Padding" Value="{StaticResource ButtonPadding}"/> - <Setter Property="HorizontalAlignment" Value="Left"/> - <Setter Property="VerticalAlignment" Value="Center"/> - <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/> - <Setter Property="FontWeight" Value="Normal"/> - <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/> - <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}"/> - <Setter Property="FocusVisualMargin" Value="-3"/> + <Setter Property="Background" Value="{ThemeResource RepeatButtonRevealBackground}" /> + <Setter Property="BackgroundSizing" Value="OuterBorderEdge" /> + <Setter Property="Foreground" Value="{ThemeResource RepeatButtonForeground}" /> + <Setter Property="BorderBrush" Value="{ThemeResource RepeatButtonRevealBorderBrush}" /> + <Setter Property="BorderThickness" Value="{ThemeResource ButtonBorderThemeThickness}" /> + <Setter Property="Padding" Value="{StaticResource ButtonPadding}" /> + <Setter Property="HorizontalAlignment" Value="Left" /> + <Setter Property="VerticalAlignment" Value="Center" /> + <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> + <Setter Property="FontWeight" Value="Normal" /> + <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> + <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> + <Setter Property="FocusVisualMargin" Value="-3" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="RepeatButton"> - <ContentPresenter x:Name="ContentPresenter" AutomationProperties.AccessibilityView="Raw" BackgroundSizing="{TemplateBinding BackgroundSizing}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" CornerRadius="{TemplateBinding CornerRadius}" ContentTransitions="{TemplateBinding ContentTransitions}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"> + <ContentPresenter + x:Name="ContentPresenter" + Padding="{TemplateBinding Padding}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + AutomationProperties.AccessibilityView="Raw" + Background="{TemplateBinding Background}" + BackgroundSizing="{TemplateBinding BackgroundSizing}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Content="{TemplateBinding Content}" + ContentTemplate="{TemplateBinding ContentTemplate}" + ContentTransitions="{TemplateBinding ContentTransitions}" + CornerRadius="{TemplateBinding CornerRadius}"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal"/> + <VisualState x:Name="Normal" /> <VisualState x:Name="PointerOver"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonBackgroundPointerOver}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonBackgroundPointerOver}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonBorderBrushPointerOver}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonBorderBrushPointerOver}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonForegroundPointerOver}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonForegroundPointerOver}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Pressed"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonBackgroundPressed}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonBackgroundPressed}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonBorderBrushPressed}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonBorderBrushPressed}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonForegroundPressed}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonForegroundPressed}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Disabled"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource HyperlinkButtonBackgroundDisabled}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource HyperlinkButtonBackgroundDisabled}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonBorderBrushDisabled}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonBorderBrushDisabled}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonForegroundDisabled}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonForegroundDisabled}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> @@ -951,8 +920,7 @@ </Setter> </Style> - <Style x:Key="SetsViewScrollViewer" - TargetType="ScrollViewer"> + <Style x:Key="SetsViewScrollViewer" TargetType="ScrollViewer"> <Setter Property="HorizontalScrollMode" Value="Auto" /> <Setter Property="VerticalScrollMode" Value="Auto" /> <Setter Property="IsHorizontalRailEnabled" Value="True" /> @@ -970,10 +938,11 @@ <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ScrollViewer"> - <Border x:Name="Root" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}"> + <Border + x:Name="Root" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> <Grid Background="{TemplateBinding Background}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> @@ -982,79 +951,80 @@ </Grid.ColumnDefinitions> <!-- Scroll to the left button bottom shadow --> - <wctc:DropShadowPanel - Style="{StaticResource BottomEdgeShadowStyle}" - Grid.Column="0"> - <Grid Height="1" Margin="-1,0,0,-1"/> + <wctc:DropShadowPanel Grid.Column="0" Style="{StaticResource BottomEdgeShadowStyle}"> + <Grid Height="1" Margin="-1,0,0,-1" /> <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="-1,-12,1024,12"></RectangleGeometry> + <RectangleGeometry Rect="-1,-12,1024,12" /> </wctc:DropShadowPanel.Clip> </wctc:DropShadowPanel> - <RepeatButton x:Name="SetsScrollBackButton" - Grid.Column="0" - VerticalAlignment="Stretch" - Background="Transparent" - BorderThickness="1" - BorderBrush ="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}" - Delay="50" - FontFamily="Segoe MDL2 Assets" - Interval="100" - Style="{ThemeResource SetsViewRepeatButtonStyle}" - Visibility="{Binding ScrollableWidth, Converter={StaticResource GreaterThanToleranceVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}, FallbackValue=Collapsed, TargetNullValue=Collapsed}"> + <RepeatButton + x:Name="SetsScrollBackButton" + Grid.Column="0" + VerticalAlignment="Stretch" + Background="Transparent" + BorderBrush="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}" + BorderThickness="1" + CornerRadius="{ThemeResource ControlCornerRadius}" + Delay="50" + FontFamily="Segoe MDL2 Assets" + Interval="100" + Style="{ThemeResource SetsViewRepeatButtonStyle}" + Visibility="{Binding ScrollableWidth, Converter={StaticResource GreaterThanToleranceVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}, FallbackValue=Collapsed, TargetNullValue=Collapsed}">  </RepeatButton> <!-- SetsItemsScrollViewer left side shadow --> - <wctc:DropShadowPanel + <wctc:DropShadowPanel x:Name="SetsItemsScrollViewerLeftSideShadow" - Style="{StaticResource SideEdgeShadowStyle}" - Grid.Column="1" - HorizontalAlignment="Left"> - <Grid Width="1"/> + Grid.Column="1" + HorizontalAlignment="Left" + Style="{StaticResource SideEdgeShadowStyle}"> + <Grid Width="1" /> <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="-10,0,10,32"></RectangleGeometry> + <RectangleGeometry Rect="-10,0,10,32" /> </wctc:DropShadowPanel.Clip> </wctc:DropShadowPanel> <!-- SetsItemsScrollViewer right side shadow --> - <wctc:DropShadowPanel + <wctc:DropShadowPanel x:Name="SetsItemsScrollViewerRightSideShadow" - Style="{StaticResource SideEdgeShadowStyle}" - Grid.Column="1" - HorizontalAlignment="Right"> - <Grid Width="1"/> + Grid.Column="1" + HorizontalAlignment="Right" + Style="{StaticResource SideEdgeShadowStyle}"> + <Grid Width="1" /> <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="1,0,10,32"></RectangleGeometry> + <RectangleGeometry Rect="1,0,10,32" /> </wctc:DropShadowPanel.Clip> </wctc:DropShadowPanel> - <ScrollContentPresenter x:Name="ScrollContentPresenter" - Grid.Column="1" - TabFocusNavigation="Once" - Margin="{TemplateBinding Padding}"/> + <ScrollContentPresenter + x:Name="ScrollContentPresenter" + Grid.Column="1" + Margin="{TemplateBinding Padding}" + TabFocusNavigation="Once" /> <!-- Scroll to the right button bottom shadow --> - <wctc:DropShadowPanel - Style="{StaticResource BottomEdgeShadowStyle}" - Grid.Column="2"> - <Grid Height="1" Margin="0,0,0,-1"/> + <wctc:DropShadowPanel Grid.Column="2" Style="{StaticResource BottomEdgeShadowStyle}"> + <Grid Height="1" Margin="0,0,0,-1" /> <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="0,-12,1024,12"></RectangleGeometry> + <RectangleGeometry Rect="0,-12,1024,12" /> </wctc:DropShadowPanel.Clip> </wctc:DropShadowPanel> - <RepeatButton x:Name="SetsScrollForwardButton" - Grid.Column="2" - VerticalAlignment="Stretch" - Background="Transparent" - BorderThickness="1" - BorderBrush ="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}" - Delay="50" - FontFamily="Segoe MDL2 Assets" - Interval="100" - Style="{ThemeResource SetsViewRepeatButtonStyle}" - Visibility="{Binding ScrollableWidth, Converter={StaticResource GreaterThanToleranceVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}, FallbackValue=Collapsed, TargetNullValue=Collapsed}"> + <RepeatButton + x:Name="SetsScrollForwardButton" + Grid.Column="2" + VerticalAlignment="Stretch" + Background="Transparent" + BorderBrush="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}" + BorderThickness="1" + CornerRadius="{ThemeResource ControlCornerRadius}" + Delay="50" + FontFamily="Segoe MDL2 Assets" + Interval="100" + Style="{ThemeResource SetsViewRepeatButtonStyle}" + Visibility="{Binding ScrollableWidth, Converter={StaticResource GreaterThanToleranceVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}, FallbackValue=Collapsed, TargetNullValue=Collapsed}">  </RepeatButton> </Grid> diff --git a/src/Notepads.Controls/Themes/Generic.xaml b/src/Notepads.Controls/Themes/Generic.xaml index 1ba9ebdb2..e5e06df08 100644 --- a/src/Notepads.Controls/Themes/Generic.xaml +++ b/src/Notepads.Controls/Themes/Generic.xaml @@ -1,6 +1,7 @@ <ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="using:Notepads.Controls"> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="ms-appx:///Notepads.Controls/SetsView/SetsView.xaml" /> </ResourceDictionary.MergedDictionaries> diff --git a/src/Notepads/App.xaml b/src/Notepads/App.xaml index b3d22184e..525a2d131 100644 --- a/src/Notepads/App.xaml +++ b/src/Notepads/App.xaml @@ -23,50 +23,32 @@ <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" /> <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/CustomNavigationViewStyle.xaml"></ResourceDictionary> - <ResourceDictionary Source="Resource/CustomAppBarButtonStyle.xaml"></ResourceDictionary> - <ResourceDictionary Source="Resource/CustomFlyoutItemStyle.xaml"></ResourceDictionary> + <ResourceDictionary Source="Controls/FindAndReplace/FindAndReplacePlaceholder.xaml" /> + <ResourceDictionary Source="Resource/DismissButtonStyle.xaml" /> + <ResourceDictionary Source="Resource/TransparentTextBoxStyle.xaml" /> + <ResourceDictionary Source="Resource/CustomSplitViewStyle.xaml" /> + <ResourceDictionary Source="Resource/InAppNotificationNoDismissButton.xaml" /> + <ResourceDictionary Source="Resource/CustomSliderStyle.xaml" /> + <ResourceDictionary Source="Resource/CustomRadioButtonStyle.xaml" /> + <ResourceDictionary Source="Resource/CustomToggleSwitchStyle.xaml" /> + <ResourceDictionary Source="Resource/CustomNavigationViewStyle.xaml" /> + <ResourceDictionary Source="Resource/CustomAppBarButtonStyle.xaml" /> + <ResourceDictionary Source="Resource/CustomFlyoutItemStyle.xaml" /> </ResourceDictionary.MergedDictionaries> - <Style x:Key="CompactSubtitleTextBlockStyle" TargetType="TextBlock" BasedOn="{StaticResource SubtitleTextBlockStyle}"> - <Setter Property="FontSize" Value="18"/> + <Style + x:Key="CompactSubtitleTextBlockStyle" + BasedOn="{StaticResource SubtitleTextBlockStyle}" + TargetType="TextBlock"> + <Setter Property="FontSize" Value="18" /> </Style> - <Style x:Key="DescriptionTextBlockStyle" TargetType="TextBlock" BasedOn="{StaticResource CaptionTextBlockStyle}"> - <Setter Property="Foreground" Value="{ThemeResource SystemBaseMediumHighColor}"/> + <Style + x:Key="DescriptionTextBlockStyle" + BasedOn="{StaticResource CaptionTextBlockStyle}" + TargetType="TextBlock"> + <Setter Property="Foreground" Value="{ThemeResource SystemBaseMediumHighColor}" /> </Style> - - <!-- TODO: Remove these styles --> - <Style TargetType="MenuFlyoutPresenter"> - <Setter Property="CornerRadius" Value="0" /> - </Style> - <Style TargetType="FlyoutPresenter"> - <Setter Property="CornerRadius" Value="0" /> - </Style> - <Style x:Key="ButtonRevealStyle" TargetType="Button" BasedOn="{StaticResource ButtonRevealStyle}"> - <Setter Property="CornerRadius" Value="0" /> - </Style> - <Style TargetType="ComboBox"> - <Setter Property="CornerRadius" Value="0" /> - </Style> - <Style TargetType="muxc:ColorPicker"> - <Setter Property="CornerRadius" Value="0" /> - </Style> - <Style TargetType="TextBox"> - <Setter Property="CornerRadius" Value="0" /> - </Style> - <Style TargetType="ToolTip"> - <Setter Property="CornerRadius" Value="0" /> - </Style> - </ResourceDictionary> </Application.Resources> </Application> \ No newline at end of file diff --git a/src/Notepads/Controls/Dialog/FileRenameDialog.cs b/src/Notepads/Controls/Dialog/FileRenameDialog.cs index d31294e09..c2d6b0034 100644 --- a/src/Notepads/Controls/Dialog/FileRenameDialog.cs +++ b/src/Notepads/Controls/Dialog/FileRenameDialog.cs @@ -31,15 +31,12 @@ public FileRenameDialog(string filename, bool fileExists, Action<string> confirm _fileNameTextBox = new TextBox { - Style = (Style)Application.Current.Resources["TransparentTextBoxStyle"], Text = filename, IsSpellCheckEnabled = false, AcceptsReturn = false, SelectionStart = 0, SelectionLength = filename.Contains(".") ? filename.LastIndexOf(".", StringComparison.Ordinal) : filename.Length, - Height = 35, - // TODO: Uncomment to apply CornerRadius - //CornerRadius = (CornerRadius)Application.Current.Resources["ControlCornerRadius"] + Height = 35 }; _errorMessageTextBlock = new TextBlock() diff --git a/src/Notepads/Controls/Dialog/NotepadsDialog.cs b/src/Notepads/Controls/Dialog/NotepadsDialog.cs index 2bf42e848..fa438e43e 100644 --- a/src/Notepads/Controls/Dialog/NotepadsDialog.cs +++ b/src/Notepads/Controls/Dialog/NotepadsDialog.cs @@ -17,8 +17,7 @@ public class NotepadsDialog : ContentDialog public NotepadsDialog() { - // TODO: Uncomment to apply CornerRadius - //CornerRadius = (CornerRadius)Application.Current.Resources["OverlayCornerRadius"]; + CornerRadius = (CornerRadius)Application.Current.Resources["OverlayCornerRadius"]; PrimaryButtonStyle = GetButtonStyle(); SecondaryButtonStyle = GetButtonStyle(); CloseButtonStyle = GetButtonStyle(); @@ -43,9 +42,10 @@ private void NotepadsDialog_ActualThemeChanged(FrameworkElement sender, object a internal static Style GetButtonStyle() { var buttonStyle = new Style(typeof(Button)); - // TODO: Uncomment to apply CornerRadius - //buttonStyle.Setters.Add(new Setter(Control.CornerRadiusProperty, - // (CornerRadius)Application.Current.Resources["ControlCornerRadius"])); + buttonStyle.Setters.Add( + new Setter( + Control.CornerRadiusProperty, + (CornerRadius)Application.Current.Resources["ControlCornerRadius"])); return buttonStyle; } diff --git a/src/Notepads/Controls/DiffViewer/SideBySideDiffViewer.xaml b/src/Notepads/Controls/DiffViewer/SideBySideDiffViewer.xaml index 75cdd1464..b6509d9c3 100644 --- a/src/Notepads/Controls/DiffViewer/SideBySideDiffViewer.xaml +++ b/src/Notepads/Controls/DiffViewer/SideBySideDiffViewer.xaml @@ -4,33 +4,35 @@ 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" - mc:Ignorable="d" - Background="{ThemeResource SystemControlForegroundTransparentBrush}"> + Background="{ThemeResource SystemControlForegroundTransparentBrush}" + mc:Ignorable="d"> <UserControl.Resources> <ResourceDictionary> <ResourceDictionary.ThemeDictionaries> <ResourceDictionary x:Key="Light"> - <SolidColorBrush x:Key="RightBoxBackgroundThemeBrush" - Opacity="0.25" - Color="White"/> - <SolidColorBrush x:Key="HeaderBackgroundThemeBrush" - Opacity="0.35" - Color="LightGray"/> + <SolidColorBrush + x:Key="RightBoxBackgroundThemeBrush" + Opacity="0.25" + Color="White" /> + <SolidColorBrush + x:Key="HeaderBackgroundThemeBrush" + Opacity="0.35" + Color="LightGray" /> </ResourceDictionary> <ResourceDictionary x:Key="Dark"> - <SolidColorBrush x:Key="RightBoxBackgroundThemeBrush" - Opacity="0.15" - Color="Black"/> - <SolidColorBrush x:Key="HeaderBackgroundThemeBrush" - Opacity="0.2" - Color="Black"/> + <SolidColorBrush + x:Key="RightBoxBackgroundThemeBrush" + Opacity="0.15" + Color="Black" /> + <SolidColorBrush + x:Key="HeaderBackgroundThemeBrush" + Opacity="0.2" + Color="Black" /> </ResourceDictionary> <ResourceDictionary x:Key="HighContrast"> - <SolidColorBrush x:Key="RightBoxBackgroundThemeBrush" - Color="{ThemeResource SystemColorHighlightColor}"/> - <SolidColorBrush x:Key="HeaderBackgroundThemeBrush" - Color="{ThemeResource SystemColorHighlightColor}"/> + <SolidColorBrush x:Key="RightBoxBackgroundThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" /> + <SolidColorBrush x:Key="HeaderBackgroundThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" /> </ResourceDictionary> </ResourceDictionary.ThemeDictionaries> </ResourceDictionary> @@ -38,79 +40,80 @@ </UserControl.Resources> <Grid x:Name="LayoutRoot"> <Grid.ColumnDefinitions> - <ColumnDefinition Width="*"/> - <ColumnDefinition Width="*"/> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid Column="0"> <Grid.RowDefinitions> - <RowDefinition Height="25"/> - <RowDefinition Height="*"/> + <RowDefinition Height="25" /> + <RowDefinition Height="*" /> </Grid.RowDefinitions> - <Grid Row="0" Background="{ThemeResource HeaderBackgroundThemeBrush}"> - <TextBlock Grid.Row="0" - x:Uid="DiffViewer_Header_OldTextTittle" - FontStyle="Italic" - HorizontalAlignment="Center" - VerticalAlignment="Center"> - </TextBlock> - <Button x:Name="DismissButton" - VerticalAlignment="Center" - HorizontalAlignment="Left" - IsTabStop="False" - Padding="0" - Height="25" - Width="32" - FontSize="12" - Style="{StaticResource DismissButtonStyle}" - Content="" - FontFamily="Segoe MDL2 Assets"> + <Grid Background="{ThemeResource HeaderBackgroundThemeBrush}" Row="0"> + <TextBlock + x:Uid="DiffViewer_Header_OldTextTittle" + Grid.Row="0" + HorizontalAlignment="Center" + VerticalAlignment="Center" + FontStyle="Italic" /> + <Button + x:Name="DismissButton" + Width="32" + Height="25" + Padding="0" + HorizontalAlignment="Left" + VerticalAlignment="Center" + Content="" + FontFamily="Segoe MDL2 Assets" + FontSize="12" + IsTabStop="False" + Style="{StaticResource DismissButtonStyle}"> <Button.KeyboardAccelerators> - <KeyboardAccelerator Key="Escape"/> + <KeyboardAccelerator Key="Escape" /> </Button.KeyboardAccelerators> </Button> </Grid> - <ScrollViewer Name="LeftScroller" - Grid.Row="1" - IsTabStop="False" - Padding="6, 0, 8, 6" - HorizontalScrollBarVisibility="Hidden" - VerticalScrollBarVisibility="Hidden"> + <ScrollViewer + Name="LeftScroller" + Grid.Row="1" + Padding="6,0,8,6" + HorizontalScrollBarVisibility="Hidden" + IsTabStop="False" + VerticalScrollBarVisibility="Hidden"> <Border Name="LeftTextBlockBorder" Background="Transparent"> - <RichTextBlock Name="LeftTextBlock" - FontFamily="Consolas"/> + <RichTextBlock Name="LeftTextBlock" FontFamily="Consolas" /> </Border> </ScrollViewer> </Grid> - <Grid Column="1" Background="{ThemeResource RightBoxBackgroundThemeBrush}"> + <Grid Background="{ThemeResource RightBoxBackgroundThemeBrush}" Column="1"> <Grid.RowDefinitions> - <RowDefinition Height="25"/> - <RowDefinition Height="*"/> + <RowDefinition Height="25" /> + <RowDefinition Height="*" /> </Grid.RowDefinitions> - <Grid Row="0" Background="{ThemeResource HeaderBackgroundThemeBrush}"> - <TextBlock Grid.Row="0" - x:Uid="DiffViewer_Header_NewTextTittle" - FontStyle="Italic" - HorizontalAlignment="Center" - VerticalAlignment="Center"> - </TextBlock> + <Grid Background="{ThemeResource HeaderBackgroundThemeBrush}" Row="0"> + <TextBlock + x:Uid="DiffViewer_Header_NewTextTittle" + Grid.Row="0" + HorizontalAlignment="Center" + VerticalAlignment="Center" + FontStyle="Italic" /> </Grid> - <ScrollViewer Name="RightScroller" - Grid.Row="1" - IsTabStop="False" - Padding="6, 0, 8, 6" - HorizontalScrollBarVisibility="Auto" - VerticalScrollBarVisibility="Auto"> + <ScrollViewer + Name="RightScroller" + Grid.Row="1" + Padding="6,0,8,6" + HorizontalScrollBarVisibility="Auto" + IsTabStop="False" + VerticalScrollBarVisibility="Auto"> <Border Name="RightTextBlockBorder" Background="Transparent"> - <RichTextBlock Name="RightTextBlock" - FontFamily="Consolas"/> + <RichTextBlock Name="RightTextBlock" FontFamily="Consolas" /> </Border> </ScrollViewer> </Grid> diff --git a/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml b/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml index 4b0359d0e..cf158b669 100644 --- a/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml +++ b/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml @@ -3,11 +3,11 @@ 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" xmlns:findAndReplace="using:Notepads.Controls.FindAndReplace" - mc:Ignorable="d" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="72" - d:DesignWidth="250"> + d:DesignWidth="250" + mc:Ignorable="d"> <Grid x:Name="FindAndReplaceRootGrid" KeyDown="FindAndReplaceRootGrid_KeyDown"> <Grid.ColumnDefinitions> @@ -21,79 +21,95 @@ <RowDefinition Height="Auto" /> </Grid.RowDefinitions> - <Grid Grid.Row="0" Grid.Column="0" Padding="1, 1, 1, 1" Height="36" x:Name="ToggleReplaceModeButtonGrid"> - <Button x:Name="ToggleReplaceModeButton" - x:Uid="FindAndReplace_ToggleReplaceModeButton" - Grid.Column="0" - IsTabStop="False" - Width="20" - Padding="0" - FontSize="12" - Style="{StaticResource DismissButtonStyle}" - Content="" - FontFamily="Segoe MDL2 Assets" - Click="ToggleReplaceModeButton_OnClick"> - </Button> + <Grid + x:Name="ToggleReplaceModeButtonGrid" + Grid.Row="0" + Grid.Column="0" + Height="36" + Padding="1,1,1,1"> + <Button + x:Name="ToggleReplaceModeButton" + x:Uid="FindAndReplace_ToggleReplaceModeButton" + Grid.Column="0" + Width="20" + Padding="0" + Click="ToggleReplaceModeButton_OnClick" + Content="" + FontFamily="Segoe MDL2 Assets" + FontSize="12" + IsTabStop="False" + Style="{StaticResource DismissButtonStyle}" /> </Grid> - <RelativePanel Grid.Row="0" Grid.Column="1" Padding="1, 1, 1, 1" Height="36" x:Name="FindBarPlaceHolder"> + <RelativePanel + x:Name="FindBarPlaceHolder" + Grid.Row="0" + Grid.Column="1" + Height="36" + Padding="1,1,1,1"> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <findAndReplace:FindAndReplaceTextBox x:Name="FindBar" - x:Uid="FindAndReplace_FindBar" - Style="{StaticResource TransparentTextBoxStyle}" - Foreground="{ThemeResource SystemControlHighlightChromeAltLowBrush}" - RelativePanel.AlignLeftWithPanel="True" - RelativePanel.AlignRightWithPanel="True" - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch" - Padding="10,3,32,6" - IsSpellCheckEnabled="False" - TextAlignment="Left" - BorderThickness="0" - FontSize="15" - CornerRadius="0" - TextChanged="FindBar_OnTextChanged" - KeyDown="FindBar_OnKeyDown" - GotFocus="FindBar_GotFocus" - LostFocus="FindBar_LostFocus"/> + <findAndReplace:FindAndReplaceTextBox + x:Name="FindBar" + x:Uid="FindAndReplace_FindBar" + Padding="10,3,32,6" + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + BorderThickness="0" + FontSize="15" + Foreground="{ThemeResource SystemControlHighlightChromeAltLowBrush}" + GotFocus="FindBar_GotFocus" + IsSpellCheckEnabled="False" + KeyDown="FindBar_OnKeyDown" + LostFocus="FindBar_LostFocus" + RelativePanel.AlignLeftWithPanel="True" + RelativePanel.AlignRightWithPanel="True" + TextAlignment="Left" + TextChanged="FindBar_OnTextChanged" /> - <Grid RelativePanel.AlignRightWithPanel="True" x:Name="OptionButtonGrid" Background="Transparent"> - <Border x:Name="OptionButtonSelectionIndicator" - BorderBrush="{StaticResource SystemControlBackgroundAccentBrush}" - VerticalAlignment="Bottom" - BorderThickness="1" - Margin="9" - Visibility="Collapsed"/> - <Button x:Name="OptionButton" - x:Uid="FindAndReplace_SearchOptionButton" - IsTabStop="False" - Width="36" - FontSize="16" - Style="{StaticResource DismissButtonStyle}" - Content="" - FontFamily="Segoe MDL2 Assets"> + <Grid + x:Name="OptionButtonGrid" + Background="Transparent" + RelativePanel.AlignRightWithPanel="True"> + <Border + x:Name="OptionButtonSelectionIndicator" + Margin="9" + VerticalAlignment="Bottom" + BorderBrush="{StaticResource SystemControlBackgroundAccentBrush}" + BorderThickness="1" + Visibility="Collapsed" /> + <Button + x:Name="OptionButton" + x:Uid="FindAndReplace_SearchOptionButton" + Width="36" + Content="" + FontFamily="Segoe MDL2 Assets" + FontSize="16" + IsTabStop="False" + Style="{StaticResource DismissButtonStyle}"> <Button.Flyout> <MenuFlyout Placement="BottomEdgeAlignedRight"> - <ToggleMenuFlyoutItem x:Uid="FindAndReplace_SearchOptionToggleButton_MatchCase" - x:Name="MatchCaseToggle" - Click="OptionButtonFlyoutItem_OnClick"> + <ToggleMenuFlyoutItem + x:Name="MatchCaseToggle" + x:Uid="FindAndReplace_SearchOptionToggleButton_MatchCase" + Click="OptionButtonFlyoutItem_OnClick"> <ToggleMenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Modifiers="Menu" Key="C" /> + <KeyboardAccelerator Key="C" Modifiers="Menu" /> </ToggleMenuFlyoutItem.KeyboardAccelerators> </ToggleMenuFlyoutItem> - <ToggleMenuFlyoutItem x:Uid="FindAndReplace_SearchOptionToggleButton_MatchWholeWord" - x:Name="MatchWholeWordToggle" - Click="OptionButtonFlyoutItem_OnClick"> + <ToggleMenuFlyoutItem + x:Name="MatchWholeWordToggle" + x:Uid="FindAndReplace_SearchOptionToggleButton_MatchWholeWord" + Click="OptionButtonFlyoutItem_OnClick"> <ToggleMenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Modifiers="Menu" Key="W" /> + <KeyboardAccelerator Key="W" Modifiers="Menu" /> </ToggleMenuFlyoutItem.KeyboardAccelerators> </ToggleMenuFlyoutItem> - <ToggleMenuFlyoutItem x:Uid="FindAndReplace_SearchOptionToggleButton_UseRegex" - x:Name="UseRegexToggle" - Click="OptionButtonFlyoutItem_OnClick"> + <ToggleMenuFlyoutItem + x:Name="UseRegexToggle" + x:Uid="FindAndReplace_SearchOptionToggleButton_UseRegex" + Click="OptionButtonFlyoutItem_OnClick"> <ToggleMenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Modifiers="Menu" Key="E" /> + <KeyboardAccelerator Key="E" Modifiers="Menu" /> </ToggleMenuFlyoutItem.KeyboardAccelerators> </ToggleMenuFlyoutItem> </MenuFlyout> @@ -102,113 +118,129 @@ </Grid> </RelativePanel> - <Grid Grid.Row="1" Grid.Column="1" Padding="1, 1, 1, 1" Height="36" x:Name="ReplaceBarPlaceHolder"> + <Grid + x:Name="ReplaceBarPlaceHolder" + Grid.Row="1" + Grid.Column="1" + Height="36" + Padding="1,1,1,1"> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <findAndReplace:FindAndReplaceTextBox x:Name="ReplaceBar" - x:Uid="FindAndReplace_ReplaceBar" - Style="{StaticResource TransparentTextBoxStyle}" - Foreground="{ThemeResource SystemControlHighlightChromeAltLowBrush}" - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch" - IsSpellCheckEnabled="False" - TextAlignment="Left" - BorderThickness="0" - FontSize="15" - CornerRadius="0" - TextChanged="ReplaceBar_OnTextChanged" - KeyDown="ReplaceBar_OnKeyDown" - GotFocus="ReplaceBar_GotFocus" - LostFocus="ReplaceBar_LostFocus" /> + <findAndReplace:FindAndReplaceTextBox + x:Name="ReplaceBar" + x:Uid="FindAndReplace_ReplaceBar" + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + BorderThickness="0" + FontSize="15" + Foreground="{ThemeResource SystemControlHighlightChromeAltLowBrush}" + GotFocus="ReplaceBar_GotFocus" + IsSpellCheckEnabled="False" + KeyDown="ReplaceBar_OnKeyDown" + LostFocus="ReplaceBar_LostFocus" + TextAlignment="Left" + TextChanged="ReplaceBar_OnTextChanged" /> </Grid> - <Grid Grid.Row="0" Grid.Column="2" Padding="1, 1, 1, 1" Height="36"> + <Grid + Grid.Row="0" + Grid.Column="2" + Height="36" + Padding="1,1,1,1"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> - <Button x:Name="SearchBackwardButton" - x:Uid="FindAndReplace_SearchBackwardButton" - Width="36" - Grid.Column="0" - IsEnabled="False" - IsTabStop="False" - FontSize="16" - Style="{StaticResource DismissButtonStyle}" - Content="" - FontFamily="Segoe MDL2 Assets" - Click="SearchBackwardButton_OnClick"> + <Button + x:Name="SearchBackwardButton" + x:Uid="FindAndReplace_SearchBackwardButton" + Grid.Column="0" + Width="36" + Click="SearchBackwardButton_OnClick" + Content="" + FontFamily="Segoe MDL2 Assets" + FontSize="16" + IsEnabled="False" + IsTabStop="False" + Style="{StaticResource DismissButtonStyle}"> <Button.KeyboardAccelerators> - <KeyboardAccelerator Modifiers="Shift" Key="F3" /> + <KeyboardAccelerator Key="F3" Modifiers="Shift" /> </Button.KeyboardAccelerators> </Button> - <Button x:Name="SearchForwardButton" - x:Uid="FindAndReplace_SearchForwardButton" - Width="36" - Grid.Column="1" - IsEnabled="False" - IsTabStop="False" - FontSize="16" - Style="{StaticResource DismissButtonStyle}" - Content="" - FontFamily="Segoe MDL2 Assets" - Click="SearchForwardButton_OnClick"> + <Button + x:Name="SearchForwardButton" + x:Uid="FindAndReplace_SearchForwardButton" + Grid.Column="1" + Width="36" + Click="SearchForwardButton_OnClick" + Content="" + FontFamily="Segoe MDL2 Assets" + FontSize="16" + IsEnabled="False" + IsTabStop="False" + Style="{StaticResource DismissButtonStyle}"> <Button.KeyboardAccelerators> <KeyboardAccelerator Key="F3" /> </Button.KeyboardAccelerators> </Button> - <Button x:Name="DismissButton" - x:Uid="FindAndReplace_DismissButton" - IsTabStop="False" - Width="36" - Grid.Column="2" - FontSize="16" - Style="{StaticResource DismissButtonStyle}" - Content="" - FontFamily="Segoe MDL2 Assets" - Click="DismissButton_OnClick" /> + <Button + x:Name="DismissButton" + x:Uid="FindAndReplace_DismissButton" + Grid.Column="2" + Width="36" + Click="DismissButton_OnClick" + Content="" + FontFamily="Segoe MDL2 Assets" + FontSize="16" + IsTabStop="False" + Style="{StaticResource DismissButtonStyle}" /> </Grid> - <Grid Grid.Row="1" Grid.Column="2" Padding="1, 1, 1, 1" Height="36"> + <Grid + Grid.Row="1" + Grid.Column="2" + Height="36" + Padding="1,1,1,1"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> - <Button x:Name="ReplaceButton" - x:Uid="FindAndReplace_ReplaceButton" - IsEnabled="False" - IsTabStop="False" - Width="36" - Grid.Column="0" - FontSize="16" - Style="{StaticResource DismissButtonStyle}" - Content="" - FontFamily="Segoe MDL2 Assets" - Click="ReplaceButton_OnClick"> + <Button + x:Name="ReplaceButton" + x:Uid="FindAndReplace_ReplaceButton" + Grid.Column="0" + Width="36" + Click="ReplaceButton_OnClick" + Content="" + FontFamily="Segoe MDL2 Assets" + FontSize="16" + IsEnabled="False" + IsTabStop="False" + Style="{StaticResource DismissButtonStyle}"> <Button.KeyboardAccelerators> - <KeyboardAccelerator Modifiers="Menu" Key="R" /> + <KeyboardAccelerator Key="R" Modifiers="Menu" /> </Button.KeyboardAccelerators> </Button> - <Button x:Name="ReplaceAllButton" - x:Uid="FindAndReplace_ReplaceAllButton" - IsEnabled="False" - IsTabStop="False" - Width="36" - Grid.Column="1" - FontSize="16" - Style="{StaticResource DismissButtonStyle}" - Content="" - FontFamily="Segoe MDL2 Assets" - Click="ReplaceAllButton_OnClick"> + <Button + x:Name="ReplaceAllButton" + x:Uid="FindAndReplace_ReplaceAllButton" + Grid.Column="1" + Width="36" + Click="ReplaceAllButton_OnClick" + Content="" + FontFamily="Segoe MDL2 Assets" + FontSize="16" + IsEnabled="False" + IsTabStop="False" + Style="{StaticResource DismissButtonStyle}"> <Button.KeyboardAccelerators> - <KeyboardAccelerator Modifiers="Control,Menu" Key="Enter" /> + <KeyboardAccelerator Key="Enter" Modifiers="Control,Menu" /> </Button.KeyboardAccelerators> </Button> </Grid> diff --git a/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml b/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml index 837f30a9f..54d01c75e 100644 --- a/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml +++ b/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml @@ -1,5 +1,5 @@ <ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls"> <Style x:Key="FindAndReplacePlaceholder" TargetType="wctc:InAppNotification"> @@ -9,33 +9,62 @@ <Setter.Value> <ControlTemplate> <Grid> + <Grid + x:Name="RootGrid" + Height="{TemplateBinding Height}" + MaxWidth="{TemplateBinding MaxWidth}" + Margin="{TemplateBinding Margin}" + RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}" + Visibility="{TemplateBinding Visibility}"> + <Grid.RenderTransform> + <CompositeTransform /> + </Grid.RenderTransform> + + <wctc:DropShadowPanel + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch" + BlurRadius="10" + IsMasked="True" + OffsetX="0" + OffsetY="0" + ShadowOpacity="0.25"> + <Grid + Padding="{TemplateBinding Padding}" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{ThemeResource OverlayCornerRadius}"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + + <ContentPresenter + x:Name="PART_Presenter" + HorizontalAlignment="{TemplateBinding HorizontalAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Center" + TextWrapping="WrapWholeWords" /> + </Grid> + </wctc:DropShadowPanel> + </Grid> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="State"> <VisualState x:Name="Collapsed"> <Storyboard> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> - <EasingDoubleKeyFrame KeyTime="0" - Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" - Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> + <EasingDoubleKeyFrame KeyTime="0" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> - <EasingDoubleKeyFrame KeyTime="0" - Value="20" /> - <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" - Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> + <EasingDoubleKeyFrame KeyTime="0" Value="20" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.Opacity)"> - <EasingDoubleKeyFrame KeyTime="0" - Value="1" /> - <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" - Value="0" /> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.Opacity)"> + <EasingDoubleKeyFrame KeyTime="0" Value="1" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" /> </DoubleAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.Visibility)"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.Visibility)"> <DiscreteObjectKeyFrame KeyTime="0"> <DiscreteObjectKeyFrame.Value> <Visibility>Visible</Visibility> @@ -51,70 +80,25 @@ </VisualState> <VisualState x:Name="Visible"> <Storyboard> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> - <EasingDoubleKeyFrame KeyTime="0" - Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" - Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> + <EasingDoubleKeyFrame KeyTime="0" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> - <EasingDoubleKeyFrame KeyTime="0" - Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" - Value="20" /> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> + <EasingDoubleKeyFrame KeyTime="0" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="20" /> </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.Opacity)"> - <EasingDoubleKeyFrame KeyTime="0" - Value="0" /> - <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" - Value="1" /> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.Opacity)"> + <EasingDoubleKeyFrame KeyTime="0" Value="0" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="1" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> - - <Grid x:Name="RootGrid" - RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}" - Margin="{TemplateBinding Margin}" - MaxWidth="{TemplateBinding MaxWidth}" - Visibility="{TemplateBinding Visibility}" - Height="{TemplateBinding Height}"> - <Grid.RenderTransform> - <CompositeTransform /> - </Grid.RenderTransform> - - <wctc:DropShadowPanel BlurRadius="10" - ShadowOpacity="0.25" - OffsetX="0" - OffsetY="0" - HorizontalContentAlignment="Stretch" - VerticalContentAlignment="Stretch" - IsMasked="True"> - <Grid Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - Padding="{TemplateBinding Padding}" - CornerRadius="{TemplateBinding CornerRadius}"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - - <ContentPresenter x:Name="PART_Presenter" - HorizontalAlignment="{TemplateBinding HorizontalAlignment}" - HorizontalContentAlignment="Stretch" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - VerticalContentAlignment="Center" - TextWrapping="WrapWholeWords" /> - </Grid> - </wctc:DropShadowPanel> - </Grid> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> -</ResourceDictionary> +</ResourceDictionary> \ No newline at end of file diff --git a/src/Notepads/Controls/GoTo/GoToControl.xaml b/src/Notepads/Controls/GoTo/GoToControl.xaml index 6782cc8f9..8d3f4aa4d 100644 --- a/src/Notepads/Controls/GoTo/GoToControl.xaml +++ b/src/Notepads/Controls/GoTo/GoToControl.xaml @@ -4,11 +4,16 @@ 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" - mc:Ignorable="d" - d:DesignWidth="250" Height="36"> + Height="36" + d:DesignWidth="250" + mc:Ignorable="d"> + + <Grid + x:Name="GoToRootGrid" + Height="36" + Padding="1,1,1,1" + KeyDown="GoToRootGrid_KeyDown"> - <Grid Padding="1, 1, 1, 1" Height="36" x:Name="GoToRootGrid" KeyDown="GoToRootGrid_KeyDown"> - <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> @@ -16,51 +21,55 @@ <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> - <TextBlock Grid.Column="0" x:Uid="GoTo_GoToBarLabel" Margin="5,0,8,3" FontSize="15" VerticalAlignment="Center" TextAlignment="Center"/> + <TextBlock + x:Uid="GoTo_GoToBarLabel" + Grid.Column="0" + Margin="5,0,8,3" + VerticalAlignment="Center" + FontSize="15" + TextAlignment="Center" /> <Grid Grid.Column="1"> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <TextBox x:Name="GoToBar" - x:Uid="GoTo_GoToBar" - Style="{StaticResource TransparentTextBoxStyle}" - Foreground="{ThemeResource SystemControlHighlightChromeAltLowBrush}" - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch" - IsSpellCheckEnabled="False" - TextAlignment="Left" - BorderThickness="0" - FontSize="15" - CornerRadius="0" - BeforeTextChanging="GoToBar_BeforeTextChanging" - TextChanged="GoToBar_OnTextChanged" - KeyDown="GoToBar_OnKeyDown" - GotFocus="GoToBar_GotFocus" - LostFocus="GoToBar_LostFocus"/> + <TextBox + x:Name="GoToBar" + x:Uid="GoTo_GoToBar" + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + BeforeTextChanging="GoToBar_BeforeTextChanging" + BorderThickness="0" + FontSize="15" + Foreground="{ThemeResource SystemControlHighlightChromeAltLowBrush}" + GotFocus="GoToBar_GotFocus" + IsSpellCheckEnabled="False" + KeyDown="GoToBar_OnKeyDown" + LostFocus="GoToBar_LostFocus" + TextAlignment="Left" + TextChanged="GoToBar_OnTextChanged" /> </Grid> - <Button x:Name="SearchButton" - x:Uid="GoTo_SearchButton" - Width="36" - Grid.Column="2" - Visibility="Collapsed" - IsTabStop="False" - FontSize="16" - Style="{StaticResource DismissButtonStyle}" - Content="" - FontFamily="Segoe MDL2 Assets" - Click="SearchButton_OnClick"> - </Button> + <Button + x:Name="SearchButton" + x:Uid="GoTo_SearchButton" + Grid.Column="2" + Width="36" + Click="SearchButton_OnClick" + Content="" + FontFamily="Segoe MDL2 Assets" + FontSize="16" + IsTabStop="False" + Style="{StaticResource DismissButtonStyle}" + Visibility="Collapsed" /> - <Button x:Name="DismissButton" - x:Uid="FindAndReplace_DismissButton" - IsTabStop="False" - Width="36" - Grid.Column="3" - FontSize="16" - Style="{StaticResource DismissButtonStyle}" - Content="" - FontFamily="Segoe MDL2 Assets" - Click="DismissButton_OnClick" > - </Button> + <Button + x:Name="DismissButton" + x:Uid="FindAndReplace_DismissButton" + Grid.Column="3" + Width="36" + Click="DismissButton_OnClick" + Content="" + FontFamily="Segoe MDL2 Assets" + FontSize="16" + IsTabStop="False" + Style="{StaticResource DismissButtonStyle}" /> </Grid> </UserControl> diff --git a/src/Notepads/Controls/Markdown/MarkdownExtensionView.xaml b/src/Notepads/Controls/Markdown/MarkdownExtensionView.xaml index e6372efb0..bb62ef709 100644 --- a/src/Notepads/Controls/Markdown/MarkdownExtensionView.xaml +++ b/src/Notepads/Controls/Markdown/MarkdownExtensionView.xaml @@ -5,23 +5,25 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls" - mc:Ignorable="d" - Background="{ThemeResource SystemControlForegroundTransparentBrush}"> + Background="{ThemeResource SystemControlForegroundTransparentBrush}" + mc:Ignorable="d"> <Grid> - <ScrollViewer x:Name="MarkdownScrollViewer" - Margin="0" - Padding="8" - BorderBrush="Transparent" - BorderThickness="0" - HorizontalScrollBarVisibility="Auto" - VerticalScrollBarVisibility="Auto"> - <wctc:MarkdownTextBlock x:Name="MarkdownTextBlock" - Margin="0" - Padding="0" - Background="Transparent" - Header1Foreground="{StaticResource SystemControlForegroundAccentBrush}" - LinkForeground="{StaticResource SystemControlForegroundAccentBrush}"/> + <ScrollViewer + x:Name="MarkdownScrollViewer" + Margin="0" + Padding="8" + BorderBrush="Transparent" + BorderThickness="0" + HorizontalScrollBarVisibility="Auto" + VerticalScrollBarVisibility="Auto"> + <wctc:MarkdownTextBlock + x:Name="MarkdownTextBlock" + Margin="0" + Padding="0" + Background="Transparent" + Header1Foreground="{StaticResource SystemControlForegroundAccentBrush}" + LinkForeground="{StaticResource SystemControlForegroundAccentBrush}" /> </ScrollViewer> </Grid> </UserControl> diff --git a/src/Notepads/Controls/Print/ContinuationPageFormat.xaml b/src/Notepads/Controls/Print/ContinuationPageFormat.xaml index bdee7a28e..d0d58f329 100644 --- a/src/Notepads/Controls/Print/ContinuationPageFormat.xaml +++ b/src/Notepads/Controls/Print/ContinuationPageFormat.xaml @@ -2,27 +2,38 @@ x:Class="Notepads.Controls.Print.ContinuationPageFormat" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:Notepads.Controls.Print" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="using:Notepads.Controls.Print" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - mc:Ignorable="d" - Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" + mc:Ignorable="d"> <Grid x:Name="PrintableArea"> <Grid.RowDefinitions> - <RowDefinition Height="Auto"/> - <RowDefinition Height="10*"/> - <RowDefinition Height="Auto"/> + <RowDefinition Height="Auto" /> + <RowDefinition Height="10*" /> + <RowDefinition Height="Auto" /> </Grid.RowDefinitions> - <StackPanel x:Name="Header" Grid.Row="0" Visibility="Visible"> - <TextBlock x:Name="HeaderTextBlock" Foreground="Black" TextAlignment="Center" TextWrapping="Wrap"/> + <StackPanel + x:Name="Header" + Grid.Row="0" + Visibility="Visible"> + <TextBlock + x:Name="HeaderTextBlock" + Foreground="Black" + TextAlignment="Center" + TextWrapping="Wrap" /> </StackPanel> - <RichTextBlockOverflow x:Name="ContinuationPageLinkedContainer" Grid.Row="1"/> + <RichTextBlockOverflow x:Name="ContinuationPageLinkedContainer" Grid.Row="1" /> <StackPanel x:Name="Footer" Grid.Row="2"> - <TextBlock x:Name="FooterTextBlock" Foreground="Black" TextAlignment="Center" TextWrapping="Wrap"/> + <TextBlock + x:Name="FooterTextBlock" + Foreground="Black" + TextAlignment="Center" + TextWrapping="Wrap" /> </StackPanel> </Grid> </Page> diff --git a/src/Notepads/Controls/Print/PrintPageFormat.xaml b/src/Notepads/Controls/Print/PrintPageFormat.xaml index b5e81a4f7..7fd7eb0b5 100644 --- a/src/Notepads/Controls/Print/PrintPageFormat.xaml +++ b/src/Notepads/Controls/Print/PrintPageFormat.xaml @@ -2,33 +2,51 @@ x:Class="Notepads.Controls.Print.PrintPageFormat" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:Notepads.Controls.Print" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="using:Notepads.Controls.Print" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - mc:Ignorable="d" - Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" + mc:Ignorable="d"> <Grid x:Name="PrintableArea"> <Grid.RowDefinitions> - <RowDefinition Height="Auto"/> - <RowDefinition Height="6*"/> - <RowDefinition Height="4*"/> - <RowDefinition Height="Auto"/> + <RowDefinition Height="Auto" /> + <RowDefinition Height="6*" /> + <RowDefinition Height="4*" /> + <RowDefinition Height="Auto" /> </Grid.RowDefinitions> - <StackPanel x:Name="Header" Grid.Row="0" Visibility="Visible"> - <TextBlock x:Name="HeaderTextBlock" Foreground="Black" TextAlignment="Center" TextWrapping="Wrap"/> + <StackPanel + x:Name="Header" + Grid.Row="0" + Visibility="Visible"> + <TextBlock + x:Name="HeaderTextBlock" + Foreground="Black" + TextAlignment="Center" + TextWrapping="Wrap" /> </StackPanel> - <RichTextBlock Foreground="Black" x:Name="TextContent" Grid.Row="1" OverflowContentTarget="{Binding ElementName=ContinuationPageLinkedContainer}" - IsTextSelectionEnabled="True" TextAlignment="Left" VerticalAlignment="Top" HorizontalAlignment="Left"> - <Paragraph x:Name="TextEditorContent"></Paragraph> + <RichTextBlock + x:Name="TextContent" + Grid.Row="1" + HorizontalAlignment="Left" + VerticalAlignment="Top" + Foreground="Black" + IsTextSelectionEnabled="True" + OverflowContentTarget="{Binding ElementName=ContinuationPageLinkedContainer}" + TextAlignment="Left"> + <Paragraph x:Name="TextEditorContent" /> </RichTextBlock> - - <RichTextBlockOverflow x:Name="ContinuationPageLinkedContainer" Grid.Row="2"/> + + <RichTextBlockOverflow x:Name="ContinuationPageLinkedContainer" Grid.Row="2" /> <StackPanel x:Name="Footer" Grid.Row="3"> - <TextBlock x:Name="FooterTextBlock" Foreground="Black" TextAlignment="Center" TextWrapping="Wrap"/> + <TextBlock + x:Name="FooterTextBlock" + Foreground="Black" + TextAlignment="Center" + TextWrapping="Wrap" /> </StackPanel> </Grid> </Page> diff --git a/src/Notepads/Controls/TextEditor/TextEditor.xaml b/src/Notepads/Controls/TextEditor/TextEditor.xaml index fff9054bb..b2128b5d8 100644 --- a/src/Notepads/Controls/TextEditor/TextEditor.xaml +++ b/src/Notepads/Controls/TextEditor/TextEditor.xaml @@ -3,72 +3,77 @@ 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" - xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls" - xmlns:textEditor="using:Notepads.Controls.TextEditor" xmlns:diffViewer="using:Notepads.Controls.DiffViewer" xmlns:findAndReplace="using:Notepads.Controls.FindAndReplace" xmlns:goTo="using:Notepads.Controls.GoTo" - mc:Ignorable="d" - Background="{ThemeResource SystemControlForegroundTransparentBrush}"> + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:textEditor="using:Notepads.Controls.TextEditor" + xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls" + Background="{ThemeResource SystemControlForegroundTransparentBrush}" + mc:Ignorable="d"> <UserControl.Resources> <ResourceDictionary> <ResourceDictionary.ThemeDictionaries> <ResourceDictionary x:Key="Light"> - <SolidColorBrush x:Key="SplitViewBackgroundThemeBrush" - Opacity="0.4" - Color="White"/> - <SolidColorBrush x:Key="GridSplitterBackgroundThemeBrush" - Opacity="0.5" - Color="LightGray"/> + <SolidColorBrush + x:Key="SplitViewBackgroundThemeBrush" + Opacity="0.4" + Color="White" /> + <SolidColorBrush + x:Key="GridSplitterBackgroundThemeBrush" + Opacity="0.5" + Color="LightGray" /> </ResourceDictionary> <ResourceDictionary x:Key="Dark"> - <SolidColorBrush x:Key="SplitViewBackgroundThemeBrush" - Opacity="0.25" - Color="Black"/> - <SolidColorBrush x:Key="GridSplitterBackgroundThemeBrush" - Opacity="0.3" - Color="Black"/> + <SolidColorBrush + x:Key="SplitViewBackgroundThemeBrush" + Opacity="0.25" + Color="Black" /> + <SolidColorBrush + x:Key="GridSplitterBackgroundThemeBrush" + Opacity="0.3" + Color="Black" /> </ResourceDictionary> <ResourceDictionary x:Key="HighContrast"> - <SolidColorBrush x:Key="SplitViewBackgroundThemeBrush" - Color="{ThemeResource SystemColorHighlightColor}"/> - <SolidColorBrush x:Key="GridSplitterBackgroundThemeBrush" - Color="{ThemeResource SystemColorHighlightColor}"/> + <SolidColorBrush x:Key="SplitViewBackgroundThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" /> + <SolidColorBrush x:Key="GridSplitterBackgroundThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" /> </ResourceDictionary> </ResourceDictionary.ThemeDictionaries> <Style x:Key="CustomGridSplitterStyle" TargetType="wctc:GridSplitter"> - <Setter Property="IsTabStop" Value="True"/> - <Setter Property="UseSystemFocusVisuals" Value="True"/> - <Setter Property="HorizontalAlignment" Value="Stretch"/> - <Setter Property="VerticalAlignment" Value="Stretch"/> - <Setter Property="IsFocusEngagementEnabled" Value="True"/> - <Setter Property="MinWidth" Value="2"/> - <Setter Property="MinHeight" Value="2"/> - <Setter Property="Background" Value="Transparent"/> - <Setter Property="GripperForeground" Value="Transparent"/> + <Setter Property="IsTabStop" Value="True" /> + <Setter Property="UseSystemFocusVisuals" Value="True" /> + <Setter Property="HorizontalAlignment" Value="Stretch" /> + <Setter Property="VerticalAlignment" Value="Stretch" /> + <Setter Property="IsFocusEngagementEnabled" Value="True" /> + <Setter Property="MinWidth" Value="2" /> + <Setter Property="MinHeight" Value="2" /> + <Setter Property="Background" Value="Transparent" /> + <Setter Property="GripperForeground" Value="Transparent" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="wctc:GridSplitter"> <Grid x:Name="RootGrid" Background="Transparent"> + <ContentPresenter + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch" + Content="{TemplateBinding Element}" /> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="GridSplitterStates"> - <VisualState x:Name="Normal"/> + <VisualState x:Name="Normal" /> <VisualState x:Name="PointerOver"> <VisualState.Setters> - <Setter Target="RootGrid.Background" Value="{ThemeResource GridSplitterBackgroundThemeBrush}"/> + <Setter Target="RootGrid.Background" Value="{ThemeResource GridSplitterBackgroundThemeBrush}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="Pressed"> <VisualState.Setters> - <Setter Target="RootGrid.Background" Value="{ThemeResource GridSplitterBackgroundThemeBrush}"/> + <Setter Target="RootGrid.Background" Value="{ThemeResource GridSplitterBackgroundThemeBrush}" /> </VisualState.Setters> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> - <ContentPresenter Content="{TemplateBinding Element}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"/> </Grid> </ControlTemplate> </Setter.Value> @@ -76,110 +81,118 @@ </Style> </ResourceDictionary> </UserControl.Resources> - + <Grid> <Grid.RowDefinitions> - <RowDefinition x:Name="EditorRowDefinition" Height="*"/> - <RowDefinition x:Name="SideBySideDiffViewRowDefinition" Height="0"/> + <RowDefinition x:Name="EditorRowDefinition" Height="*" /> + <RowDefinition x:Name="SideBySideDiffViewRowDefinition" Height="0" /> </Grid.RowDefinitions> <Grid Row="0"> <Grid.ColumnDefinitions> - <ColumnDefinition x:Name="EditorColumnDefinition" Width="*" MinWidth="100"/> - <ColumnDefinition x:Name="SplitPanelColumnDefinition" Width="0"/> + <ColumnDefinition + x:Name="EditorColumnDefinition" + Width="*" + MinWidth="100" /> + <ColumnDefinition x:Name="SplitPanelColumnDefinition" Width="0" /> </Grid.ColumnDefinitions> <Grid> - <textEditor:TextEditorCore x:Name="TextEditorCore" - Style="{StaticResource TextEditorCore}" - Grid.Column="0" - Padding="6 , 6, 10, 6"/> - <!-- TODO: Change CornerRadius to {ThemeResource OverlayCornerRadius}--> - <wctc:InAppNotification x:Name="FindAndReplacePlaceholder" - x:Load="false" - Padding="0" - Margin="0" - HorizontalAlignment="Right" - VerticalAlignment="Top" - Style="{StaticResource FindAndReplacePlaceholder}" - ShowDismissButton="True" - AnimationDuration="0:0:0.050" - VerticalOffset="10" - HorizontalOffset="-22" - FontWeight="Light" - BorderThickness="1" - CornerRadius="0" - Closed="FindAndReplacePlaceholder_Closed"> + <textEditor:TextEditorCore + x:Name="TextEditorCore" + Grid.Column="0" + Padding="6,6,10,6" + Style="{StaticResource TextEditorCore}" /> + <wctc:InAppNotification + x:Name="FindAndReplacePlaceholder" + Margin="0" + Padding="0" + HorizontalAlignment="Right" + VerticalAlignment="Top" + x:Load="false" + AnimationDuration="0:0:0.050" + BorderThickness="1" + Closed="FindAndReplacePlaceholder_Closed" + FontWeight="Light" + HorizontalOffset="-22" + ShowDismissButton="True" + Style="{StaticResource FindAndReplacePlaceholder}" + VerticalOffset="10"> <wctc:InAppNotification.Content> - <findAndReplace:FindAndReplaceControl x:Name="FindAndReplaceControl" - Width="340" - OnDismissKeyDown="FindAndReplaceControl_OnDismissKeyDown" - OnToggleReplaceModeButtonClicked="FindAndReplaceControl_OnToggleReplaceModeButtonClicked" - OnFindReplaceControlKeyDown="TextEditorCore_OnKeyDown" - OnFindAndReplaceButtonClicked="FindAndReplaceControl_OnFindAndReplaceButtonClicked"/> + <findAndReplace:FindAndReplaceControl + x:Name="FindAndReplaceControl" + Width="340" + OnDismissKeyDown="FindAndReplaceControl_OnDismissKeyDown" + OnFindAndReplaceButtonClicked="FindAndReplaceControl_OnFindAndReplaceButtonClicked" + OnFindReplaceControlKeyDown="TextEditorCore_OnKeyDown" + OnToggleReplaceModeButtonClicked="FindAndReplaceControl_OnToggleReplaceModeButtonClicked" /> </wctc:InAppNotification.Content> </wctc:InAppNotification> - <!-- TODO: Change CornerRadius to {ThemeResource OverlayCornerRadius}--> - <wctc:InAppNotification x:Name="GoToPlaceholder" - x:Load="false" - Padding="0" - Margin="0" - HorizontalAlignment="Right" - VerticalAlignment="Top" - Style="{StaticResource FindAndReplacePlaceholder}" - ShowDismissButton="True" - AnimationDuration="0:0:0.050" - VerticalOffset="0" - HorizontalOffset="-22" - FontWeight="Light" - BorderThickness="1" - CornerRadius="0" - Closed="GoToPlaceholder_Closed"> + <wctc:InAppNotification + x:Name="GoToPlaceholder" + Margin="0" + Padding="0" + HorizontalAlignment="Right" + VerticalAlignment="Top" + x:Load="false" + AnimationDuration="0:0:0.050" + BorderThickness="1" + Closed="GoToPlaceholder_Closed" + FontWeight="Light" + HorizontalOffset="-22" + ShowDismissButton="True" + Style="{StaticResource FindAndReplacePlaceholder}" + VerticalOffset="0"> <wctc:InAppNotification.Content> - <goTo:GoToControl x:Name="GoToControl" - Width="260" - OnDismissKeyDown="GoToControl_OnDismissKeyDown" - OnGoToControlKeyDown="TextEditorCore_OnKeyDown" - OnGoToButtonClicked="GoToControl_OnGoToButtonClicked"/> + <goTo:GoToControl + x:Name="GoToControl" + Width="260" + OnDismissKeyDown="GoToControl_OnDismissKeyDown" + OnGoToButtonClicked="GoToControl_OnGoToButtonClicked" + OnGoToControlKeyDown="TextEditorCore_OnKeyDown" /> </wctc:InAppNotification.Content> </wctc:InAppNotification> </Grid> - <wctc:DropShadowPanel Canvas.ZIndex="50" - Grid.Column="1" - ShadowOpacity="0.3" - BlurRadius="12" - VerticalAlignment="Stretch" - HorizontalAlignment="Left"> - <Grid Width="2"/> + <wctc:DropShadowPanel + Grid.Column="1" + HorizontalAlignment="Left" + VerticalAlignment="Stretch" + BlurRadius="12" + Canvas.ZIndex="50" + ShadowOpacity="0.3"> + <Grid Width="2" /> <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="-12,0,12,12960"></RectangleGeometry> + <RectangleGeometry Rect="-12,0,12,12960" /> </wctc:DropShadowPanel.Clip> </wctc:DropShadowPanel> - <ContentPresenter x:Name="SplitPanel" - x:Load="False" - Canvas.ZIndex="100" - Padding="10,0,0,0" - Background="{ThemeResource SplitViewBackgroundThemeBrush}" - AutomationProperties.AccessibilityView="Raw" - Grid.Column="1"/> - <wctc:GridSplitter x:Name="GridSplitter" - x:Load="False" - Canvas.ZIndex="150" - Style="{StaticResource CustomGridSplitterStyle}" - MinWidth="10" - GripperCursor="Default" - HorizontalAlignment="Left" - Grid.Column="1" - ResizeDirection="Auto" - ResizeBehavior="BasedOnAlignment" - CursorBehavior="ChangeOnSplitterHover" - Width="10"> + <ContentPresenter + x:Name="SplitPanel" + Grid.Column="1" + Padding="10,0,0,0" + x:Load="False" + AutomationProperties.AccessibilityView="Raw" + Background="{ThemeResource SplitViewBackgroundThemeBrush}" + Canvas.ZIndex="100" /> + <wctc:GridSplitter + x:Name="GridSplitter" + Grid.Column="1" + Width="10" + MinWidth="10" + HorizontalAlignment="Left" + x:Load="False" + Canvas.ZIndex="150" + CursorBehavior="ChangeOnSplitterHover" + GripperCursor="Default" + ResizeBehavior="BasedOnAlignment" + ResizeDirection="Auto" + Style="{StaticResource CustomGridSplitterStyle}"> <wctc:GridSplitter.RenderTransform> <TranslateTransform X="0" /> </wctc:GridSplitter.RenderTransform> </wctc:GridSplitter> </Grid> - <diffViewer:SideBySideDiffViewer x:Name="SideBySideDiffViewer" - x:Load="False" - Grid.Row="1"/> + <diffViewer:SideBySideDiffViewer + x:Name="SideBySideDiffViewer" + Grid.Row="1" + x:Load="False" /> </Grid> </UserControl> diff --git a/src/Notepads/Controls/TextEditor/TextEditorCore.xaml b/src/Notepads/Controls/TextEditor/TextEditorCore.xaml index d97895778..3789096a3 100644 --- a/src/Notepads/Controls/TextEditor/TextEditorCore.xaml +++ b/src/Notepads/Controls/TextEditor/TextEditorCore.xaml @@ -1,40 +1,35 @@ -<ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary.ThemeDictionaries> <ResourceDictionary x:Key="Light"> - <SolidColorBrush x:Key="TextEditorForeground" - Color="Black"/> + <SolidColorBrush x:Key="TextEditorForeground" Color="Black" /> </ResourceDictionary> <ResourceDictionary x:Key="Dark"> - <SolidColorBrush x:Key="TextEditorForeground" - Color="#F0F0F0"/> + <SolidColorBrush x:Key="TextEditorForeground" Color="#F0F0F0" /> </ResourceDictionary> <ResourceDictionary x:Key="HighContrast"> - <SolidColorBrush x:Key="TextEditorForeground" - Color="{ThemeResource TextControlForeground}"/> + <SolidColorBrush x:Key="TextEditorForeground" Color="{ThemeResource TextControlForeground}" /> </ResourceDictionary> </ResourceDictionary.ThemeDictionaries> <Style x:Key="TextEditorCore" TargetType="RichEditBox"> - <Setter Property="Foreground" Value="{ThemeResource TextEditorForeground}"/> - <Setter Property="Background" Value="Transparent"/> + <Setter Property="Foreground" Value="{ThemeResource TextEditorForeground}" /> + <Setter Property="Background" Value="Transparent" /> <!--<Setter Property="ContentLinkForegroundColor" Value="{ThemeResource ContentLinkForegroundColor}"/> <Setter Property="ContentLinkBackgroundColor" Value="{ThemeResource ContentLinkBackgroundColor}"/>--> - <Setter Property="SelectionHighlightColor" Value="{ThemeResource TextControlSelectionHighlightColor}"/> - <Setter Property="BorderBrush" Value="{ThemeResource TextControlBorderBrush}"/> - <Setter Property="BorderThickness" Value="0,0,0,0"/> - <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/> - <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/> - <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Enabled"/> - <Setter Property="ScrollViewer.VerticalScrollMode" Value="Enabled"/> - <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> - <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> - <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False"/> - <Setter Property="TextWrapping" Value="NoWrap"/> - <Setter Property="Padding" Value="0"/> - <Setter Property="UseSystemFocusVisuals" Value="{ThemeResource IsApplicationFocusVisualKindReveal}"/> + <Setter Property="SelectionHighlightColor" Value="{ThemeResource TextControlSelectionHighlightColor}" /> + <Setter Property="BorderBrush" Value="{ThemeResource TextControlBorderBrush}" /> + <Setter Property="BorderThickness" Value="0,0,0,0" /> + <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> + <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> + <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Enabled" /> + <Setter Property="ScrollViewer.VerticalScrollMode" Value="Enabled" /> + <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" /> + <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> + <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" /> + <Setter Property="TextWrapping" Value="NoWrap" /> + <Setter Property="Padding" Value="0" /> + <Setter Property="UseSystemFocusVisuals" Value="{ThemeResource IsApplicationFocusVisualKindReveal}" /> <!--<Setter Property="ContextFlyout" Value="{StaticResource TextControlCommandBarContextFlyout}"/> <Setter Property="SelectionFlyout" Value="{StaticResource TextControlCommandBarSelectionFlyout}"/>--> <Setter Property="Template"> @@ -42,98 +37,99 @@ <ControlTemplate TargetType="RichEditBox"> <Grid> <Grid.RowDefinitions> - <RowDefinition Height="Auto"/> - <RowDefinition Height="*"/> - <RowDefinition Height="Auto"/> + <RowDefinition Height="Auto" /> + <RowDefinition Height="*" /> + <RowDefinition Height="Auto" /> </Grid.RowDefinitions> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Disabled"/> - <VisualState x:Name="Normal"/> - <VisualState x:Name="PointerOver"/> - <VisualState x:Name="Focused"/> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> <ContentPresenter x:Name="HeaderContentPresenter" - ContentTemplate="{TemplateBinding HeaderTemplate}" + Grid.Row="0" + Margin="{ThemeResource RichEditBoxTopHeaderMargin}" + VerticalAlignment="Top" + x:DeferLoadStrategy="Lazy" Content="{TemplateBinding Header}" + ContentTemplate="{TemplateBinding HeaderTemplate}" FontWeight="Normal" Foreground="{ThemeResource TextControlHeaderForeground}" - Margin="{ThemeResource RichEditBoxTopHeaderMargin}" - Grid.Row="0" TextWrapping="Wrap" - VerticalAlignment="Top" - Visibility="Collapsed" - x:DeferLoadStrategy="Lazy"> - </ContentPresenter> + Visibility="Collapsed" /> <Border x:Name="BorderElement" + Grid.Row="1" + MinWidth="{ThemeResource TextControlThemeMinWidth}" + MinHeight="{ThemeResource TextControlThemeMinHeight}" Background="{TemplateBinding Background}" - BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" - CornerRadius="{TemplateBinding CornerRadius}" - MinHeight="{ThemeResource TextControlThemeMinHeight}" - MinWidth="{ThemeResource TextControlThemeMinWidth}" - Grid.Row="1"/> + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{TemplateBinding CornerRadius}" /> <Grid x:Name="RootGrid" Grid.Row="1"> <Grid.ColumnDefinitions> - <ColumnDefinition x:Name="LineNumberColumnDefinition" Width="Auto"/> - <ColumnDefinition x:Name="TextEditorColumnDefinition" Width="*"/> + <ColumnDefinition x:Name="LineNumberColumnDefinition" Width="Auto" /> + <ColumnDefinition x:Name="TextEditorColumnDefinition" Width="*" /> </Grid.ColumnDefinitions> <Canvas x:Name="LineHighlighterAndIndicatorCanvas" Grid.ColumnSpan="2"> - <Border x:Name="LineIndicator" - BorderBrush="{StaticResource SystemControlForegroundAccentBrush}" - Visibility="Collapsed"/> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <Grid x:Name="LineHighlighter" - Background="{ThemeResource SystemControlBackgroundListLowBrush}" - CornerRadius="0" - Opacity="0.65" - BorderThickness="0" - Visibility="Collapsed"/> + <Border + x:Name="LineIndicator" + BorderBrush="{StaticResource SystemControlForegroundAccentBrush}" + Visibility="Collapsed" /> + <Grid + x:Name="LineHighlighter" + Background="{ThemeResource SystemControlBackgroundListLowBrush}" + BorderThickness="0" + CornerRadius="{ThemeResource ControlCornerRadius}" + Opacity="0.65" + Visibility="Collapsed" /> </Canvas> - <Grid x:Name="LineNumberGrid" - Grid.Column="0" - BorderThickness="0,0,0,0" - BorderBrush="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}"> - <Canvas x:Name="LineNumberCanvas"/> + <Grid + x:Name="LineNumberGrid" + Grid.Column="0" + BorderBrush="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}" + BorderThickness="0,0,0,0"> + <Canvas x:Name="LineNumberCanvas" /> </Grid> <Grid Grid.Column="1"> <ScrollViewer - x:Name="ContentElement" - AutomationProperties.AccessibilityView="Raw" - HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" - HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" - IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" - IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" - IsTabStop="False" - IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" - Margin="{TemplateBinding BorderThickness}" - Padding="{TemplateBinding Padding}" - VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" - VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" - ZoomMode="Disabled"/> + x:Name="ContentElement" + Margin="{TemplateBinding BorderThickness}" + Padding="{TemplateBinding Padding}" + AutomationProperties.AccessibilityView="Raw" + HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" + HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" + IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" + IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" + IsTabStop="False" + IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" + VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" + VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" + ZoomMode="Disabled" /> </Grid> </Grid> - <TextBlock + <TextBlock x:Name="PlaceholderTextContentPresenter" - Foreground="{ThemeResource TextControlPlaceholderForeground}" - IsHitTestVisible="False" + Grid.Row="1" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" - Grid.Row="1" + Foreground="{ThemeResource TextControlPlaceholderForeground}" + IsHitTestVisible="False" + OpticalMarginAlignment="TrimSideBearings" Text="{TemplateBinding PlaceholderText}" - TextWrapping="{TemplateBinding TextWrapping}" TextAlignment="{TemplateBinding TextAlignment}" - OpticalMarginAlignment="TrimSideBearings"/> + TextWrapping="{TemplateBinding TextWrapping}" /> <ContentPresenter x:Name="DescriptionPresenter" + Grid.Row="2" + x:Load="False" AutomationProperties.AccessibilityView="Raw" Content="{TemplateBinding Description}" - Foreground="{ThemeResource SystemControlDescriptionTextForegroundBrush}" - Grid.Row="2" - x:Load="False"/> + Foreground="{ThemeResource SystemControlDescriptionTextForegroundBrush}" /> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="CommonStates"> + <VisualState x:Name="Disabled" /> + <VisualState x:Name="Normal" /> + <VisualState x:Name="PointerOver" /> + <VisualState x:Name="Focused" /> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> </Grid> </ControlTemplate> </Setter.Value> diff --git a/src/Notepads/Core/TabContextFlyout.cs b/src/Notepads/Core/TabContextFlyout.cs index a85d4096a..3008ed4ae 100644 --- a/src/Notepads/Core/TabContextFlyout.cs +++ b/src/Notepads/Core/TabContextFlyout.cs @@ -49,8 +49,7 @@ public TabContextFlyout(INotepadsCore notepadsCore, ITextEditor textEditor) var style = new Style(typeof(MenuFlyoutPresenter)); style.Setters.Add(new Setter(Control.BorderThicknessProperty, 0)); - // TODO: Remove CornerRadius property setter - style.Setters.Add(new Setter(Control.CornerRadiusProperty, 0)); + MenuFlyoutPresenterStyle = style; Opening += TabContextFlyout_Opening; diff --git a/src/Notepads/Notepads.csproj b/src/Notepads/Notepads.csproj index b534677e7..535db1499 100644 --- a/src/Notepads/Notepads.csproj +++ b/src/Notepads/Notepads.csproj @@ -412,16 +412,16 @@ <Version>1.7.0</Version> </PackageReference> <PackageReference Include="Microsoft.AppCenter.Analytics"> - <Version>4.1.0</Version> + <Version>4.2.0</Version> </PackageReference> <PackageReference Include="Microsoft.AppCenter.Crashes"> - <Version>4.1.0</Version> + <Version>4.2.0</Version> </PackageReference> <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> <Version>6.2.12</Version> </PackageReference> <PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls"> - <Version>7.0.0</Version> + <Version>7.0.1</Version> </PackageReference> <PackageReference Include="Microsoft.UI.Xaml"> <Version>2.5.0</Version> @@ -433,7 +433,7 @@ <Version>2.0.1</Version> </PackageReference> <PackageReference Include="System.Text.Json"> - <Version>5.0.1</Version> + <Version>5.0.2</Version> </PackageReference> <PackageReference Include="UTF.Unknown"> <Version>2.3.0</Version> diff --git a/src/Notepads/Resource/CustomAppBarButtonStyle.xaml b/src/Notepads/Resource/CustomAppBarButtonStyle.xaml index fe88dccf8..dfef6abe7 100644 --- a/src/Notepads/Resource/CustomAppBarButtonStyle.xaml +++ b/src/Notepads/Resource/CustomAppBarButtonStyle.xaml @@ -1,7 +1,8 @@ <ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Notepads"> + <Style x:Key="CustomAppBarButtonLabelToRightStyle" TargetType="AppBarButton"> <Setter Property="Background" Value="{ThemeResource AppBarButtonBackground}" /> <Setter Property="Foreground" Value="{ThemeResource AppBarButtonForeground}" /> @@ -17,69 +18,135 @@ <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="AppBarButton"> - <Grid x:Name="Root" - MinWidth="{TemplateBinding MinWidth}" - MaxWidth="{TemplateBinding MaxWidth}" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="{TemplateBinding CornerRadius}" > + <Grid + x:Name="Root" + MinWidth="{TemplateBinding MinWidth}" + MaxWidth="{TemplateBinding MaxWidth}" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{TemplateBinding CornerRadius}"> <Grid.Resources> <Style x:Name="LabelOnRightStyle" TargetType="AppBarButton"> <Setter Property="Width" Value="NaN" /> </Style> </Grid.Resources> + + <Rectangle + x:Name="AppBarButtonInnerBorder" + Stroke="{TemplateBinding BorderBrush}" + StrokeThickness="1" /> + <Grid x:Name="ContentRoot" MinHeight="{ThemeResource AppBarThemeCompactHeight}"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + + <Viewbox + x:Name="ContentViewbox" + Margin="{ThemeResource AppBarButtonContentViewboxMargin}" + HorizontalAlignment="Left" + AutomationProperties.AccessibilityView="Raw"> + <ContentPresenter + x:Name="Content" + Content="{TemplateBinding Icon}" + Foreground="{TemplateBinding Foreground}" /> + </Viewbox> + <TextBlock + x:Name="TextLabel" + Grid.Column="1" + Margin="{StaticResource AppBarButtonTextLabelOnRightMargin}" + HorizontalAlignment="Left" + VerticalAlignment="Center" + AutomationProperties.AccessibilityView="Raw" + FontFamily="{TemplateBinding FontFamily}" + FontSize="12" + Foreground="{TemplateBinding Foreground}" + Text="{TemplateBinding Label}" + TextAlignment="Center" + TextWrapping="Wrap" /> + <TextBlock + x:Name="OverflowTextLabel" + Margin="12,0,12,0" + Padding="{ThemeResource AppBarButtonOverflowTextLabelPadding}" + HorizontalAlignment="Stretch" + VerticalAlignment="Center" + AutomationProperties.AccessibilityView="Raw" + FontFamily="{TemplateBinding FontFamily}" + FontSize="{ThemeResource ControlContentThemeFontSize}" + Foreground="{TemplateBinding Foreground}" + Text="{TemplateBinding Label}" + TextAlignment="Left" + TextTrimming="Clip" + TextWrapping="NoWrap" + Visibility="Collapsed" /> + <TextBlock + x:Name="KeyboardAcceleratorTextLabel" + Grid.Column="2" + MinWidth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KeyboardAcceleratorTextMinWidth}" + Margin="0,0,10,5" + HorizontalAlignment="Right" + VerticalAlignment="Center" + AutomationProperties.AccessibilityView="Raw" + Foreground="{ThemeResource AppBarButtonKeyboardAcceleratorTextForeground}" + Style="{ThemeResource CaptionTextBlockStyle}" + Text="{TemplateBinding KeyboardAcceleratorTextOverride}" + Visibility="Visible" /> + <FontIcon + x:Name="SubItemChevron" + Grid.Column="2" + Margin="12,0,12,0" + AutomationProperties.AccessibilityView="Raw" + FontFamily="{ThemeResource SymbolThemeFontFamily}" + FontSize="12" + Foreground="{ThemeResource MenuFlyoutSubItemChevron}" + Glyph="" + MirroredWhenRightToLeft="True" + Visibility="Collapsed" /> + </Grid> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="ApplicationViewStates"> <VisualState x:Name="FullSize" /> <VisualState x:Name="Compact"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" - Storyboard.TargetProperty="Visibility"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Visibility"> <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="LabelOnRight"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentViewbox" - Storyboard.TargetProperty="Margin"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource AppBarButtonContentViewboxMargin}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentViewbox" Storyboard.TargetProperty="Margin"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarButtonContentViewboxMargin}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" - Storyboard.TargetProperty="MinHeight"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource AppBarThemeCompactHeight}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="MinHeight"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarThemeCompactHeight}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" - Storyboard.TargetProperty="(Grid.Row)"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="(Grid.Row)"> <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" - Storyboard.TargetProperty="(Grid.Column)"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="(Grid.Column)"> <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" - Storyboard.TargetProperty="TextAlignment"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="TextAlignment"> <DiscreteObjectKeyFrame KeyTime="0" Value="Left" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" - Storyboard.TargetProperty="Margin"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{StaticResource AppBarButtonTextLabelOnRightMargin}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Margin"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarButtonTextLabelOnRightMargin}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="LabelCollapsed"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" - Storyboard.TargetProperty="MinHeight"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource AppBarThemeCompactHeight}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="MinHeight"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarThemeCompactHeight}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" - Storyboard.TargetProperty="Visibility"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Visibility"> <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" /> </ObjectAnimationUsingKeyFrames> </Storyboard> @@ -137,20 +204,13 @@ </VisualState> <VisualState x:Name="PointerOver"> <VisualState.Setters> - <Setter Target="Root.Background" - Value="{ThemeResource AppBarButtonBackgroundPointerOver}" /> - <Setter Target="Root.BorderBrush" - Value="{ThemeResource AppBarButtonBorderBrushPointerOver}" /> - <Setter Target="AppBarButtonInnerBorder.Stroke" - Value="{ThemeResource AppBarButtonBorderBrushPointerOver}" /> - <Setter Target="Content.Foreground" - Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> - <Setter Target="TextLabel.Foreground" - Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> - <Setter Target="OverflowTextLabel.Foreground" - Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" - Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPointerOver}" /> + <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundPointerOver}" /> + <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushPointerOver}" /> + <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushPointerOver}" /> + <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> + <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> + <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> + <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPointerOver}" /> </VisualState.Setters> <Storyboard> @@ -159,20 +219,13 @@ </VisualState> <VisualState x:Name="Pressed"> <VisualState.Setters> - <Setter Target="Root.Background" - Value="{ThemeResource AppBarButtonBackgroundPressed}" /> - <Setter Target="Root.BorderBrush" - Value="{ThemeResource AppBarButtonBorderBrushPressed}" /> - <Setter Target="AppBarButtonInnerBorder.Stroke" - Value="{ThemeResource AppBarButtonBorderBrushPressed}" /> - <Setter Target="Content.Foreground" - Value="{ThemeResource AppBarButtonForegroundPressed}" /> - <Setter Target="TextLabel.Foreground" - Value="{ThemeResource AppBarButtonForegroundPressed}" /> - <Setter Target="OverflowTextLabel.Foreground" - Value="{ThemeResource AppBarButtonForegroundPressed}" /> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" - Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPressed}" /> + <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundPressed}" /> + <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushPressed}" /> + <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushPressed}" /> + <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> + <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> + <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> + <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPressed}" /> </VisualState.Setters> <Storyboard> @@ -181,20 +234,13 @@ </VisualState> <VisualState x:Name="Disabled"> <VisualState.Setters> - <Setter Target="Root.Background" - Value="{ThemeResource AppBarButtonBackgroundDisabled}" /> - <Setter Target="Root.BorderBrush" - Value="{ThemeResource AppBarButtonBorderBrushDisabled}" /> - <Setter Target="AppBarButtonInnerBorder.Stroke" - Value="{ThemeResource AppBarButtonBorderBrushDisabled}" /> - <Setter Target="Content.Foreground" - Value="{ThemeResource AppBarButtonForegroundDisabled}" /> - <Setter Target="TextLabel.Foreground" - Value="{ThemeResource AppBarButtonForegroundDisabled}" /> - <Setter Target="OverflowTextLabel.Foreground" - Value="{ThemeResource AppBarButtonForegroundDisabled}" /> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" - Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundDisabled}" /> + <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundDisabled}" /> + <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushDisabled}" /> + <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushDisabled}" /> + <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundDisabled}" /> + <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundDisabled}" /> + <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundDisabled}" /> + <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundDisabled}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="OverflowNormal"> @@ -205,22 +251,14 @@ </VisualState> <VisualState x:Name="OverflowPointerOver"> <VisualState.Setters> - <Setter Target="Root.Background" - Value="{ThemeResource AppBarButtonBackgroundPointerOver}" /> - <Setter Target="Root.BorderBrush" - Value="{ThemeResource AppBarButtonBorderBrushPointerOver}" /> - <Setter Target="AppBarButtonInnerBorder.Stroke" - Value="{ThemeResource AppBarButtonBorderBrushPointerOver}" /> - <Setter Target="Content.Foreground" - Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> - <Setter Target="TextLabel.Foreground" - Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> - <Setter Target="OverflowTextLabel.Foreground" - Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" - Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPointerOver}" /> - <Setter Target="SubItemChevron.Foreground" - Value="{ThemeResource AppBarButtonSubItemChevronForegroundPointerOver}" /> + <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundPointerOver}" /> + <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushPointerOver}" /> + <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushPointerOver}" /> + <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> + <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> + <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> + <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPointerOver}" /> + <Setter Target="SubItemChevron.Foreground" Value="{ThemeResource AppBarButtonSubItemChevronForegroundPointerOver}" /> </VisualState.Setters> <Storyboard> @@ -229,22 +267,14 @@ </VisualState> <VisualState x:Name="OverflowPressed"> <VisualState.Setters> - <Setter Target="Root.Background" - Value="{ThemeResource AppBarButtonBackgroundPressed}" /> - <Setter Target="Root.BorderBrush" - Value="{ThemeResource AppBarButtonBorderBrushPressed}" /> - <Setter Target="AppBarButtonInnerBorder.Stroke" - Value="{ThemeResource AppBarButtonBorderBrushPressed}" /> - <Setter Target="Content.Foreground" - Value="{ThemeResource AppBarButtonForegroundPressed}" /> - <Setter Target="TextLabel.Foreground" - Value="{ThemeResource AppBarButtonForegroundPressed}" /> - <Setter Target="OverflowTextLabel.Foreground" - Value="{ThemeResource AppBarButtonForegroundPressed}" /> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" - Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPressed}" /> - <Setter Target="SubItemChevron.Foreground" - Value="{ThemeResource AppBarButtonSubItemChevronForegroundPressed}" /> + <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundPressed}" /> + <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushPressed}" /> + <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushPressed}" /> + <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> + <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> + <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> + <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPressed}" /> + <Setter Target="SubItemChevron.Foreground" Value="{ThemeResource AppBarButtonSubItemChevronForegroundPressed}" /> </VisualState.Setters> <Storyboard> @@ -253,22 +283,14 @@ </VisualState> <VisualState x:Name="OverflowSubMenuOpened"> <VisualState.Setters> - <Setter Target="Root.Background" - Value="{ThemeResource AppBarButtonBackgroundSubMenuOpened}" /> - <Setter Target="Root.BorderBrush" - Value="{ThemeResource AppBarButtonBorderBrushSubMenuOpened}" /> - <Setter Target="AppBarButtonInnerBorder.Stroke" - Value="{ThemeResource AppBarButtonBorderBrushSubMenuOpened}" /> - <Setter Target="Content.Foreground" - Value="{ThemeResource AppBarButtonForegroundSubMenuOpened}" /> - <Setter Target="TextLabel.Foreground" - Value="{ThemeResource AppBarButtonForegroundSubMenuOpened}" /> - <Setter Target="OverflowTextLabel.Foreground" - Value="{ThemeResource AppBarButtonForegroundSubMenuOpened}" /> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" - Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundSubMenuOpened}" /> - <Setter Target="SubItemChevron.Foreground" - Value="{ThemeResource AppBarButtonSubItemChevronForegroundSubMenuOpened}" /> + <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundSubMenuOpened}" /> + <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushSubMenuOpened}" /> + <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushSubMenuOpened}" /> + <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundSubMenuOpened}" /> + <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundSubMenuOpened}" /> + <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundSubMenuOpened}" /> + <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundSubMenuOpened}" /> + <Setter Target="SubItemChevron.Foreground" Value="{ThemeResource AppBarButtonSubItemChevronForegroundSubMenuOpened}" /> </VisualState.Setters> <Storyboard> @@ -281,14 +303,12 @@ <VisualState x:Name="InputModeDefault" /> <VisualState x:Name="TouchInputMode"> <VisualState.Setters> - <Setter Target="OverflowTextLabel.Padding" - Value="{ThemeResource AppBarButtonOverflowTextTouchMargin}" /> + <Setter Target="OverflowTextLabel.Padding" Value="{ThemeResource AppBarButtonOverflowTextTouchMargin}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="GameControllerInputMode"> <VisualState.Setters> - <Setter Target="OverflowTextLabel.Padding" - Value="{ThemeResource AppBarButtonOverflowTextTouchMargin}" /> + <Setter Target="OverflowTextLabel.Padding" Value="{ThemeResource AppBarButtonOverflowTextTouchMargin}" /> </VisualState.Setters> </VisualState> </VisualStateGroup> @@ -311,77 +331,6 @@ </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> - - <Rectangle x:Name="AppBarButtonInnerBorder" - StrokeThickness="1" - Stroke="{TemplateBinding BorderBrush}"/> - <Grid x:Name="ContentRoot" MinHeight="{ThemeResource AppBarThemeCompactHeight}"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - - <Viewbox x:Name="ContentViewbox" - Margin="{ThemeResource AppBarButtonContentViewboxMargin}" - HorizontalAlignment="Left" - AutomationProperties.AccessibilityView="Raw" > - <ContentPresenter x:Name="Content" - Content="{TemplateBinding Icon}" - Foreground="{TemplateBinding Foreground}"/> - </Viewbox> - <TextBlock x:Name="TextLabel" - Grid.Column="1" - Text="{TemplateBinding Label}" - Foreground="{TemplateBinding Foreground}" - FontSize="12" - FontFamily="{TemplateBinding FontFamily}" - TextAlignment="Center" - TextWrapping="Wrap" - VerticalAlignment="Center" - HorizontalAlignment="Left" - Margin="{StaticResource AppBarButtonTextLabelOnRightMargin}" - AutomationProperties.AccessibilityView="Raw" /> - <TextBlock x:Name="OverflowTextLabel" - Text="{TemplateBinding Label}" - Foreground="{TemplateBinding Foreground}" - FontSize="{ThemeResource ControlContentThemeFontSize}" - FontFamily="{TemplateBinding FontFamily}" - TextAlignment="Left" - TextTrimming="Clip" - TextWrapping="NoWrap" - HorizontalAlignment="Stretch" - VerticalAlignment="Center" - Margin="12,0,12,0" - Padding="{ThemeResource AppBarButtonOverflowTextLabelPadding}" - Visibility="Collapsed" - AutomationProperties.AccessibilityView="Raw" /> - <TextBlock x:Name="KeyboardAcceleratorTextLabel" - Grid.Column="2" - Style="{ThemeResource CaptionTextBlockStyle}" - Text="{TemplateBinding KeyboardAcceleratorTextOverride}" - MinWidth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KeyboardAcceleratorTextMinWidth}" - Margin="0,0,10,5" - Foreground="{ThemeResource AppBarButtonKeyboardAcceleratorTextForeground}" - HorizontalAlignment="Right" - VerticalAlignment="Center" - Visibility="Visible" - AutomationProperties.AccessibilityView="Raw" /> - <FontIcon x:Name="SubItemChevron" - Grid.Column="2" - Glyph="" - FontFamily="{ThemeResource SymbolThemeFontFamily}" - FontSize="12" - AutomationProperties.AccessibilityView="Raw" - Foreground="{ThemeResource MenuFlyoutSubItemChevron}" - Margin="12,0,12,0" - MirroredWhenRightToLeft="True" - Visibility="Collapsed" /> - </Grid> </Grid> </ControlTemplate> </Setter.Value> diff --git a/src/Notepads/Resource/CustomFlyoutItemStyle.xaml b/src/Notepads/Resource/CustomFlyoutItemStyle.xaml index 7f8437fe9..531b65dfc 100644 --- a/src/Notepads/Resource/CustomFlyoutItemStyle.xaml +++ b/src/Notepads/Resource/CustomFlyoutItemStyle.xaml @@ -1,14 +1,13 @@ <ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:media="using:Microsoft.UI.Xaml.Media" - xmlns:local="using:Notepads"> - <!-- TODO: Apply these styles to enable rounded corners --> - <!--<Style TargetType="MenuFlyoutItem" BasedOn="{StaticResource CustomMenuFlyoutItemStyle}" /> - <Style TargetType="MenuFlyoutSubItem" BasedOn="{StaticResource CustomMenuFlyoutSubItemStyle}" /> - <Style TargetType="ComboBoxItem" BasedOn="{StaticResource CustomComboBoxItemStyle}" />--> + xmlns:local="using:Notepads" + xmlns:media="using:Microsoft.UI.Xaml.Media"> + <Style BasedOn="{StaticResource CustomMenuFlyoutItemStyle}" TargetType="MenuFlyoutItem" /> + <Style BasedOn="{StaticResource CustomMenuFlyoutSubItemStyle}" TargetType="MenuFlyoutSubItem" /> + <Style BasedOn="{StaticResource CustomComboBoxItemStyle}" TargetType="ComboBoxItem" /> - <Style TargetType="MenuFlyoutItem" x:Key="CustomMenuFlyoutItemStyle"> + <Style x:Key="CustomMenuFlyoutItemStyle" TargetType="MenuFlyoutItem"> <Setter Property="Background" Value="{ThemeResource MenuFlyoutItemRevealBackground}" /> <Setter Property="BorderBrush" Value="{ThemeResource MenuFlyoutItemRevealBorderBrush}" /> <Setter Property="BorderThickness" Value="{ThemeResource MenuFlyoutItemRevealBorderThickness}" /> @@ -23,12 +22,46 @@ <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="MenuFlyoutItem"> - <Grid x:Name="LayoutRoot" - Padding="{TemplateBinding Padding}" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="{TemplateBinding CornerRadius}" > + <Grid + x:Name="LayoutRoot" + Padding="{TemplateBinding Padding}" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{TemplateBinding CornerRadius}"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + + <Viewbox + x:Name="IconRoot" + Width="16" + Height="16" + HorizontalAlignment="Left" + VerticalAlignment="Center" + Visibility="Collapsed"> + <ContentPresenter x:Name="IconContent" Content="{TemplateBinding Icon}" /> + </Viewbox> + <TextBlock + x:Name="TextBlock" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + Foreground="{TemplateBinding Foreground}" + Text="{TemplateBinding Text}" + TextTrimming="Clip" /> + <TextBlock + x:Name="KeyboardAcceleratorTextBlock" + Grid.Column="1" + MinWidth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KeyboardAcceleratorTextMinWidth}" + Margin="24,0,0,0" + HorizontalAlignment="Right" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + AutomationProperties.AccessibilityView="Raw" + Foreground="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForeground}" + Style="{ThemeResource CaptionTextBlockStyle}" + Text="{TemplateBinding KeyboardAcceleratorTextOverride}" + Visibility="Collapsed" /> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> @@ -39,18 +72,12 @@ </VisualState> <VisualState x:Name="PointerOver"> <VisualState.Setters> - <Setter Target="LayoutRoot.(media:RevealBrush.State)" - Value="PointerOver" /> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource MenuFlyoutItemRevealBackgroundPointerOver}" /> - <Setter Target="LayoutRoot.BorderBrush" - Value="{ThemeResource MenuFlyoutItemRevealBorderBrushPointerOver}" /> - <Setter Target="IconContent.Foreground" - Value="{ThemeResource MenuFlyoutItemForegroundPointerOver}" /> - <Setter Target="TextBlock.Foreground" - Value="{ThemeResource MenuFlyoutItemForegroundPointerOver}" /> - <Setter Target="KeyboardAcceleratorTextBlock.Foreground" - Value="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForegroundPointerOver}" /> + <Setter Target="LayoutRoot.(media:RevealBrush.State)" Value="PointerOver" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuFlyoutItemRevealBackgroundPointerOver}" /> + <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource MenuFlyoutItemRevealBorderBrushPointerOver}" /> + <Setter Target="IconContent.Foreground" Value="{ThemeResource MenuFlyoutItemForegroundPointerOver}" /> + <Setter Target="TextBlock.Foreground" Value="{ThemeResource MenuFlyoutItemForegroundPointerOver}" /> + <Setter Target="KeyboardAcceleratorTextBlock.Foreground" Value="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForegroundPointerOver}" /> </VisualState.Setters> <Storyboard> <PointerUpThemeAnimation Storyboard.TargetName="LayoutRoot" /> @@ -58,18 +85,12 @@ </VisualState> <VisualState x:Name="Pressed"> <VisualState.Setters> - <Setter Target="LayoutRoot.(media:RevealBrush.State)" - Value="Pressed" /> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource MenuFlyoutItemRevealBackgroundPressed}" /> - <Setter Target="LayoutRoot.BorderBrush" - Value="{ThemeResource MenuFlyoutItemRevealBorderBrushPressed}" /> - <Setter Target="IconContent.Foreground" - Value="{ThemeResource MenuFlyoutItemForegroundPressed}" /> - <Setter Target="TextBlock.Foreground" - Value="{ThemeResource MenuFlyoutItemForegroundPressed}" /> - <Setter Target="KeyboardAcceleratorTextBlock.Foreground" - Value="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForegroundPressed}" /> + <Setter Target="LayoutRoot.(media:RevealBrush.State)" Value="Pressed" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuFlyoutItemRevealBackgroundPressed}" /> + <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource MenuFlyoutItemRevealBorderBrushPressed}" /> + <Setter Target="IconContent.Foreground" Value="{ThemeResource MenuFlyoutItemForegroundPressed}" /> + <Setter Target="TextBlock.Foreground" Value="{ThemeResource MenuFlyoutItemForegroundPressed}" /> + <Setter Target="KeyboardAcceleratorTextBlock.Foreground" Value="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForegroundPressed}" /> </VisualState.Setters> <Storyboard> <PointerDownThemeAnimation Storyboard.TargetName="LayoutRoot" /> @@ -77,16 +98,11 @@ </VisualState> <VisualState x:Name="Disabled"> <VisualState.Setters> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource MenuFlyoutItemRevealBackgroundDisabled}" /> - <Setter Target="LayoutRoot.BorderBrush" - Value="{ThemeResource MenuFlyoutItemRevealBorderBrushDisabled}" /> - <Setter Target="IconContent.Foreground" - Value="{ThemeResource MenuFlyoutItemForegroundDisabled}" /> - <Setter Target="TextBlock.Foreground" - Value="{ThemeResource MenuFlyoutItemForegroundDisabled}" /> - <Setter Target="KeyboardAcceleratorTextBlock.Foreground" - Value="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForegroundDisabled}" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuFlyoutItemRevealBackgroundDisabled}" /> + <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource MenuFlyoutItemRevealBorderBrushDisabled}" /> + <Setter Target="IconContent.Foreground" Value="{ThemeResource MenuFlyoutItemForegroundDisabled}" /> + <Setter Target="TextBlock.Foreground" Value="{ThemeResource MenuFlyoutItemForegroundDisabled}" /> + <Setter Target="KeyboardAcceleratorTextBlock.Foreground" Value="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForegroundDisabled}" /> </VisualState.Setters> </VisualState> </VisualStateGroup> @@ -95,26 +111,20 @@ <VisualState x:Name="NoPlaceholder" /> <VisualState x:Name="CheckPlaceholder"> <VisualState.Setters> - <Setter Target="TextBlock.Margin" - Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> + <Setter Target="TextBlock.Margin" Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="IconPlaceholder"> <VisualState.Setters> - <Setter Target="TextBlock.Margin" - Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> - <Setter Target="IconRoot.Visibility" - Value="Visible" /> + <Setter Target="TextBlock.Margin" Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> + <Setter Target="IconRoot.Visibility" Value="Visible" /> </VisualState.Setters> </VisualState> <VisualState x:Name="CheckAndIconPlaceholder"> <VisualState.Setters> - <Setter Target="TextBlock.Margin" - Value="{ThemeResource MenuFlyoutItemDoublePlaceholderThemeThickness}" /> - <Setter Target="IconRoot.Margin" - Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> - <Setter Target="IconRoot.Visibility" - Value="Visible" /> + <Setter Target="TextBlock.Margin" Value="{ThemeResource MenuFlyoutItemDoublePlaceholderThemeThickness}" /> + <Setter Target="IconRoot.Margin" Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> + <Setter Target="IconRoot.Visibility" Value="Visible" /> </VisualState.Setters> </VisualState> </VisualStateGroup> @@ -122,10 +132,8 @@ <VisualState x:Name="DefaultPadding" /> <VisualState x:Name="NarrowPadding"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" - Storyboard.TargetProperty="Padding"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource MenuFlyoutItemThemePaddingNarrow}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Padding"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource MenuFlyoutItemThemePaddingNarrow}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> @@ -139,45 +147,13 @@ </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> - - <Grid.ColumnDefinitions> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> - - <Viewbox x:Name="IconRoot" - HorizontalAlignment="Left" - VerticalAlignment="Center" - Width="16" - Height="16" - Visibility="Collapsed"> - <ContentPresenter x:Name="IconContent" - Content="{TemplateBinding Icon}"/> - </Viewbox> - <TextBlock x:Name="TextBlock" - Text="{TemplateBinding Text}" - TextTrimming="Clip" - Foreground="{TemplateBinding Foreground}" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> - <TextBlock x:Name="KeyboardAcceleratorTextBlock" - Grid.Column="1" - Style="{ThemeResource CaptionTextBlockStyle}" - Text="{TemplateBinding KeyboardAcceleratorTextOverride}" - MinWidth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KeyboardAcceleratorTextMinWidth}" - Margin="24,0,0,0" - Foreground="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForeground}" - HorizontalAlignment="Right" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - Visibility="Collapsed" - AutomationProperties.AccessibilityView="Raw" /> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> - <Style TargetType="MenuFlyoutSubItem" x:Key="CustomMenuFlyoutSubItemStyle"> + <Style x:Key="CustomMenuFlyoutSubItemStyle" TargetType="MenuFlyoutSubItem"> <Setter Property="Background" Value="{ThemeResource MenuFlyoutSubItemRevealBackground}" /> <Setter Property="BorderBrush" Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrush}" /> <Setter Property="BorderThickness" Value="{ThemeResource MenuFlyoutSubItemRevealBorderThickness}" /> @@ -191,75 +167,89 @@ <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="MenuFlyoutSubItem"> - <Grid x:Name="LayoutRoot" - Padding="{TemplateBinding Padding}" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="{TemplateBinding CornerRadius}" > + <Grid + x:Name="LayoutRoot" + Padding="{TemplateBinding Padding}" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{TemplateBinding CornerRadius}"> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + + <Viewbox + x:Name="IconRoot" + Grid.Column="0" + Width="16" + Height="16" + HorizontalAlignment="Left" + VerticalAlignment="Center" + Visibility="Collapsed"> + <ContentPresenter x:Name="IconContent" Content="{TemplateBinding Icon}" /> + </Viewbox> + <TextBlock + x:Name="TextBlock" + Grid.Column="0" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + Foreground="{TemplateBinding Foreground}" + Text="{TemplateBinding Text}" + TextTrimming="Clip" /> + <FontIcon + x:Name="SubItemChevron" + Grid.Column="1" + Margin="{ThemeResource MenuFlyoutItemChevronMargin}" + AutomationProperties.AccessibilityView="Raw" + FontFamily="{ThemeResource SymbolThemeFontFamily}" + FontSize="12" + Foreground="{ThemeResource MenuFlyoutSubItemChevron}" + Glyph="" + MirroredWhenRightToLeft="True" /> + </Grid> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal" /> <VisualState x:Name="PointerOver"> <VisualState.Setters> - <Setter Target="LayoutRoot.(media:RevealBrush.State)" - Value="PointerOver" /> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource MenuFlyoutSubItemRevealBackgroundPointerOver}" /> - <Setter Target="LayoutRoot.BorderBrush" - Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrushPointerOver}" /> - <Setter Target="IconContent.Foreground" - Value="{ThemeResource MenuFlyoutSubItemForegroundPointerOver}" /> - <Setter Target="TextBlock.Foreground" - Value="{ThemeResource MenuFlyoutSubItemForegroundPointerOver}" /> - <Setter Target="SubItemChevron.Foreground" - Value="{ThemeResource MenuFlyoutSubItemChevronPointerOver}" /> + <Setter Target="LayoutRoot.(media:RevealBrush.State)" Value="PointerOver" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuFlyoutSubItemRevealBackgroundPointerOver}" /> + <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrushPointerOver}" /> + <Setter Target="IconContent.Foreground" Value="{ThemeResource MenuFlyoutSubItemForegroundPointerOver}" /> + <Setter Target="TextBlock.Foreground" Value="{ThemeResource MenuFlyoutSubItemForegroundPointerOver}" /> + <Setter Target="SubItemChevron.Foreground" Value="{ThemeResource MenuFlyoutSubItemChevronPointerOver}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="Pressed"> <VisualState.Setters> - <Setter Target="LayoutRoot.(media:RevealBrush.State)" - Value="Pressed" /> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource MenuFlyoutSubItemRevealBackgroundPressed}" /> - <Setter Target="LayoutRoot.BorderBrush" - Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrushPressed}" /> - <Setter Target="IconContent.Foreground" - Value="{ThemeResource MenuFlyoutSubItemForegroundPressed}" /> - <Setter Target="TextBlock.Foreground" - Value="{ThemeResource MenuFlyoutSubItemForegroundPressed}" /> - <Setter Target="SubItemChevron.Foreground" - Value="{ThemeResource MenuFlyoutSubItemChevronPressed}" /> + <Setter Target="LayoutRoot.(media:RevealBrush.State)" Value="Pressed" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuFlyoutSubItemRevealBackgroundPressed}" /> + <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrushPressed}" /> + <Setter Target="IconContent.Foreground" Value="{ThemeResource MenuFlyoutSubItemForegroundPressed}" /> + <Setter Target="TextBlock.Foreground" Value="{ThemeResource MenuFlyoutSubItemForegroundPressed}" /> + <Setter Target="SubItemChevron.Foreground" Value="{ThemeResource MenuFlyoutSubItemChevronPressed}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="SubMenuOpened"> <VisualState.Setters> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource MenuFlyoutSubItemRevealBackgroundSubMenuOpened}" /> - <Setter Target="LayoutRoot.BorderBrush" - Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrushSubMenuOpened}" /> - <Setter Target="IconContent.Foreground" - Value="{ThemeResource MenuFlyoutSubItemForegroundSubMenuOpened}" /> - <Setter Target="TextBlock.Foreground" - Value="{ThemeResource MenuFlyoutSubItemForegroundSubMenuOpened}" /> - <Setter Target="SubItemChevron.Foreground" - Value="{ThemeResource MenuFlyoutSubItemChevronSubMenuOpened}" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuFlyoutSubItemRevealBackgroundSubMenuOpened}" /> + <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrushSubMenuOpened}" /> + <Setter Target="IconContent.Foreground" Value="{ThemeResource MenuFlyoutSubItemForegroundSubMenuOpened}" /> + <Setter Target="TextBlock.Foreground" Value="{ThemeResource MenuFlyoutSubItemForegroundSubMenuOpened}" /> + <Setter Target="SubItemChevron.Foreground" Value="{ThemeResource MenuFlyoutSubItemChevronSubMenuOpened}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="Disabled"> <VisualState.Setters> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource MenuFlyoutSubItemRevealBackgroundDisabled}" /> - <Setter Target="LayoutRoot.BorderBrush" - Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrushDisabled}" /> - <Setter Target="IconContent.Foreground" - Value="{ThemeResource MenuFlyoutSubItemForegroundDisabled}" /> - <Setter Target="TextBlock.Foreground" - Value="{ThemeResource MenuFlyoutSubItemForegroundDisabled}" /> - <Setter Target="SubItemChevron.Foreground" - Value="{ThemeResource MenuFlyoutSubItemChevronDisabled}" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuFlyoutSubItemRevealBackgroundDisabled}" /> + <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrushDisabled}" /> + <Setter Target="IconContent.Foreground" Value="{ThemeResource MenuFlyoutSubItemForegroundDisabled}" /> + <Setter Target="TextBlock.Foreground" Value="{ThemeResource MenuFlyoutSubItemForegroundDisabled}" /> + <Setter Target="SubItemChevron.Foreground" Value="{ThemeResource MenuFlyoutSubItemChevronDisabled}" /> </VisualState.Setters> </VisualState> </VisualStateGroup> @@ -268,26 +258,20 @@ <VisualState x:Name="NoPlaceholder" /> <VisualState x:Name="CheckPlaceholder"> <VisualState.Setters> - <Setter Target="TextBlock.Margin" - Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> + <Setter Target="TextBlock.Margin" Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="IconPlaceholder"> <VisualState.Setters> - <Setter Target="TextBlock.Margin" - Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> - <Setter Target="IconRoot.Visibility" - Value="Visible" /> + <Setter Target="TextBlock.Margin" Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> + <Setter Target="IconRoot.Visibility" Value="Visible" /> </VisualState.Setters> </VisualState> <VisualState x:Name="CheckAndIconPlaceholder"> <VisualState.Setters> - <Setter Target="TextBlock.Margin" - Value="{ThemeResource MenuFlyoutItemDoublePlaceholderThemeThickness}" /> - <Setter Target="IconRoot.Margin" - Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> - <Setter Target="IconRoot.Visibility" - Value="Visible" /> + <Setter Target="TextBlock.Margin" Value="{ThemeResource MenuFlyoutItemDoublePlaceholderThemeThickness}" /> + <Setter Target="IconRoot.Margin" Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> + <Setter Target="IconRoot.Visibility" Value="Visible" /> </VisualState.Setters> </VisualState> </VisualStateGroup> @@ -295,56 +279,20 @@ <VisualState x:Name="DefaultPadding" /> <VisualState x:Name="NarrowPadding"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" - Storyboard.TargetProperty="Padding"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource MenuFlyoutItemThemePaddingNarrow}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Padding"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource MenuFlyoutItemThemePaddingNarrow}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> - - <Grid> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> - - <Viewbox x:Name="IconRoot" - Grid.Column="0" - HorizontalAlignment="Left" - VerticalAlignment="Center" - Width="16" - Height="16" - Visibility="Collapsed"> - <ContentPresenter x:Name="IconContent" - Content="{TemplateBinding Icon}"/> - </Viewbox> - <TextBlock x:Name="TextBlock" - Grid.Column="0" - Foreground="{TemplateBinding Foreground}" - Text="{TemplateBinding Text}" - TextTrimming="Clip" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> - <FontIcon x:Name="SubItemChevron" - Grid.Column="1" - Glyph="" - FontFamily="{ThemeResource SymbolThemeFontFamily}" - FontSize="12" - AutomationProperties.AccessibilityView="Raw" - Foreground="{ThemeResource MenuFlyoutSubItemChevron}" - Margin="{ThemeResource MenuFlyoutItemChevronMargin}" - MirroredWhenRightToLeft="True" /> - </Grid> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> - <Style TargetType="ComboBoxItem" x:Key="CustomComboBoxItemStyle"> + <Style x:Key="CustomComboBoxItemStyle" TargetType="ComboBoxItem"> <Setter Property="Foreground" Value="{ThemeResource ComboBoxItemForeground}" /> <Setter Property="Background" Value="{ThemeResource ComboBoxItemRevealBackground}" /> <Setter Property="BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrush}" /> @@ -357,12 +305,22 @@ <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ComboBoxItem"> - <Grid x:Name="LayoutRoot" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="{TemplateBinding CornerRadius}" - Control.IsTemplateFocusTarget="True"> + <Grid + x:Name="LayoutRoot" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Control.IsTemplateFocusTarget="True" + CornerRadius="{TemplateBinding CornerRadius}"> + <ContentPresenter + x:Name="ContentPresenter" + Margin="{TemplateBinding Padding}" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + Content="{TemplateBinding Content}" + ContentTemplate="{TemplateBinding ContentTemplate}" + ContentTransitions="{TemplateBinding ContentTransitions}" + Foreground="{TemplateBinding Foreground}" /> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> @@ -373,14 +331,10 @@ </VisualState> <VisualState x:Name="PointerOver"> <VisualState.Setters> - <Setter Target="LayoutRoot.(media:RevealBrush.State)" - Value="PointerOver" /> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource ComboBoxItemRevealBackgroundPointerOver}" /> - <Setter Target="LayoutRoot.BorderBrush" - Value="{ThemeResource ComboBoxItemRevealBorderBrushPointerOver}" /> - <Setter Target="ContentPresenter.Foreground" - Value="{ThemeResource ComboBoxItemForegroundPointerOver}" /> + <Setter Target="LayoutRoot.(media:RevealBrush.State)" Value="PointerOver" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource ComboBoxItemRevealBackgroundPointerOver}" /> + <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrushPointerOver}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundPointerOver}" /> </VisualState.Setters> <Storyboard> <PointerUpThemeAnimation Storyboard.TargetName="LayoutRoot" /> @@ -388,24 +342,17 @@ </VisualState> <VisualState x:Name="Disabled"> <VisualState.Setters> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource ComboBoxItemRevealBackgroundDisabled}" /> - <Setter Target="LayoutRoot.BorderBrush" - Value="{ThemeResource ComboBoxItemRevealBorderBrushDisabled}" /> - <Setter Target="ContentPresenter.Foreground" - Value="{ThemeResource ComboBoxItemForegroundDisabled}" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource ComboBoxItemRevealBackgroundDisabled}" /> + <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrushDisabled}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundDisabled}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="Pressed"> <VisualState.Setters> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource ComboBoxItemRevealBackgroundPressed}" /> - <Setter Target="LayoutRoot.BorderBrush" - Value="{ThemeResource ComboBoxItemRevealBorderBrushPressed}" /> - <Setter Target="ContentPresenter.Foreground" - Value="{ThemeResource ComboBoxItemForegroundPressed}" /> - <Setter Target="LayoutRoot.(media:RevealBrush.State)" - Value="Pressed" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource ComboBoxItemRevealBackgroundPressed}" /> + <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrushPressed}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundPressed}" /> + <Setter Target="LayoutRoot.(media:RevealBrush.State)" Value="Pressed" /> </VisualState.Setters> <Storyboard> <PointerDownThemeAnimation Storyboard.TargetName="LayoutRoot" /> @@ -413,12 +360,9 @@ </VisualState> <VisualState x:Name="Selected"> <VisualState.Setters> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource ComboBoxItemRevealBackgroundSelected}" /> - <Setter Target="LayoutRoot.BorderBrush" - Value="{ThemeResource ComboBoxItemRevealBorderBrushSelected}" /> - <Setter Target="ContentPresenter.Foreground" - Value="{ThemeResource ComboBoxItemForegroundSelected}" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource ComboBoxItemRevealBackgroundSelected}" /> + <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrushSelected}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundSelected}" /> </VisualState.Setters> <Storyboard> <PointerUpThemeAnimation Storyboard.TargetName="LayoutRoot" /> @@ -426,34 +370,24 @@ </VisualState> <VisualState x:Name="SelectedUnfocused"> <VisualState.Setters> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource ComboBoxItemRevealBackgroundSelectedUnfocused}" /> - <Setter Target="LayoutRoot.BorderBrush" - Value="{ThemeResource ComboBoxItemRevealBorderBrushSelectedUnfocused}" /> - <Setter Target="ContentPresenter.Foreground" - Value="{ThemeResource ComboBoxItemForegroundSelectedUnfocused}" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource ComboBoxItemRevealBackgroundSelectedUnfocused}" /> + <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrushSelectedUnfocused}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundSelectedUnfocused}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="SelectedDisabled"> <VisualState.Setters> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource ComboBoxItemRevealBackgroundSelectedDisabled}" /> - <Setter Target="LayoutRoot.BorderBrush" - Value="{ThemeResource ComboBoxItemRevealBorderBrushSelectedDisabled}" /> - <Setter Target="ContentPresenter.Foreground" - Value="{ThemeResource ComboBoxItemForegroundSelectedDisabled}" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource ComboBoxItemRevealBackgroundSelectedDisabled}" /> + <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrushSelectedDisabled}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundSelectedDisabled}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="SelectedPointerOver"> <VisualState.Setters> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource ComboBoxItemRevealBackgroundSelectedPointerOver}" /> - <Setter Target="LayoutRoot.BorderBrush" - Value="{ThemeResource ComboBoxItemRevealBorderBrushSelectedPointerOver}" /> - <Setter Target="ContentPresenter.Foreground" - Value="{ThemeResource ComboBoxItemForegroundSelectedPointerOver}" /> - <Setter Target="LayoutRoot.(media:RevealBrush.State)" - Value="PointerOver" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource ComboBoxItemRevealBackgroundSelectedPointerOver}" /> + <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrushSelectedPointerOver}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundSelectedPointerOver}" /> + <Setter Target="LayoutRoot.(media:RevealBrush.State)" Value="PointerOver" /> </VisualState.Setters> <Storyboard> <PointerUpThemeAnimation Storyboard.TargetName="LayoutRoot" /> @@ -461,14 +395,10 @@ </VisualState> <VisualState x:Name="SelectedPressed"> <VisualState.Setters> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource ComboBoxItemRevealBackgroundSelectedPressed}" /> - <Setter Target="LayoutRoot.BorderBrush" - Value="{ThemeResource ComboBoxItemRevealBorderBrushSelectedPressed}" /> - <Setter Target="ContentPresenter.Foreground" - Value="{ThemeResource ComboBoxItemForegroundSelectedPressed}" /> - <Setter Target="LayoutRoot.(media:RevealBrush.State)" - Value="Pressed" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource ComboBoxItemRevealBackgroundSelectedPressed}" /> + <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrushSelectedPressed}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundSelectedPressed}" /> + <Setter Target="LayoutRoot.(media:RevealBrush.State)" Value="Pressed" /> </VisualState.Setters> </VisualState> </VisualStateGroup> @@ -477,27 +407,16 @@ <VisualState x:Name="InputModeDefault" /> <VisualState x:Name="TouchInputMode"> <VisualState.Setters> - <Setter Target="ContentPresenter.Margin" - Value="{ThemeResource ComboBoxItemRevealThemeTouchPadding}" /> + <Setter Target="ContentPresenter.Margin" Value="{ThemeResource ComboBoxItemRevealThemeTouchPadding}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="GameControllerInputMode"> <VisualState.Setters> - <Setter Target="ContentPresenter.Margin" - Value="{ThemeResource ComboBoxItemRevealThemeGameControllerPadding}" /> + <Setter Target="ContentPresenter.Margin" Value="{ThemeResource ComboBoxItemRevealThemeGameControllerPadding}" /> </VisualState.Setters> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> - - <ContentPresenter x:Name="ContentPresenter" - Content="{TemplateBinding Content}" - ContentTransitions="{TemplateBinding ContentTransitions}" - ContentTemplate="{TemplateBinding ContentTemplate}" - Foreground="{TemplateBinding Foreground}" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - Margin="{TemplateBinding Padding}" /> </Grid> </ControlTemplate> </Setter.Value> diff --git a/src/Notepads/Resource/CustomNavigationViewStyle.xaml b/src/Notepads/Resource/CustomNavigationViewStyle.xaml index 3cb5ea3a1..ebf03062b 100644 --- a/src/Notepads/Resource/CustomNavigationViewStyle.xaml +++ b/src/Notepads/Resource/CustomNavigationViewStyle.xaml @@ -1,9 +1,10 @@ <ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="using:Notepads" xmlns:muxc="using:Microsoft.UI.Xaml.Controls" - xmlns:muxcp="using:Microsoft.UI.Xaml.Controls.Primitives" - xmlns:local="using:Notepads"> + xmlns:muxcp="using:Microsoft.UI.Xaml.Controls.Primitives"> + <Style x:Key="PaneToggleButtonStyle" TargetType="Button"> <Setter Property="FontSize" Value="16" /> <Setter Property="FontFamily" Value="{StaticResource SymbolThemeFontFamily}" /> @@ -20,14 +21,14 @@ <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <Grid x:Name="LayoutRoot" - MinWidth="{TemplateBinding MinWidth}" - Height="{TemplateBinding MinHeight}" - Margin="{TemplateBinding Padding}" - Background="{TemplateBinding Background}" - CornerRadius="0" - HorizontalAlignment="Stretch"> + <Grid + x:Name="LayoutRoot" + Height="{TemplateBinding MinHeight}" + MinWidth="{TemplateBinding MinWidth}" + Margin="{TemplateBinding Padding}" + HorizontalAlignment="Stretch" + Background="{TemplateBinding Background}" + CornerRadius="{ThemeResource ControlCornerRadius}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> @@ -36,100 +37,90 @@ <RowDefinition Height="{ThemeResource PaneToggleButtonHeight}" /> </Grid.RowDefinitions> + <Border Width="{TemplateBinding MinWidth}"> + <Viewbox + x:Name="IconHost" + Width="16" + Height="16" + HorizontalAlignment="Center" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + AutomationProperties.AccessibilityView="Raw"> + <TextBlock + x:Name="Icon" + AutomationProperties.AccessibilityView="Raw" + FontSize="{TemplateBinding FontSize}" + Text="" /> + </Viewbox> + </Border> + <ContentPresenter + x:Name="ContentPresenter" + Grid.Column="1" + VerticalContentAlignment="Center" + Content="{TemplateBinding Content}" + FontSize="{TemplateBinding FontSize}" /> + <Border + x:Name="RevealBorder" + Grid.ColumnSpan="2" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" /> + <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal" /> <VisualState x:Name="PointerOver"> <VisualState.Setters> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource NavigationViewButtonBackgroundPointerOver}" /> - <Setter Target="ContentPresenter.Foreground" - Value="{ThemeResource NavigationViewButtonForegroundPointerOver}" /> - <Setter Target="Icon.Foreground" - Value="{ThemeResource NavigationViewButtonForegroundPointerOver}" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource NavigationViewButtonBackgroundPointerOver}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource NavigationViewButtonForegroundPointerOver}" /> + <Setter Target="Icon.Foreground" Value="{ThemeResource NavigationViewButtonForegroundPointerOver}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="Pressed"> <VisualState.Setters> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource NavigationViewButtonBackgroundPressed}" /> - <Setter Target="ContentPresenter.Foreground" - Value="{ThemeResource NavigationViewButtonForegroundPressed}" /> - <Setter Target="Icon.Foreground" - Value="{ThemeResource NavigationViewButtonForegroundPressed}" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource NavigationViewButtonBackgroundPressed}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource NavigationViewButtonForegroundPressed}" /> + <Setter Target="Icon.Foreground" Value="{ThemeResource NavigationViewButtonForegroundPressed}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="Disabled"> <VisualState.Setters> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource NavigationViewButtonBackgroundDisabled}" /> - <Setter Target="ContentPresenter.Foreground" - Value="{ThemeResource NavigationViewButtonForegroundDisabled}" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource NavigationViewButtonBackgroundDisabled}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource NavigationViewButtonForegroundDisabled}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="Checked"> <VisualState.Setters> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource ToggleButtonBackgroundChecked}" /> - <Setter Target="ContentPresenter.Foreground" - Value="{ThemeResource ToggleButtonForegroundChecked}" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource ToggleButtonBackgroundChecked}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ToggleButtonForegroundChecked}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="CheckedPointerOver"> <VisualState.Setters> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource ToggleButtonBackgroundCheckedPointerOver}" /> - <Setter Target="ContentPresenter.Foreground" - Value="{ThemeResource ToggleButtonForegroundCheckedPointerOver}" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource ToggleButtonBackgroundCheckedPointerOver}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ToggleButtonForegroundCheckedPointerOver}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="CheckedPressed"> <VisualState.Setters> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource ToggleButtonBackgroundCheckedPressed}" /> - <Setter Target="ContentPresenter.Foreground" - Value="{ThemeResource ToggleButtonForegroundCheckedPressed}" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource ToggleButtonBackgroundCheckedPressed}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ToggleButtonForegroundCheckedPressed}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="CheckedDisabled"> <VisualState.Setters> - <Setter Target="LayoutRoot.Background" - Value="{ThemeResource ToggleButtonBackgroundCheckedDisabled}" /> - <Setter Target="ContentPresenter.Foreground" - Value="{ThemeResource ToggleButtonForegroundCheckedDisabled}" /> + <Setter Target="LayoutRoot.Background" Value="{ThemeResource ToggleButtonBackgroundCheckedDisabled}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ToggleButtonForegroundCheckedDisabled}" /> </VisualState.Setters> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> - - <Border Width="{TemplateBinding MinWidth}"> - <Viewbox x:Name="IconHost" - Width="16" - Height="16" - HorizontalAlignment="Center" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - AutomationProperties.AccessibilityView="Raw"> - <TextBlock x:Name="Icon" - Text="" - FontSize="{TemplateBinding FontSize}" - AutomationProperties.AccessibilityView="Raw" /> - </Viewbox> - </Border> - <ContentPresenter x:Name="ContentPresenter" - VerticalContentAlignment="Center" - Content="{TemplateBinding Content}" - FontSize="{TemplateBinding FontSize}" - Grid.Column="1" /> - <Border x:Name="RevealBorder" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - Grid.ColumnSpan="2" /> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> + <Style BasedOn="{StaticResource CustomNavigationViewItemStyle}" TargetType="muxc:NavigationViewItem" /> + <Style x:Key="CustomNavigationViewItemStyle" TargetType="muxc:NavigationViewItem"> <Setter Property="Foreground" Value="{ThemeResource NavigationViewItemForeground}" /> <Setter Property="Background" Value="{ThemeResource NavigationViewItemBackground}" /> @@ -141,87 +132,44 @@ <Setter Property="Margin" Value="{ThemeResource NavigationViewItemMargin}" /> <Setter Property="UseSystemFocusVisuals" Value="True" /> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> - <Setter Property="TabNavigation" Value="Once"/> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <Setter Property="CornerRadius" Value="0" /> + <Setter Property="TabNavigation" Value="Once" /> + <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="muxc:NavigationViewItem"> <Grid x:Name="NVIRootGrid" CornerRadius="{TemplateBinding CornerRadius}"> <Grid.RowDefinitions> - <RowDefinition Height="*"/> - <RowDefinition Height="Auto"/> + <RowDefinition Height="*" /> + <RowDefinition Height="Auto" /> </Grid.RowDefinitions> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="ItemOnNavigationViewListPositionStates"> - <VisualState x:Name="OnLeftNavigation"> - <VisualState.Setters> - <Setter Target="NavigationViewItemPresenter.Style" - Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnLeftPane}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="OnLeftNavigationReveal"> - <VisualState.Setters> - <Setter Target="NavigationViewItemPresenter.Style" - Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnLeftPaneWithRevealFocus}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="OnTopNavigationPrimary"> - <VisualState.Setters> - <Setter Target="NavigationViewItemPresenter.Margin" - Value="{ThemeResource TopNavigationViewItemMargin}"/> - <Setter Target="NavigationViewItemPresenter.Style" - Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPane}" /> - <Setter Target="ChildrenFlyout.Placement" - Value="BottomEdgeAlignedLeft"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="OnTopNavigationPrimaryReveal"> - <VisualState.Setters> - <Setter Target="NavigationViewItemPresenter.Margin" - Value="{ThemeResource TopNavigationViewItemMargin}"/> - <Setter Target="NavigationViewItemPresenter.Style" - Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPaneWithRevealFocus}" /> - <Setter Target="ChildrenFlyout.Placement" - Value="BottomEdgeAlignedLeft"/> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="OnTopNavigationOverflow"> - <VisualState.Setters> - <Setter Target="NavigationViewItemPresenter.Style" - Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPaneOverflow}" /> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - - <muxcp:NavigationViewItemPresenter x:Name="NavigationViewItemPresenter" - Icon="{TemplateBinding Icon}" - ContentTransitions="{TemplateBinding ContentTransitions}" - ContentTemplate="{TemplateBinding ContentTemplate}" - Margin="{TemplateBinding Margin}" - Padding="{TemplateBinding Padding}" - Foreground="{TemplateBinding Foreground}" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - UseSystemFocusVisuals="{TemplateBinding UseSystemFocusVisuals}" - VerticalAlignment="{TemplateBinding VerticalAlignment}" - HorizontalAlignment="{TemplateBinding HorizontalAlignment}" - VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" - HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" - ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" - Content="{TemplateBinding Content}" - CornerRadius="{TemplateBinding CornerRadius}" - IsTabStop="false" - Control.IsTemplateFocusTarget="True"> - </muxcp:NavigationViewItemPresenter> - <muxc:ItemsRepeater Grid.Row="1" - Visibility="Collapsed" - x:Name="NavigationViewItemMenuItemsHost"> + <muxcp:NavigationViewItemPresenter + x:Name="NavigationViewItemPresenter" + Margin="{TemplateBinding Margin}" + Padding="{TemplateBinding Padding}" + HorizontalAlignment="{TemplateBinding HorizontalAlignment}" + VerticalAlignment="{TemplateBinding VerticalAlignment}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Content="{TemplateBinding Content}" + ContentTemplate="{TemplateBinding ContentTemplate}" + ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" + ContentTransitions="{TemplateBinding ContentTransitions}" + Control.IsTemplateFocusTarget="True" + CornerRadius="{TemplateBinding CornerRadius}" + Foreground="{TemplateBinding Foreground}" + Icon="{TemplateBinding Icon}" + IsTabStop="false" + UseSystemFocusVisuals="{TemplateBinding UseSystemFocusVisuals}" /> + <muxc:ItemsRepeater + x:Name="NavigationViewItemMenuItemsHost" + Grid.Row="1" + Visibility="Collapsed"> <muxc:ItemsRepeater.Layout> - <muxc:StackLayout Orientation="Vertical"/> + <muxc:StackLayout Orientation="Vertical" /> </muxc:ItemsRepeater.Layout> </muxc:ItemsRepeater> <FlyoutBase.AttachedFlyout> @@ -229,7 +177,7 @@ <Flyout.FlyoutPresenterStyle> <Style TargetType="FlyoutPresenter"> <Setter Property="Padding" Value="{ThemeResource NavigationViewItemChildrenMenuFlyoutPadding}" /> - <!--Set negative top margin to make the flyout align exactly with the button--> + <!-- Set negative top margin to make the flyout align exactly with the button --> <Setter Property="Margin" Value="0,-4,0,0" /> <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto" /> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" /> @@ -240,24 +188,26 @@ <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="FlyoutPresenter"> - <ScrollViewer x:Name="ScrollViewer" - ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}" - HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" - HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" - VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" - VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" - AutomationProperties.AccessibilityView="Raw"> - <ContentPresenter x:Name="ContentPresenter" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - Content="{TemplateBinding Content}" - ContentTemplate="{TemplateBinding ContentTemplate}" - ContentTransitions="{TemplateBinding ContentTransitions}" - Padding="{TemplateBinding Padding}" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - CornerRadius="{TemplateBinding CornerRadius}"/> + <ScrollViewer + x:Name="ScrollViewer" + AutomationProperties.AccessibilityView="Raw" + HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" + HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" + VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" + VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" + ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"> + <ContentPresenter + x:Name="ContentPresenter" + Padding="{TemplateBinding Padding}" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Content="{TemplateBinding Content}" + ContentTemplate="{TemplateBinding ContentTemplate}" + ContentTransitions="{TemplateBinding ContentTransitions}" + CornerRadius="{TemplateBinding CornerRadius}" /> </ScrollViewer> </ControlTemplate> </Setter.Value> @@ -265,10 +215,44 @@ </Style> </Flyout.FlyoutPresenterStyle> <Grid x:Name="FlyoutRootGrid"> - <Grid x:Name="FlyoutContentGrid"/> + <Grid x:Name="FlyoutContentGrid" /> </Grid> </Flyout> </FlyoutBase.AttachedFlyout> + + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="ItemOnNavigationViewListPositionStates"> + <VisualState x:Name="OnLeftNavigation"> + <VisualState.Setters> + <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnLeftPane}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="OnLeftNavigationReveal"> + <VisualState.Setters> + <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnLeftPaneWithRevealFocus}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="OnTopNavigationPrimary"> + <VisualState.Setters> + <Setter Target="NavigationViewItemPresenter.Margin" Value="{ThemeResource TopNavigationViewItemMargin}" /> + <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPane}" /> + <Setter Target="ChildrenFlyout.Placement" Value="BottomEdgeAlignedLeft" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="OnTopNavigationPrimaryReveal"> + <VisualState.Setters> + <Setter Target="NavigationViewItemPresenter.Margin" Value="{ThemeResource TopNavigationViewItemMargin}" /> + <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPaneWithRevealFocus}" /> + <Setter Target="ChildrenFlyout.Placement" Value="BottomEdgeAlignedLeft" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="OnTopNavigationOverflow"> + <VisualState.Setters> + <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPaneOverflow}" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> </Grid> </ControlTemplate> </Setter.Value> diff --git a/src/Notepads/Resource/CustomRadioButtonStyle.xaml b/src/Notepads/Resource/CustomRadioButtonStyle.xaml index 532f01471..745dd7427 100644 --- a/src/Notepads/Resource/CustomRadioButtonStyle.xaml +++ b/src/Notepads/Resource/CustomRadioButtonStyle.xaml @@ -1,7 +1,9 @@ <ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Notepads"> + <Style BasedOn="{StaticResource CustomRadioButtonStyle}" TargetType="RadioButton" /> + <Style x:Key="CustomRadioButtonStyle" TargetType="RadioButton"> <Setter Property="Background" Value="{ThemeResource RadioButtonBackground}" /> <Setter Property="Foreground" Value="{ThemeResource RadioButtonForeground}" /> @@ -19,7 +21,56 @@ <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="RadioButton"> - <Grid x:Name="RootGrid" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}"> + <Grid + x:Name="RootGrid" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{TemplateBinding CornerRadius}"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="20" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + + <Grid Height="32" VerticalAlignment="Top"> + <Ellipse + x:Name="OuterEllipse" + Width="20" + Height="20" + Fill="{StaticResource RadioButtonOuterEllipseFill}" + Stroke="{ThemeResource RadioButtonOuterEllipseStroke}" + StrokeThickness="{ThemeResource RadioButtonBorderThemeThickness}" + UseLayoutRounding="False" /> + <Ellipse + x:Name="CheckOuterEllipse" + Width="20" + Height="20" + Fill="{ThemeResource RadioButtonOuterEllipseCheckedFill}" + Opacity="0" + Stroke="{ThemeResource RadioButtonOuterEllipseCheckedStroke}" + StrokeThickness="{ThemeResource RadioButtonBorderThemeThickness}" + UseLayoutRounding="False" /> + <Ellipse + x:Name="CheckGlyph" + Width="8" + Height="8" + Fill="{ThemeResource RadioButtonCheckGlyphFill}" + Opacity="0" + Stroke="{ThemeResource RadioButtonCheckGlyphStroke}" + UseLayoutRounding="False" /> + </Grid> + <ContentPresenter + x:Name="ContentPresenter" + Grid.Column="1" + Margin="{TemplateBinding Padding}" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + AutomationProperties.AccessibilityView="Raw" + Content="{TemplateBinding Content}" + ContentTemplate="{TemplateBinding ContentTemplate}" + ContentTransitions="{TemplateBinding ContentTransitions}" + Foreground="{TemplateBinding Foreground}" + TextWrapping="Wrap" /> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal" /> @@ -120,27 +171,27 @@ <VisualStateGroup x:Name="CheckStates"> <VisualState x:Name="Checked"> <Storyboard> - <DoubleAnimation Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Opacity" To="1" Duration="0" /> - <DoubleAnimation Storyboard.TargetName="OuterEllipse" Storyboard.TargetProperty="Opacity" To="0" Duration="0" /> - <DoubleAnimation Storyboard.TargetName="CheckOuterEllipse" Storyboard.TargetProperty="Opacity" To="1" Duration="0" /> + <DoubleAnimation + Storyboard.TargetName="CheckGlyph" + Storyboard.TargetProperty="Opacity" + To="1" + Duration="0" /> + <DoubleAnimation + Storyboard.TargetName="OuterEllipse" + Storyboard.TargetProperty="Opacity" + To="0" + Duration="0" /> + <DoubleAnimation + Storyboard.TargetName="CheckOuterEllipse" + Storyboard.TargetProperty="Opacity" + To="1" + Duration="0" /> </Storyboard> </VisualState> <VisualState x:Name="Unchecked" /> <VisualState x:Name="Indeterminate" /> </VisualStateGroup> </VisualStateManager.VisualStateGroups> - - <Grid.ColumnDefinitions> - <ColumnDefinition Width="20" /> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - - <Grid VerticalAlignment="Top" Height="32"> - <Ellipse x:Name="OuterEllipse" Width="20" Height="20" UseLayoutRounding="False" Stroke="{ThemeResource RadioButtonOuterEllipseStroke}" Fill="{StaticResource RadioButtonOuterEllipseFill}" StrokeThickness="{ThemeResource RadioButtonBorderThemeThickness}" /> - <Ellipse x:Name="CheckOuterEllipse" Width="20" Height="20" UseLayoutRounding="False" Stroke="{ThemeResource RadioButtonOuterEllipseCheckedStroke}" Fill="{ThemeResource RadioButtonOuterEllipseCheckedFill}" Opacity="0" StrokeThickness="{ThemeResource RadioButtonBorderThemeThickness}" /> - <Ellipse x:Name="CheckGlyph" Width="8" Height="8" UseLayoutRounding="False" Opacity="0" Fill="{ThemeResource RadioButtonCheckGlyphFill}" Stroke="{ThemeResource RadioButtonCheckGlyphStroke}" /> - </Grid> - <ContentPresenter x:Name="ContentPresenter" Content="{TemplateBinding Content}" ContentTransitions="{TemplateBinding ContentTransitions}" ContentTemplate="{TemplateBinding ContentTemplate}" Foreground="{TemplateBinding Foreground}" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="1" AutomationProperties.AccessibilityView="Raw" TextWrapping="Wrap" /> </Grid> </ControlTemplate> </Setter.Value> diff --git a/src/Notepads/Resource/CustomSliderStyle.xaml b/src/Notepads/Resource/CustomSliderStyle.xaml index 9d5928662..335d8ca53 100644 --- a/src/Notepads/Resource/CustomSliderStyle.xaml +++ b/src/Notepads/Resource/CustomSliderStyle.xaml @@ -1,7 +1,9 @@ <ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Notepads"> + <Style BasedOn="{StaticResource CustomSliderStyle}" TargetType="Slider" /> + <Style x:Key="CustomSliderStyle" TargetType="Slider"> <Setter Property="Background" Value="{ThemeResource SliderTrackFill}" /> <Setter Property="BorderThickness" Value="{ThemeResource SliderBorderThemeThickness}" /> @@ -18,164 +20,264 @@ <ControlTemplate TargetType="Slider"> <Grid Margin="{TemplateBinding Padding}"> <Grid.Resources> - <Style TargetType="Thumb" x:Key="SliderThumbStyle"> + <Style x:Key="SliderThumbStyle" TargetType="Thumb"> <Setter Property="BorderThickness" Value="0" /> <Setter Property="Background" Value="{ThemeResource SliderThumbBackground}" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Thumb"> - <Border Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="{ThemeResource SliderThumbCornerRadius}" /> + <Border + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{ThemeResource SliderThumbCornerRadius}" /> </ControlTemplate> </Setter.Value> </Setter> </Style> </Grid.Resources> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="*" /> + </Grid.RowDefinitions> + + <ContentPresenter + x:Name="HeaderContentPresenter" + Grid.Row="0" + Margin="{ThemeResource SliderTopHeaderMargin}" + x:DeferLoadStrategy="Lazy" + Content="{TemplateBinding Header}" + ContentTemplate="{TemplateBinding HeaderTemplate}" + FontWeight="{ThemeResource SliderHeaderThemeFontWeight}" + Foreground="{ThemeResource SliderHeaderForeground}" + TextWrapping="Wrap" + Visibility="Collapsed" /> + <Grid + x:Name="SliderContainer" + Grid.Row="1" + Background="{ThemeResource SliderContainerBackground}" + Control.IsTemplateFocusTarget="True"> + <Grid x:Name="HorizontalTemplate" MinHeight="{ThemeResource SliderHorizontalHeight}"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="{ThemeResource SliderPreContentMargin}" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="{ThemeResource SliderPostContentMargin}" /> + </Grid.RowDefinitions> + + <Rectangle + x:Name="HorizontalTrackRect" + Grid.Row="1" + Grid.ColumnSpan="3" + Height="{ThemeResource SliderTrackThemeHeight}" + Fill="{TemplateBinding Background}" + RadiusX="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter}}" + RadiusY="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter}}" /> + <Rectangle + x:Name="HorizontalDecreaseRect" + Grid.Row="1" + Fill="{TemplateBinding Foreground}" + RadiusX="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter}}" + RadiusY="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter}}" /> + <TickBar + x:Name="TopTickBar" + Grid.ColumnSpan="3" + Height="{ThemeResource SliderOutsideTickBarThemeHeight}" + Margin="0,0,0,4" + VerticalAlignment="Bottom" + Fill="{ThemeResource SliderTickBarFill}" + Visibility="Collapsed" /> + <TickBar + x:Name="HorizontalInlineTickBar" + Grid.Row="1" + Grid.ColumnSpan="3" + Height="{ThemeResource SliderTrackThemeHeight}" + Fill="{ThemeResource SliderInlineTickBarFill}" + Visibility="Collapsed" /> + <TickBar + x:Name="BottomTickBar" + Grid.Row="2" + Grid.ColumnSpan="3" + Height="{ThemeResource SliderOutsideTickBarThemeHeight}" + Margin="0,4,0,0" + VerticalAlignment="Top" + Fill="{ThemeResource SliderTickBarFill}" + Visibility="Collapsed" /> + <Thumb + x:Name="HorizontalThumb" + Grid.Row="0" + Grid.RowSpan="3" + Grid.Column="1" + Width="{ThemeResource SliderHorizontalThumbWidth}" + Height="{ThemeResource SliderHorizontalThumbHeight}" + AutomationProperties.AccessibilityView="Raw" + DataContext="{TemplateBinding Value}" + FocusVisualMargin="-14,-6,-14,-6" + Style="{StaticResource SliderThumbStyle}" /> + </Grid> + <Grid + x:Name="VerticalTemplate" + MinWidth="{ThemeResource SliderVerticalWidth}" + Visibility="Collapsed"> + <Grid.RowDefinitions> + <RowDefinition Height="*" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="{ThemeResource SliderPreContentMargin}" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="{ThemeResource SliderPostContentMargin}" /> + </Grid.ColumnDefinitions> + + <Rectangle + x:Name="VerticalTrackRect" + Grid.RowSpan="3" + Grid.Column="1" + Width="{ThemeResource SliderTrackThemeHeight}" + Fill="{TemplateBinding Background}" + RadiusX="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter}}" + RadiusY="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter}}" /> + <Rectangle + x:Name="VerticalDecreaseRect" + Grid.Row="2" + Grid.Column="1" + Fill="{TemplateBinding Foreground}" + RadiusX="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter}}" + RadiusY="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter}}" /> + <TickBar + x:Name="LeftTickBar" + Grid.RowSpan="3" + Width="{ThemeResource SliderOutsideTickBarThemeHeight}" + Margin="0,0,4,0" + HorizontalAlignment="Right" + Fill="{ThemeResource SliderTickBarFill}" + Visibility="Collapsed" /> + <TickBar + x:Name="VerticalInlineTickBar" + Grid.RowSpan="3" + Grid.Column="1" + Width="{ThemeResource SliderTrackThemeHeight}" + Fill="{ThemeResource SliderInlineTickBarFill}" + Visibility="Collapsed" /> + <TickBar + x:Name="RightTickBar" + Grid.RowSpan="3" + Grid.Column="2" + Width="{ThemeResource SliderOutsideTickBarThemeHeight}" + Margin="4,0,0,0" + HorizontalAlignment="Left" + Fill="{ThemeResource SliderTickBarFill}" + Visibility="Collapsed" /> + <Thumb + x:Name="VerticalThumb" + Grid.Row="1" + Grid.Column="0" + Grid.ColumnSpan="3" + Width="{ThemeResource SliderVerticalThumbWidth}" + Height="{ThemeResource SliderVerticalThumbHeight}" + AutomationProperties.AccessibilityView="Raw" + DataContext="{TemplateBinding Value}" + FocusVisualMargin="-6,-14,-6,-14" + Style="{StaticResource SliderThumbStyle}" /> + </Grid> + </Grid> + <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal" /> <VisualState x:Name="Pressed"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderTrackFillPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderTrackFillPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderThumbBackgroundPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderThumbBackgroundPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderContainerBackgroundPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderContainerBackgroundPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderTrackValueFillPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderTrackValueFillPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillPressed}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Disabled"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" - Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderHeaderForegroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderHeaderForegroundDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderTrackValueFillDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderTrackFillDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderTrackValueFillDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderTrackFillDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderThumbBackgroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderThumbBackgroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TopTickBar" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderTickBarFillDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TopTickBar" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTickBarFillDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BottomTickBar" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderTickBarFillDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BottomTickBar" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTickBarFillDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LeftTickBar" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderTickBarFillDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LeftTickBar" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTickBarFillDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RightTickBar" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderTickBarFillDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RightTickBar" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTickBarFillDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderContainerBackgroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderContainerBackgroundDisabled}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="PointerOver"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderTrackFillPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderTrackFillPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderThumbBackgroundPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderThumbBackgroundPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderContainerBackgroundPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderContainerBackgroundPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderTrackValueFillPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SliderTrackValueFillPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillPointerOver}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> @@ -185,164 +287,26 @@ <VisualState x:Name="FocusDisengaged" /> <VisualState x:Name="FocusEngagedHorizontal"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" - Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> <DiscreteObjectKeyFrame KeyTime="0" Value="False" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" - Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> <DiscreteObjectKeyFrame KeyTime="0" Value="True" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="FocusEngagedVertical"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" - Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> <DiscreteObjectKeyFrame KeyTime="0" Value="False" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" - Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> <DiscreteObjectKeyFrame KeyTime="0" Value="True" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> - - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="*" /> - </Grid.RowDefinitions> - - <ContentPresenter x:Name="HeaderContentPresenter" - Grid.Row="0" - Content="{TemplateBinding Header}" - ContentTemplate="{TemplateBinding HeaderTemplate}" - FontWeight="{ThemeResource SliderHeaderThemeFontWeight}" - Foreground="{ThemeResource SliderHeaderForeground}" - Margin="{ThemeResource SliderTopHeaderMargin}" - TextWrapping="Wrap" - Visibility="Collapsed" - x:DeferLoadStrategy="Lazy"/> - <Grid x:Name="SliderContainer" - Grid.Row="1" - Background="{ThemeResource SliderContainerBackground}" - Control.IsTemplateFocusTarget="True"> - <Grid x:Name="HorizontalTemplate" MinHeight="{ThemeResource SliderHorizontalHeight}"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - <Grid.RowDefinitions> - <RowDefinition Height="{ThemeResource SliderPreContentMargin}" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="{ThemeResource SliderPostContentMargin}" /> - </Grid.RowDefinitions> - - <Rectangle x:Name="HorizontalTrackRect" - Fill="{TemplateBinding Background}" - Height="{ThemeResource SliderTrackThemeHeight}" - Grid.Row="1" - Grid.ColumnSpan="3" - RadiusX="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter}}" - RadiusY="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter}}" /> - <Rectangle x:Name="HorizontalDecreaseRect" - Fill="{TemplateBinding Foreground}" - Grid.Row="1" - RadiusX="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter}}" - RadiusY="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter}}" /> - <TickBar x:Name="TopTickBar" - Visibility="Collapsed" - Fill="{ThemeResource SliderTickBarFill}" - Height="{ThemeResource SliderOutsideTickBarThemeHeight}" - VerticalAlignment="Bottom" - Margin="0,0,0,4" - Grid.ColumnSpan="3" /> - <TickBar x:Name="HorizontalInlineTickBar" - Visibility="Collapsed" - Fill="{ThemeResource SliderInlineTickBarFill}" - Height="{ThemeResource SliderTrackThemeHeight}" - Grid.Row="1" - Grid.ColumnSpan="3" /> - <TickBar x:Name="BottomTickBar" - Visibility="Collapsed" - Fill="{ThemeResource SliderTickBarFill}" - Height="{ThemeResource SliderOutsideTickBarThemeHeight}" - VerticalAlignment="Top" - Margin="0,4,0,0" - Grid.Row="2" - Grid.ColumnSpan="3" /> - <Thumb x:Name="HorizontalThumb" - Style="{StaticResource SliderThumbStyle}" - DataContext="{TemplateBinding Value}" - Height="{ThemeResource SliderHorizontalThumbHeight}" - Width="{ThemeResource SliderHorizontalThumbWidth}" - Grid.Row="0" - Grid.RowSpan="3" - Grid.Column="1" - FocusVisualMargin="-14,-6,-14,-6" - AutomationProperties.AccessibilityView="Raw" /> - </Grid> - <Grid x:Name="VerticalTemplate" MinWidth="{ThemeResource SliderVerticalWidth}" Visibility="Collapsed"> - <Grid.RowDefinitions> - <RowDefinition Height="*" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="{ThemeResource SliderPreContentMargin}" /> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="{ThemeResource SliderPostContentMargin}" /> - </Grid.ColumnDefinitions> - - <Rectangle x:Name="VerticalTrackRect" - Fill="{TemplateBinding Background}" - Width="{ThemeResource SliderTrackThemeHeight}" - Grid.Column="1" - Grid.RowSpan="3" - RadiusX="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter}}" - RadiusY="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter}}" /> - <Rectangle x:Name="VerticalDecreaseRect" - Fill="{TemplateBinding Foreground}" - Grid.Column="1" - Grid.Row="2" - RadiusX="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter}}" - RadiusY="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter}}" /> - <TickBar x:Name="LeftTickBar" - Visibility="Collapsed" - Fill="{ThemeResource SliderTickBarFill}" - Width="{ThemeResource SliderOutsideTickBarThemeHeight}" - HorizontalAlignment="Right" - Margin="0,0,4,0" - Grid.RowSpan="3" /> - <TickBar x:Name="VerticalInlineTickBar" - Visibility="Collapsed" - Fill="{ThemeResource SliderInlineTickBarFill}" - Width="{ThemeResource SliderTrackThemeHeight}" - Grid.Column="1" - Grid.RowSpan="3" /> - <TickBar x:Name="RightTickBar" - Visibility="Collapsed" - Fill="{ThemeResource SliderTickBarFill}" - Width="{ThemeResource SliderOutsideTickBarThemeHeight}" - HorizontalAlignment="Left" - Margin="4,0,0,0" - Grid.Column="2" - Grid.RowSpan="3" /> - <Thumb x:Name="VerticalThumb" - Style="{StaticResource SliderThumbStyle}" - DataContext="{TemplateBinding Value}" - Width="{ThemeResource SliderVerticalThumbWidth}" - Height="{ThemeResource SliderVerticalThumbHeight}" - Grid.Row="1" - Grid.Column="0" - Grid.ColumnSpan="3" - FocusVisualMargin="-6,-14,-6,-14" - AutomationProperties.AccessibilityView="Raw" /> - </Grid> - </Grid> </Grid> </ControlTemplate> </Setter.Value> diff --git a/src/Notepads/Resource/CustomSplitViewStyle.xaml b/src/Notepads/Resource/CustomSplitViewStyle.xaml index 04c27c01d..9aa466fd6 100644 --- a/src/Notepads/Resource/CustomSplitViewStyle.xaml +++ b/src/Notepads/Resource/CustomSplitViewStyle.xaml @@ -1,575 +1,700 @@ <ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="using:Notepads"> <Style x:Key="CustomSplitViewStyle" TargetType="SplitView"> - <Setter Property="HorizontalContentAlignment" Value="Stretch"/> - <Setter Property="VerticalContentAlignment" Value="Stretch"/> - <Setter Property="OpenPaneLength" Value="{ThemeResource SplitViewOpenPaneThemeLength}"/> - <Setter Property="CompactPaneLength" Value="{ThemeResource SplitViewCompactPaneThemeLength}"/> - <Setter Property="PaneBackground" Value="{ThemeResource SystemControlPageBackgroundChromeLowBrush}"/> + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> + <Setter Property="VerticalContentAlignment" Value="Stretch" /> + <Setter Property="OpenPaneLength" Value="{ThemeResource SplitViewOpenPaneThemeLength}" /> + <Setter Property="CompactPaneLength" Value="{ThemeResource SplitViewCompactPaneThemeLength}" /> + <Setter Property="PaneBackground" Value="{ThemeResource SystemControlPageBackgroundChromeLowBrush}" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="SplitView"> <Grid Background="{TemplateBinding Background}"> <Grid.ColumnDefinitions> - <ColumnDefinition x:Name="ColumnDefinition1" Width="{Binding TemplateSettings.OpenPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> - <ColumnDefinition x:Name="ColumnDefinition2" Width="*"/> + <ColumnDefinition x:Name="ColumnDefinition1" Width="{Binding TemplateSettings.OpenPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> + <ColumnDefinition x:Name="ColumnDefinition2" Width="*" /> </Grid.ColumnDefinitions> + <Grid + x:Name="PaneRoot" + Grid.ColumnSpan="2" + Width="{Binding TemplateSettings.OpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" + Margin="0,32,0,1" + HorizontalAlignment="Left" + Background="{TemplateBinding PaneBackground}" + Canvas.ZIndex="1" + Visibility="Collapsed"> + <Grid.BackgroundTransition> + <BrushTransition /> + </Grid.BackgroundTransition> + <Grid.Clip> + <RectangleGeometry x:Name="PaneClipRectangle"> + <RectangleGeometry.Transform> + <CompositeTransform x:Name="PaneClipRectangleTransform" /> + </RectangleGeometry.Transform> + </RectangleGeometry> + </Grid.Clip> + <Grid.RenderTransform> + <CompositeTransform x:Name="PaneTransform" /> + </Grid.RenderTransform> + <Border Child="{TemplateBinding Pane}" /> + <Rectangle + x:Name="HCPaneBorder" + Width="1" + HorizontalAlignment="Right" + x:DeferLoadStrategy="Lazy" + Fill="{ThemeResource SystemControlForegroundTransparentBrush}" + Visibility="Collapsed" /> + </Grid> + <Grid x:Name="ContentRoot" Grid.ColumnSpan="2"> + <Grid.RenderTransform> + <CompositeTransform x:Name="ContentTransform" /> + </Grid.RenderTransform> + <Border Child="{TemplateBinding Content}" /> + <Rectangle + x:Name="LightDismissLayer" + Fill="Transparent" + Visibility="Collapsed" /> + </Grid> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="DisplayModeStates"> <VisualStateGroup.Transitions> <VisualTransition From="Closed" To="OpenOverlayLeft"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneTransform" Storyboard.TargetProperty="TranslateX"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.NegativeOpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.35" Value="0"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.NegativeOpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.35" + Value="0" /> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneClipRectangleTransform" Storyboard.TargetProperty="TranslateX"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.OpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.35" Value="0"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.OpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.35" + Value="0" /> </DoubleAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Opacity"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.0"/> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.35" Value="1.0"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.0" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.35" + Value="1.0" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualTransition> <VisualTransition From="Closed" To="OpenOverlayRight"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="HorizontalAlignment"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Right"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Right" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="HorizontalAlignment"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Left"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Left" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneTransform" Storyboard.TargetProperty="TranslateX"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.OpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.35" Value="0"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.OpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.35" + Value="0" /> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneClipRectangleTransform" Storyboard.TargetProperty="TranslateX"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.NegativeOpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.35" Value="0"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.NegativeOpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.35" + Value="0" /> </DoubleAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Opacity"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.0"/> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.35" Value="1.0"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.0" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.35" + Value="1.0" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualTransition> <VisualTransition From="ClosedCompactLeft" To="OpenCompactOverlayLeft"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColumnDefinition1" Storyboard.TargetProperty="Width"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.Column)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneClipRectangleTransform" Storyboard.TargetProperty="TranslateX"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.NegativeOpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.35" Value="0"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.NegativeOpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.35" + Value="0" /> </DoubleAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Opacity"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.0"/> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.35" Value="1.0"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.0" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.35" + Value="1.0" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualTransition> <VisualTransition From="ClosedCompactRight" To="OpenCompactOverlayRight"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColumnDefinition1" Storyboard.TargetProperty="Width"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="*"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="*" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColumnDefinition2" Storyboard.TargetProperty="Width"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="HorizontalAlignment"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Right"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Right" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="HorizontalAlignment"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Left"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Left" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneClipRectangleTransform" Storyboard.TargetProperty="TranslateX"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.OpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.35" Value="0"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.OpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.35" + Value="0" /> </DoubleAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Opacity"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.0"/> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.35" Value="1.0"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.0" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.35" + Value="1.0" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualTransition> <VisualTransition From="OpenOverlayLeft" To="Closed"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneTransform" Storyboard.TargetProperty="TranslateX"> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.12" Value="{Binding TemplateSettings.NegativeOpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.12" + Value="{Binding TemplateSettings.NegativeOpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneClipRectangleTransform" Storyboard.TargetProperty="TranslateX"> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.12" Value="{Binding TemplateSettings.OpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.12" + Value="{Binding TemplateSettings.OpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Opacity"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="1.0"/> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.12" Value="0.0"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="1.0" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.12" + Value="0.0" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualTransition> <VisualTransition From="OpenOverlayRight" To="Closed"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="HorizontalAlignment"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Right"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Right" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="HorizontalAlignment"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Left"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Left" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneTransform" Storyboard.TargetProperty="TranslateX"> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.12" Value="{Binding TemplateSettings.OpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.12" + Value="{Binding TemplateSettings.OpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneClipRectangleTransform" Storyboard.TargetProperty="TranslateX"> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.12" Value="{Binding TemplateSettings.NegativeOpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.12" + Value="{Binding TemplateSettings.NegativeOpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Opacity"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="1.0"/> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.12" Value="0.0"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="1.0" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.12" + Value="0.0" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualTransition> <VisualTransition From="OpenCompactOverlayLeft" To="ClosedCompactLeft"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColumnDefinition1" Storyboard.TargetProperty="Width"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.Column)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneClipRectangleTransform" Storyboard.TargetProperty="TranslateX"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.12" Value="{Binding TemplateSettings.NegativeOpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.12" + Value="{Binding TemplateSettings.NegativeOpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Opacity"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="1.0"/> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.12" Value="0.0"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="1.0" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.12" + Value="0.0" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualTransition> <VisualTransition From="OpenCompactOverlayRight" To="ClosedCompactRight"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColumnDefinition1" Storyboard.TargetProperty="Width"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="*"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="*" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColumnDefinition2" Storyboard.TargetProperty="Width"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="HorizontalAlignment"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Right"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Right" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="HorizontalAlignment"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Left"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Left" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneClipRectangleTransform" Storyboard.TargetProperty="TranslateX"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.12" Value="{Binding TemplateSettings.OpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.12" + Value="{Binding TemplateSettings.OpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Opacity"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="1.0"/> - <SplineDoubleKeyFrame KeySpline="0.1,0.9 0.2,1.0" KeyTime="0:0:0.12" Value="0.0"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="1.0" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.12" + Value="0.0" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualTransition> <VisualTransition From="OpenInlineLeft" To="Closed"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="{StaticResource SplitViewPaneAnimationCloseDuration}" Value="Collapsed"/> + <DiscreteObjectKeyFrame KeyTime="{StaticResource SplitViewPaneAnimationCloseDuration}" Value="Collapsed" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="{StaticResource SplitViewPaneAnimationCloseDuration}" Value="Collapsed"/> + <DiscreteObjectKeyFrame KeyTime="{StaticResource SplitViewPaneAnimationCloseDuration}" Value="Collapsed" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="0" Value="2"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="2" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.Column)"> - <DiscreteObjectKeyFrame KeyTime="0" Value="0"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="{StaticResource SplitViewPaneAnimationCloseDuration}" Value="2"/> + <DiscreteObjectKeyFrame KeyTime="{StaticResource SplitViewPaneAnimationCloseDuration}" Value="2" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneClipRectangleTransform" Storyboard.TargetProperty="TranslateX"> - <SplineDoubleKeyFrame KeySpline="0.0,0.35 0.15,1.0" KeyTime="{StaticResource SplitViewPaneAnimationCloseDuration}" Value="{Binding TemplateSettings.NegativeOpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <SplineDoubleKeyFrame + KeySpline="0.0,0.35 0.15,1.0" + KeyTime="{StaticResource SplitViewPaneAnimationCloseDuration}" + Value="{Binding TemplateSettings.NegativeOpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneTransform" Storyboard.TargetProperty="TranslateX"> - <SplineDoubleKeyFrame KeySpline="0.0,0.35 0.15,1.0" KeyTime="{StaticResource SplitViewPaneAnimationCloseDuration}" Value="{Binding TemplateSettings.NegativeOpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <SplineDoubleKeyFrame + KeySpline="0.0,0.35 0.15,1.0" + KeyTime="{StaticResource SplitViewPaneAnimationCloseDuration}" + Value="{Binding TemplateSettings.NegativeOpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ContentTransform" Storyboard.TargetProperty="TranslateX"> - <DiscreteDoubleKeyFrame KeyTime="0" Value="{Binding TemplateSettings.OpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> - <SplineDoubleKeyFrame KeySpline="0.0,0.35 0.15,1.0" KeyTime="{StaticResource SplitViewPaneAnimationCloseDuration}" Value="0"/> + <DiscreteDoubleKeyFrame KeyTime="0" Value="{Binding TemplateSettings.OpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> + <SplineDoubleKeyFrame + KeySpline="0.0,0.35 0.15,1.0" + KeyTime="{StaticResource SplitViewPaneAnimationCloseDuration}" + Value="0" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualTransition> <VisualTransition From="Closed" To="OpenInlineLeft"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.Column)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneTransform" Storyboard.TargetProperty="TranslateX"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.NegativeOpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> - <SplineDoubleKeyFrame KeySpline="0.0,0.35 0.15,1.0" KeyTime="{StaticResource SplitViewPaneAnimationOpenDuration}" Value="0"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.NegativeOpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> + <SplineDoubleKeyFrame + KeySpline="0.0,0.35 0.15,1.0" + KeyTime="{StaticResource SplitViewPaneAnimationOpenDuration}" + Value="0" /> </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames FillBehavior="Stop" Storyboard.TargetName="ContentTransform" Storyboard.TargetProperty="TranslateX"> - <LinearDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.NegativeOpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> - <SplineDoubleKeyFrame KeySpline="0.0,0.35 0.15,1.0" KeyTime="{StaticResource SplitViewPaneAnimationOpenPreDuration}" Value="0"/> + <DoubleAnimationUsingKeyFrames + FillBehavior="Stop" + Storyboard.TargetName="ContentTransform" + Storyboard.TargetProperty="TranslateX"> + <LinearDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.NegativeOpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> + <SplineDoubleKeyFrame + KeySpline="0.0,0.35 0.15,1.0" + KeyTime="{StaticResource SplitViewPaneAnimationOpenPreDuration}" + Value="0" /> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneClipRectangleTransform" Storyboard.TargetProperty="TranslateX"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.NegativeOpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> - <SplineDoubleKeyFrame KeySpline="0.0,0.35 0.15,1.0" KeyTime="{StaticResource SplitViewPaneAnimationOpenDuration}" Value="0"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.NegativeOpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> + <SplineDoubleKeyFrame + KeySpline="0.0,0.35 0.15,1.0" + KeyTime="{StaticResource SplitViewPaneAnimationOpenDuration}" + Value="0" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualTransition> <VisualTransition From="ClosedCompactLeft" To="OpenInlineLeft"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.Column)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> - </ObjectAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames FillBehavior="Stop" Storyboard.TargetName="ContentTransform" Storyboard.TargetProperty="TranslateX"> - <LinearDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.NegativeOpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> - <SplineDoubleKeyFrame KeySpline="0.0,0.35 0.15,1.0" KeyTime="{StaticResource SplitViewPaneAnimationOpenPreDuration}" Value="0"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> + </ObjectAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames + FillBehavior="Stop" + Storyboard.TargetName="ContentTransform" + Storyboard.TargetProperty="TranslateX"> + <LinearDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.NegativeOpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> + <SplineDoubleKeyFrame + KeySpline="0.0,0.35 0.15,1.0" + KeyTime="{StaticResource SplitViewPaneAnimationOpenPreDuration}" + Value="0" /> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneClipRectangleTransform" Storyboard.TargetProperty="TranslateX"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.NegativeOpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> - <SplineDoubleKeyFrame KeySpline="0.0,0.35 0.15,1.0" KeyTime="{StaticResource SplitViewPaneAnimationOpenDuration}" Value="0"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.NegativeOpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> + <SplineDoubleKeyFrame + KeySpline="0.0,0.35 0.15,1.0" + KeyTime="{StaticResource SplitViewPaneAnimationOpenDuration}" + Value="0" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualTransition> <VisualTransition From="OpenInlineLeft" To="ClosedCompactLeft"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColumnDefinition1" Storyboard.TargetProperty="Width"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.Column)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> - </ObjectAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames FillBehavior="Stop" Storyboard.TargetName="ContentTransform" Storyboard.TargetProperty="TranslateX"> - <LinearDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.OpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> - <SplineDoubleKeyFrame KeySpline="0.0,0.35 0.15,1.0" KeyTime="{StaticResource SplitViewPaneAnimationOpenPreDuration}" Value=""/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> + </ObjectAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames + FillBehavior="Stop" + Storyboard.TargetName="ContentTransform" + Storyboard.TargetProperty="TranslateX"> + <LinearDoubleKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.OpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> + <SplineDoubleKeyFrame + KeySpline="0.0,0.35 0.15,1.0" + KeyTime="{StaticResource SplitViewPaneAnimationOpenPreDuration}" + Value="" /> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneClipRectangleTransform" Storyboard.TargetProperty="TranslateX"> - <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/> - <SplineDoubleKeyFrame KeySpline="0.0,0.35 0.15,1.0" KeyTime="{StaticResource SplitViewPaneAnimationOpenDuration}" Value="{Binding TemplateSettings.NegativeOpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0" /> + <SplineDoubleKeyFrame + KeySpline="0.0,0.35 0.15,1.0" + KeyTime="{StaticResource SplitViewPaneAnimationOpenDuration}" + Value="{Binding TemplateSettings.NegativeOpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualTransition> </VisualStateGroup.Transitions> - <VisualState x:Name="Closed"/> + <VisualState x:Name="Closed" /> <VisualState x:Name="ClosedCompactLeft"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColumnDefinition1" Storyboard.TargetProperty="Width"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.Column)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> - <DoubleAnimation Duration="0:0:0" Storyboard.TargetName="PaneClipRectangleTransform" Storyboard.TargetProperty="TranslateX" To="{Binding TemplateSettings.NegativeOpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <DoubleAnimation + Storyboard.TargetName="PaneClipRectangleTransform" + Storyboard.TargetProperty="TranslateX" + To="{Binding TemplateSettings.NegativeOpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" + Duration="0:0:0" /> </Storyboard> </VisualState> <VisualState x:Name="ClosedCompactRight"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColumnDefinition1" Storyboard.TargetProperty="Width"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="*"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="*" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColumnDefinition2" Storyboard.TargetProperty="Width"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="2"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="2" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="HorizontalAlignment"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Right"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Right" /> </ObjectAnimationUsingKeyFrames> - <DoubleAnimation Duration="0:0:0" Storyboard.TargetName="PaneClipRectangleTransform" Storyboard.TargetProperty="TranslateX" To="{Binding TemplateSettings.OpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <DoubleAnimation + Storyboard.TargetName="PaneClipRectangleTransform" + Storyboard.TargetProperty="TranslateX" + To="{Binding TemplateSettings.OpenPaneLengthMinusCompactLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" + Duration="0:0:0" /> </Storyboard> </VisualState> <VisualState x:Name="OpenOverlayLeft"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="OpenOverlayRight"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="HorizontalAlignment"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Right"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Right" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="HorizontalAlignment"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Left"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Left" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="OpenInlineLeft"> <VisualState.Setters> - <Setter Target="PaneRoot.Visibility" Value="Visible"/> - <Setter Target="HCPaneBorder.Visibility" Value="Visible"/> - <Setter Target="ContentRoot.Grid.ColumnSpan" Value="1"/> - <Setter Target="ContentRoot.Grid.Column" Value="1"/> - <Setter Target="PaneRoot.Grid.ColumnSpan" Value="1"/> - <Setter Target="PaneTransform.TranslateX" Value="0"/> - <Setter Target="ContentTransform.TranslateX" Value="0"/> - <Setter Target="PaneClipRectangleTransform.TranslateX" Value="0"/> + <Setter Target="PaneRoot.Visibility" Value="Visible" /> + <Setter Target="HCPaneBorder.Visibility" Value="Visible" /> + <Setter Target="ContentRoot.Grid.ColumnSpan" Value="1" /> + <Setter Target="ContentRoot.Grid.Column" Value="1" /> + <Setter Target="PaneRoot.Grid.ColumnSpan" Value="1" /> + <Setter Target="PaneTransform.TranslateX" Value="0" /> + <Setter Target="ContentTransform.TranslateX" Value="0" /> + <Setter Target="PaneClipRectangleTransform.TranslateX" Value="0" /> </VisualState.Setters> </VisualState> <VisualState x:Name="OpenInlineRight"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColumnDefinition1" Storyboard.TargetProperty="Width"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="*"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="*" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColumnDefinition2" Storyboard.TargetProperty="Width"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.OpenPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.OpenPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="(Grid.Column)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="HorizontalAlignment"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Left"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Left" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="OpenCompactOverlayLeft"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColumnDefinition1" Storyboard.TargetProperty="Width"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.Column)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="OpenCompactOverlayRight"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColumnDefinition1" Storyboard.TargetProperty="Width"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="*"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="*" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColumnDefinition2" Storyboard.TargetProperty="Width"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding TemplateSettings.CompactPaneGridLength, FallbackValue=0, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(Grid.ColumnSpan)"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneRoot" Storyboard.TargetProperty="HorizontalAlignment"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Right"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Right" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="HorizontalAlignment"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Left"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Left" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HCPaneBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> <VisualStateGroup x:Name="OverlayVisibilityStates"> - <VisualState x:Name="OverlayNotVisible"/> + <VisualState x:Name="OverlayNotVisible" /> <VisualState x:Name="OverlayVisible"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LightDismissLayer" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{ThemeResource SplitViewLightDismissOverlayBackground}"/> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{ThemeResource SplitViewLightDismissOverlayBackground}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> - <Grid x:Name="PaneRoot" Margin="0,32,0,1" Background="{TemplateBinding PaneBackground}" Grid.ColumnSpan="2" HorizontalAlignment="Left" Visibility="Collapsed" Width="{Binding TemplateSettings.OpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" Canvas.ZIndex="1"> - <Grid.BackgroundTransition> - <BrushTransition/> - </Grid.BackgroundTransition> - <Grid.Clip> - <RectangleGeometry x:Name="PaneClipRectangle"> - <RectangleGeometry.Transform> - <CompositeTransform x:Name="PaneClipRectangleTransform"/> - </RectangleGeometry.Transform> - </RectangleGeometry> - </Grid.Clip> - <Grid.RenderTransform> - <CompositeTransform x:Name="PaneTransform"/> - </Grid.RenderTransform> - <Border Child="{TemplateBinding Pane}"/> - <Rectangle x:Name="HCPaneBorder" Fill="{ThemeResource SystemControlForegroundTransparentBrush}" HorizontalAlignment="Right" Visibility="Collapsed" Width="1" x:DeferLoadStrategy="Lazy"/> - </Grid> - <Grid x:Name="ContentRoot" Grid.ColumnSpan="2"> - <Grid.RenderTransform> - <CompositeTransform x:Name="ContentTransform"/> - </Grid.RenderTransform> - <Border Child="{TemplateBinding Content}"/> - <Rectangle x:Name="LightDismissLayer" Fill="Transparent" Visibility="Collapsed"/> - </Grid> </Grid> </ControlTemplate> </Setter.Value> diff --git a/src/Notepads/Resource/CustomToggleSwitchStyle.xaml b/src/Notepads/Resource/CustomToggleSwitchStyle.xaml index 945e8bbdb..c3d5ce571 100644 --- a/src/Notepads/Resource/CustomToggleSwitchStyle.xaml +++ b/src/Notepads/Resource/CustomToggleSwitchStyle.xaml @@ -1,6 +1,9 @@ -<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:local="using:Notepads" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> +<ResourceDictionary + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="using:Notepads"> + <Style BasedOn="{StaticResource CustomToggleSwitchStyle}" TargetType="ToggleSwitch" /> + <Style x:Key="CustomToggleSwitchStyle" TargetType="ToggleSwitch"> <Setter Property="Foreground" Value="{ThemeResource ToggleSwitchContentForeground}" /> <Setter Property="HorizontalAlignment" Value="Left" /> @@ -14,143 +17,215 @@ <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ToggleSwitch"> - <Grid Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="{TemplateBinding CornerRadius}"> + <Grid + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{TemplateBinding CornerRadius}"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="*" /> + </Grid.RowDefinitions> + + <ContentPresenter + x:Name="HeaderContentPresenter" + Grid.Row="0" + Margin="{ThemeResource ToggleSwitchTopHeaderMargin}" + VerticalAlignment="Top" + x:DeferLoadStrategy="Lazy" + AutomationProperties.AccessibilityView="Raw" + Content="{TemplateBinding Header}" + ContentTemplate="{TemplateBinding HeaderTemplate}" + Foreground="{ThemeResource ToggleSwitchHeaderForeground}" + IsHitTestVisible="False" + TextWrapping="Wrap" + Visibility="Collapsed" /> + <Grid + Grid.Row="1" + MinWidth="{StaticResource ToggleSwitchThemeMinWidth}" + HorizontalAlignment="Left" + VerticalAlignment="Top"> + <Grid.RowDefinitions> + <RowDefinition Height="{ThemeResource ToggleSwitchPreContentMargin}" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="{ThemeResource ToggleSwitchPostContentMargin}" /> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="12" MaxWidth="12" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + + <Grid + x:Name="SwitchAreaGrid" + Grid.RowSpan="3" + Grid.ColumnSpan="3" + Margin="0,5" + Background="{ThemeResource ToggleSwitchContainerBackground}" + Control.IsTemplateFocusTarget="True" /> + <ContentPresenter + x:Name="OffContentPresenter" + Grid.RowSpan="3" + Grid.Column="2" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + AutomationProperties.AccessibilityView="Raw" + Content="{TemplateBinding OffContent}" + ContentTemplate="{TemplateBinding OffContentTemplate}" + Foreground="{TemplateBinding Foreground}" + IsHitTestVisible="False" + Opacity="0" /> + <ContentPresenter + x:Name="OnContentPresenter" + Grid.RowSpan="3" + Grid.Column="2" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + AutomationProperties.AccessibilityView="Raw" + Content="{TemplateBinding OnContent}" + ContentTemplate="{TemplateBinding OnContentTemplate}" + Foreground="{TemplateBinding Foreground}" + IsHitTestVisible="False" + Opacity="0" /> + <Rectangle + x:Name="OuterBorder" + Grid.Row="1" + Width="40" + Height="20" + Fill="{ThemeResource ToggleSwitchFillOff}" + RadiusX="10" + RadiusY="10" + Stroke="{ThemeResource ToggleSwitchStrokeOff}" + StrokeThickness="{ThemeResource ToggleSwitchOuterBorderStrokeThickness}" /> + <Rectangle + x:Name="SwitchKnobBounds" + Grid.Row="1" + Width="40" + Height="20" + Fill="{ThemeResource ToggleSwitchFillOn}" + Opacity="0" + RadiusX="10" + RadiusY="10" + Stroke="{ThemeResource ToggleSwitchStrokeOn}" + StrokeThickness="{ThemeResource ToggleSwitchOnStrokeThickness}" /> + <Grid + x:Name="SwitchKnob" + Grid.Row="1" + Width="20" + Height="20" + HorizontalAlignment="Left"> + <Ellipse + x:Name="SwitchKnobOn" + Width="10" + Height="10" + Fill="{ThemeResource ToggleSwitchKnobFillOn}" + Opacity="0" /> + <Ellipse + x:Name="SwitchKnobOff" + Width="10" + Height="10" + Fill="{ThemeResource ToggleSwitchKnobFillOff}" /> + <Grid.RenderTransform> + <TranslateTransform x:Name="KnobTranslateTransform" /> + </Grid.RenderTransform> + </Grid> + <Thumb + x:Name="SwitchThumb" + Grid.RowSpan="3" + Grid.ColumnSpan="3" + AutomationProperties.AccessibilityView="Raw"> + <Thumb.Template> + <ControlTemplate TargetType="Thumb"> + <Rectangle Fill="Transparent" /> + </ControlTemplate> + </Thumb.Template> + </Thumb> + </Grid> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal" /> <VisualState x:Name="PointerOver"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" - Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchStrokeOffPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Stroke"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOffPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchFillOffPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOffPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchKnobFillOffPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOffPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchKnobFillOnPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOnPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchFillOnPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOnPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" - Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchStrokeOnPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Stroke"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOnPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchContainerBackgroundPointerOver}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContainerBackgroundPointerOver}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Pressed"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" - Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchStrokeOffPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Stroke"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOffPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchFillOffPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOffPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchFillOnPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOnPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" - Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchStrokeOnPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Stroke"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOnPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchKnobFillOffPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOffPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchKnobFillOnPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOnPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchContainerBackgroundPressed}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContainerBackgroundPressed}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Disabled"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" - Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchHeaderForegroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchHeaderForegroundDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OffContentPresenter" - Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchContentForegroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OffContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContentForegroundDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OnContentPresenter" - Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchContentForegroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OnContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContentForegroundDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" - Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchStrokeOffDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Stroke"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOffDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchFillOffDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOffDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchFillOnDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOnDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" - Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchStrokeOnDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Stroke"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOnDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchKnobFillOffDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOffDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" - Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchKnobFillOnDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Fill"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOnDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource ToggleSwitchContainerBackgroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContainerBackgroundDisabled}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> @@ -158,82 +233,88 @@ <VisualStateGroup x:Name="ToggleStates"> <VisualStateGroup.Transitions> - <VisualTransition x:Name="DraggingToOnTransition" From="Dragging" To="On" GeneratedDuration="0"> + <VisualTransition + x:Name="DraggingToOnTransition" + GeneratedDuration="0" + From="Dragging" + To="On"> <Storyboard> - <RepositionThemeAnimation TargetName="SwitchKnob" FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobCurrentToOnOffset}" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" - Storyboard.TargetProperty="Opacity"> + <RepositionThemeAnimation FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobCurrentToOnOffset}" TargetName="SwitchKnob" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" - Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" - Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" - Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualTransition> - <VisualTransition x:Name="OnToDraggingTransition" From="On" To="Dragging" GeneratedDuration="0"> + <VisualTransition + x:Name="OnToDraggingTransition" + GeneratedDuration="0" + From="On" + To="Dragging"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" - Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" - Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" - Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualTransition> - <VisualTransition x:Name="DraggingToOffTransition" From="Dragging" To="Off" GeneratedDuration="0"> + <VisualTransition + x:Name="DraggingToOffTransition" + GeneratedDuration="0" + From="Dragging" + To="Off"> <Storyboard> - <RepositionThemeAnimation TargetName="SwitchKnob" FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobCurrentToOffOffset}" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" - Storyboard.TargetProperty="Opacity"> + <RepositionThemeAnimation FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobCurrentToOffOffset}" TargetName="SwitchKnob" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" - Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" - Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualTransition> - <VisualTransition x:Name="OnToOffTransition" From="On" To="Off" GeneratedDuration="0"> + <VisualTransition + x:Name="OnToOffTransition" + GeneratedDuration="0" + From="On" + To="Off"> <Storyboard> - <RepositionThemeAnimation TargetName="SwitchKnob" FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobOnToOffOffset}" /> + <RepositionThemeAnimation FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobOnToOffOffset}" TargetName="SwitchKnob" /> </Storyboard> </VisualTransition> - <VisualTransition x:Name="OffToOnTransition" From="Off" To="On" GeneratedDuration="0"> + <VisualTransition + x:Name="OffToOnTransition" + GeneratedDuration="0" + From="Off" + To="On"> <Storyboard> - <RepositionThemeAnimation TargetName="SwitchKnob" FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobOffToOnOffset}" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" - Storyboard.TargetProperty="Opacity"> + <RepositionThemeAnimation FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobOffToOnOffset}" TargetName="SwitchKnob" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" - Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" - Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" - Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> </Storyboard> @@ -243,24 +324,21 @@ <VisualState x:Name="Off" /> <VisualState x:Name="On"> <Storyboard> - <DoubleAnimation Storyboard.TargetName="KnobTranslateTransform" + <DoubleAnimation + Storyboard.TargetName="KnobTranslateTransform" Storyboard.TargetProperty="X" To="20" Duration="0" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" - Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" - Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" - Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" - Storyboard.TargetProperty="Opacity"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Opacity"> <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> </ObjectAnimationUsingKeyFrames> </Storyboard> @@ -270,12 +348,12 @@ <VisualStateGroup x:Name="ContentStates"> <VisualState x:Name="OffContent"> <Storyboard> - <DoubleAnimation Storyboard.TargetName="OffContentPresenter" - Storyboard.TargetProperty="Opacity" - To="1" - Duration="0" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" - Storyboard.TargetName="OffContentPresenter"> + <DoubleAnimation + Storyboard.TargetName="OffContentPresenter" + Storyboard.TargetProperty="Opacity" + To="1" + Duration="0" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OffContentPresenter" Storyboard.TargetProperty="IsHitTestVisible"> <DiscreteObjectKeyFrame KeyTime="0"> <DiscreteObjectKeyFrame.Value> <x:Boolean>True</x:Boolean> @@ -286,12 +364,12 @@ </VisualState> <VisualState x:Name="OnContent"> <Storyboard> - <DoubleAnimation Storyboard.TargetName="OnContentPresenter" - Storyboard.TargetProperty="Opacity" - To="1" - Duration="0" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" - Storyboard.TargetName="OnContentPresenter"> + <DoubleAnimation + Storyboard.TargetName="OnContentPresenter" + Storyboard.TargetProperty="Opacity" + To="1" + Duration="0" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OnContentPresenter" Storyboard.TargetProperty="IsHitTestVisible"> <DiscreteObjectKeyFrame KeyTime="0"> <DiscreteObjectKeyFrame.Value> <x:Boolean>True</x:Boolean> @@ -302,115 +380,6 @@ </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> - - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="*" /> - </Grid.RowDefinitions> - - <ContentPresenter x:Name="HeaderContentPresenter" - x:DeferLoadStrategy="Lazy" - Grid.Row="0" - Content="{TemplateBinding Header}" - ContentTemplate="{TemplateBinding HeaderTemplate}" - Foreground="{ThemeResource ToggleSwitchHeaderForeground}" - IsHitTestVisible="False" - Margin="{ThemeResource ToggleSwitchTopHeaderMargin}" - TextWrapping="Wrap" - VerticalAlignment="Top" - Visibility="Collapsed" - AutomationProperties.AccessibilityView="Raw" /> - <Grid Grid.Row="1" - MinWidth="{StaticResource ToggleSwitchThemeMinWidth}" - HorizontalAlignment="Left" - VerticalAlignment="Top"> - <Grid.RowDefinitions> - <RowDefinition Height="{ThemeResource ToggleSwitchPreContentMargin}" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="{ThemeResource ToggleSwitchPostContentMargin}" /> - </Grid.RowDefinitions> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="12" MaxWidth="12" /> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> - - <Grid x:Name="SwitchAreaGrid" - Grid.RowSpan="3" - Grid.ColumnSpan="3" - Margin="0,5" - Control.IsTemplateFocusTarget="True" - Background="{ThemeResource ToggleSwitchContainerBackground}" /> - <ContentPresenter x:Name="OffContentPresenter" - Grid.RowSpan="3" - Grid.Column="2" - Opacity="0" - Foreground="{TemplateBinding Foreground}" - IsHitTestVisible="False" - Content="{TemplateBinding OffContent}" - ContentTemplate="{TemplateBinding OffContentTemplate}" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - AutomationProperties.AccessibilityView="Raw" /> - <ContentPresenter x:Name="OnContentPresenter" - Grid.RowSpan="3" - Grid.Column="2" - Opacity="0" - Foreground="{TemplateBinding Foreground}" - IsHitTestVisible="False" - Content="{TemplateBinding OnContent}" - ContentTemplate="{TemplateBinding OnContentTemplate}" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - AutomationProperties.AccessibilityView="Raw" /> - <Rectangle x:Name="OuterBorder" - Grid.Row="1" - Height="20" - Width="40" - RadiusX="10" - RadiusY="10" - Fill="{ThemeResource ToggleSwitchFillOff}" - Stroke="{ThemeResource ToggleSwitchStrokeOff}" - StrokeThickness="{ThemeResource ToggleSwitchOuterBorderStrokeThickness}" /> - <Rectangle x:Name="SwitchKnobBounds" - Grid.Row="1" - Height="20" - Width="40" - RadiusX="10" - RadiusY="10" - Fill="{ThemeResource ToggleSwitchFillOn}" - Stroke="{ThemeResource ToggleSwitchStrokeOn}" - StrokeThickness="{ThemeResource ToggleSwitchOnStrokeThickness}" - Opacity="0" /> - <Grid x:Name="SwitchKnob" - Grid.Row="1" - HorizontalAlignment="Left" - Width="20" - Height="20"> - <Ellipse x:Name="SwitchKnobOn" - Fill="{ThemeResource ToggleSwitchKnobFillOn}" - Width="10" - Height="10" - Opacity="0" /> - <Ellipse x:Name="SwitchKnobOff" - Fill="{ThemeResource ToggleSwitchKnobFillOff}" - Width="10" - Height="10" /> - <Grid.RenderTransform> - <TranslateTransform x:Name="KnobTranslateTransform" /> - </Grid.RenderTransform> - </Grid> - <Thumb x:Name="SwitchThumb" - AutomationProperties.AccessibilityView="Raw" - Grid.RowSpan="3" - Grid.ColumnSpan="3"> - <Thumb.Template> - <ControlTemplate TargetType="Thumb"> - <Rectangle Fill="Transparent" /> - </ControlTemplate> - </Thumb.Template> - </Thumb> - </Grid> </Grid> </ControlTemplate> </Setter.Value> diff --git a/src/Notepads/Resource/DismissButtonStyle.xaml b/src/Notepads/Resource/DismissButtonStyle.xaml index ab778008d..3679f5abc 100644 --- a/src/Notepads/Resource/DismissButtonStyle.xaml +++ b/src/Notepads/Resource/DismissButtonStyle.xaml @@ -1,7 +1,8 @@ <ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Notepads"> + <Style x:Key="DismissButtonStyle" TargetType="ButtonBase"> <Setter Property="Background" Value="{ThemeResource HyperlinkButtonBackground}" /> <Setter Property="Foreground" Value="{ThemeResource ApplicationForegroundThemeBrush}" /> @@ -12,60 +13,53 @@ <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ButtonBase"> - <Grid x:Name="RootGrid" Margin="{TemplateBinding Padding}" Background="{TemplateBinding Background}"> - <Border x:Name="TextBorder" BorderThickness="2" BorderBrush="Transparent"> - <ContentPresenter x:Name="Text" - Content="{TemplateBinding Content}" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> + <Grid + x:Name="RootGrid" + Margin="{TemplateBinding Padding}" + Background="{TemplateBinding Background}"> + <Border + x:Name="TextBorder" + BorderBrush="Transparent" + BorderThickness="2"> + <ContentPresenter + x:Name="Text" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + Content="{TemplateBinding Content}" /> </Border> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal" /> <VisualState x:Name="PointerOver"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" - Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SystemListMediumColor}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemListMediumColor}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="Transparent" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Pressed"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" - Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource SystemListMediumColor}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemListMediumColor}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="Transparent" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Disabled"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" - Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource HyperlinkButtonForegroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource HyperlinkButtonForegroundDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource HyperlinkButtonBackgroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource HyperlinkButtonBackgroundDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" - Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" - Value="{ThemeResource HyperlinkButtonBorderBrushDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="BorderBrush"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource HyperlinkButtonBorderBrushDisabled}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> diff --git a/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml b/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml index 262c4483a..16fc593cb 100644 --- a/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml +++ b/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml @@ -1,7 +1,8 @@ <ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls"> + <Style x:Key="InAppNotificationNoDismissButton" TargetType="wctc:InAppNotification"> <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeMediumBrush}" /> <Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseLowBrush}" /> @@ -9,31 +10,60 @@ <Setter.Value> <ControlTemplate> <Grid> + <Grid + x:Name="RootGrid" + MaxWidth="{TemplateBinding MaxWidth}" + Margin="{TemplateBinding Margin}" + RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}" + Visibility="{TemplateBinding Visibility}"> + <Grid.RenderTransform> + <CompositeTransform /> + </Grid.RenderTransform> + + <wctc:DropShadowPanel + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch" + BlurRadius="8" + OffsetX="0.3" + OffsetY="0.3" + ShadowOpacity="0.3"> + <Grid + Padding="{TemplateBinding Padding}" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{ThemeResource OverlayCornerRadius}"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + + <ContentPresenter + x:Name="PART_Presenter" + HorizontalAlignment="{TemplateBinding HorizontalAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + HorizontalContentAlignment="Center" + VerticalContentAlignment="Center" + TextWrapping="WrapWholeWords" /> + </Grid> + </wctc:DropShadowPanel> + </Grid> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="State"> <VisualState x:Name="Collapsed"> <Storyboard> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> - <EasingDoubleKeyFrame KeyTime="0" - Value="0" /> - <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" - Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> + <EasingDoubleKeyFrame KeyTime="0" Value="0" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> - <EasingDoubleKeyFrame KeyTime="0" - Value="-50" /> - <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" - Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}"/> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> + <EasingDoubleKeyFrame KeyTime="0" Value="-50" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.Opacity)"> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.Opacity)"> <EasingDoubleKeyFrame KeyTime="0" Value="1" /> <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" /> </DoubleAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.Visibility)"> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.Visibility)"> <DiscreteObjectKeyFrame KeyTime="0"> <DiscreteObjectKeyFrame.Value> <Visibility>Visible</Visibility> @@ -49,65 +79,22 @@ </VisualState> <VisualState x:Name="Visible"> <Storyboard> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> - <EasingDoubleKeyFrame KeyTime="0" - Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" - Value="0" /> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> + <EasingDoubleKeyFrame KeyTime="0" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" /> </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> - <EasingDoubleKeyFrame KeyTime="0" - Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" - Value="-50" /> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> + <EasingDoubleKeyFrame KeyTime="0" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="-50" /> </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="(UIElement.Opacity)"> - <EasingDoubleKeyFrame KeyTime="0" - Value="0" /> - <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" - Value="1" /> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.Opacity)"> + <EasingDoubleKeyFrame KeyTime="0" Value="0" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="1" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> - - <Grid x:Name="RootGrid" - RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}" - Margin="{TemplateBinding Margin}" - MaxWidth="{TemplateBinding MaxWidth}" - Visibility="{TemplateBinding Visibility}"> - <Grid.RenderTransform> - <CompositeTransform /> - </Grid.RenderTransform> - - <wctc:DropShadowPanel BlurRadius="8" - ShadowOpacity="0.3" - OffsetX="0.3" - OffsetY="0.3" - HorizontalContentAlignment="Stretch" - VerticalContentAlignment="Stretch"> - <Grid Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - Padding="{TemplateBinding Padding}" - CornerRadius="{TemplateBinding CornerRadius}"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - - <ContentPresenter x:Name="PART_Presenter" - HorizontalAlignment="{TemplateBinding HorizontalAlignment}" - HorizontalContentAlignment="Center" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - VerticalContentAlignment="Center" - TextWrapping="WrapWholeWords" /> - </Grid> - </wctc:DropShadowPanel> - </Grid> </Grid> </ControlTemplate> </Setter.Value> diff --git a/src/Notepads/Resource/TransparentTextBoxStyle.xaml b/src/Notepads/Resource/TransparentTextBoxStyle.xaml index 3c2f75716..87569faf5 100644 --- a/src/Notepads/Resource/TransparentTextBoxStyle.xaml +++ b/src/Notepads/Resource/TransparentTextBoxStyle.xaml @@ -1,120 +1,183 @@ <ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Notepads"> <ResourceDictionary.ThemeDictionaries> <ResourceDictionary x:Key="Light"> - <SolidColorBrush x:Key="CustomTextBoxBackground" - Color="#E0E0E0" - Opacity="0.7"/> + <SolidColorBrush + x:Key="CustomTextBoxBackground" + Opacity="0.7" + Color="#E0E0E0" /> </ResourceDictionary> <ResourceDictionary x:Key="Dark"> - <SolidColorBrush x:Key="CustomTextBoxBackground" - Color="#1E1E1E" - Opacity="0.7"/> + <SolidColorBrush + x:Key="CustomTextBoxBackground" + Opacity="0.7" + Color="#1E1E1E" /> </ResourceDictionary> <ResourceDictionary x:Key="HighContrast"> - <SolidColorBrush x:Key="CustomTextBoxBackground" - Color="Black" /> + <SolidColorBrush x:Key="CustomTextBoxBackground" Color="Black" /> </ResourceDictionary> </ResourceDictionary.ThemeDictionaries> + <Style BasedOn="{StaticResource TransparentTextBoxStyle}" TargetType="TextBox" /> + <Style x:Key="TransparentTextBoxStyle" TargetType="TextBox"> - <Setter Property="Foreground" Value="{ThemeResource TextControlForeground}"/> - <Setter Property="Background" Value="{ThemeResource CustomTextBoxBackground}"/> - <Setter Property="BorderBrush" Value="{ThemeResource TextControlBorderBrush}"/> - <Setter Property="SelectionHighlightColor" Value="{ThemeResource TextControlSelectionHighlightColor}"/> - <Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}"/> - <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/> - <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/> - <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto"/> - <Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled"/> - <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden"/> - <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden"/> - <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False"/> - <Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}"/> - <Setter Property="UseSystemFocusVisuals" Value="{ThemeResource IsApplicationFocusVisualKindReveal}"/> - <Setter Property="ContextFlyout" Value="{StaticResource TextControlCommandBarContextFlyout}"/> + <Setter Property="Foreground" Value="{ThemeResource TextControlForeground}" /> + <Setter Property="Background" Value="{ThemeResource CustomTextBoxBackground}" /> + <Setter Property="BorderBrush" Value="{ThemeResource TextControlBorderBrush}" /> + <Setter Property="SelectionHighlightColor" Value="{ThemeResource TextControlSelectionHighlightColor}" /> + <Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}" /> + <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> + <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> + <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto" /> + <Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled" /> + <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" /> + <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" /> + <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" /> + <Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}" /> + <Setter Property="UseSystemFocusVisuals" Value="{ThemeResource IsApplicationFocusVisualKindReveal}" /> + <Setter Property="ContextFlyout" Value="{StaticResource TextControlCommandBarContextFlyout}" /> <!--<Setter Property="SelectionFlyout" Value="{StaticResource TextControlCommandBarSelectionFlyout}"/>--> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="TextBox"> <Grid> <Grid.Resources> - <ResourceDictionary> - </ResourceDictionary> + <ResourceDictionary /> </Grid.Resources> <Grid.ColumnDefinitions> - <ColumnDefinition Width="*"/> - <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> - <RowDefinition Height="Auto"/> - <RowDefinition Height="*"/> - <RowDefinition Height="Auto"/> + <RowDefinition Height="Auto" /> + <RowDefinition Height="*" /> + <RowDefinition Height="Auto" /> </Grid.RowDefinitions> + <ContentPresenter + x:Name="HeaderContentPresenter" + Grid.Row="0" + Grid.Column="0" + Grid.ColumnSpan="2" + Margin="{StaticResource TextBoxTopHeaderMargin}" + VerticalAlignment="Top" + x:DeferLoadStrategy="Lazy" + Content="{TemplateBinding Header}" + ContentTemplate="{TemplateBinding HeaderTemplate}" + FontWeight="Normal" + Foreground="{ThemeResource TextControlHeaderForeground}" + TextWrapping="Wrap" + Visibility="Collapsed" /> + <Border + x:Name="BorderElement" + Grid.Row="1" + Grid.RowSpan="1" + Grid.Column="0" + Grid.ColumnSpan="2" + MinWidth="{ThemeResource TextControlThemeMinWidth}" + MinHeight="{ThemeResource TextControlThemeMinHeight}" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Control.IsTemplateFocusTarget="True" + CornerRadius="{ThemeResource ControlCornerRadius}" /> + <ScrollViewer + x:Name="ContentElement" + Grid.Row="1" + Grid.Column="0" + Margin="{TemplateBinding BorderThickness}" + Padding="{TemplateBinding Padding}" + VerticalAlignment="Center" + AutomationProperties.AccessibilityView="Raw" + HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" + HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" + IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" + IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" + IsTabStop="False" + IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" + VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" + VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" + ZoomMode="Disabled" /> + <TextBlock + x:Name="PlaceholderTextContentPresenter" + Grid.Row="1" + Grid.Column="0" + Grid.ColumnSpan="2" + Margin="{TemplateBinding BorderThickness}" + Padding="{TemplateBinding Padding}" + VerticalAlignment="Center" + Foreground="{Binding PlaceholderForeground, RelativeSource={RelativeSource Mode=TemplatedParent}, TargetNullValue={ThemeResource TextControlPlaceholderForeground}}" + IsHitTestVisible="False" + Text="{TemplateBinding PlaceholderText}" + TextAlignment="{TemplateBinding TextAlignment}" + TextWrapping="{TemplateBinding TextWrapping}" /> + <ContentPresenter + x:Name="DescriptionPresenter" + Grid.Row="2" + Grid.Column="0" + Grid.ColumnSpan="2" + x:Load="False" + AutomationProperties.AccessibilityView="Raw" + Content="{TemplateBinding Description}" + Foreground="{ThemeResource SystemControlDescriptionTextForegroundBrush}" /> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal"/> + <VisualState x:Name="Normal" /> <VisualState x:Name="Disabled"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlHeaderForegroundDisabled}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlHeaderForegroundDisabled}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackgroundDisabled}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackgroundDisabled}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemChromeBlackLowColor}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemChromeBlackLowColor}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundDisabled}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundDisabled}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PlaceholderForeground, RelativeSource={RelativeSource Mode=TemplatedParent}, TargetNullValue={ThemeResource TextControlPlaceholderForegroundDisabled}}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PlaceholderForeground, RelativeSource={RelativeSource Mode=TemplatedParent}, TargetNullValue={ThemeResource TextControlPlaceholderForegroundDisabled}}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="PointerOver"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushPointerOver}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushPointerOver}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackground}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackground}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PlaceholderForeground, RelativeSource={RelativeSource Mode=TemplatedParent}, TargetNullValue={ThemeResource TextControlPlaceholderForegroundPointerOver}}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PlaceholderForeground, RelativeSource={RelativeSource Mode=TemplatedParent}, TargetNullValue={ThemeResource TextControlPlaceholderForegroundPointerOver}}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundPointerOver}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundPointerOver}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Focused"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PlaceholderForeground, RelativeSource={RelativeSource Mode=TemplatedParent}, TargetNullValue={ThemeResource SystemControlForegroundTransparentBrush}}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PlaceholderForeground, RelativeSource={RelativeSource Mode=TemplatedParent}, TargetNullValue={ThemeResource SystemControlForegroundTransparentBrush}}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackground}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackground}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushFocused}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushFocused}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForeground}"/> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForeground}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> - <ContentPresenter x:Name="HeaderContentPresenter" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Grid.ColumnSpan="2" Grid.Column="0" FontWeight="Normal" Foreground="{ThemeResource TextControlHeaderForeground}" Margin="{StaticResource TextBoxTopHeaderMargin}" Grid.Row="0" TextWrapping="Wrap" VerticalAlignment="Top" Visibility="Collapsed" x:DeferLoadStrategy="Lazy"/> - <Border x:Name="BorderElement" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{TemplateBinding CornerRadius}" Grid.ColumnSpan="2" Grid.Column="0" Control.IsTemplateFocusTarget="True" MinHeight="{ThemeResource TextControlThemeMinHeight}" MinWidth="{ThemeResource TextControlThemeMinWidth}" Grid.RowSpan="1" Grid.Row="1"/> - <ScrollViewer x:Name="ContentElement" AutomationProperties.AccessibilityView="Raw" VerticalAlignment="Center" Grid.Column="0" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" IsTabStop="False" IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" Grid.Row="1" VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" ZoomMode="Disabled"/> - <TextBlock x:Name="PlaceholderTextContentPresenter" VerticalAlignment="Center" Grid.ColumnSpan="2" Grid.Column="0" Foreground="{Binding PlaceholderForeground, RelativeSource={RelativeSource Mode=TemplatedParent}, TargetNullValue={ThemeResource TextControlPlaceholderForeground}}" IsHitTestVisible="False" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" Grid.Row="1" Text="{TemplateBinding PlaceholderText}" TextWrapping="{TemplateBinding TextWrapping}" TextAlignment="{TemplateBinding TextAlignment}"/> - <ContentPresenter x:Name="DescriptionPresenter" AutomationProperties.AccessibilityView="Raw" Content="{TemplateBinding Description}" Grid.ColumnSpan="2" Grid.Column="0" Foreground="{ThemeResource SystemControlDescriptionTextForegroundBrush}" Grid.Row="2" x:Load="False"/> </Grid> </ControlTemplate> </Setter.Value> diff --git a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml index 050f93a24..2982bc777 100644 --- a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml +++ b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml @@ -2,16 +2,16 @@ x:Class="Notepads.Views.MainPage.NotepadsMainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:Core="using:Microsoft.Xaml.Interactions.Core" + xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" + xmlns:controls="using:Notepads.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:controls="using:Notepads.Controls" - xmlns:wctui="using:Microsoft.Toolkit.Uwp.UI" xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls" - xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" - xmlns:Core="using:Microsoft.Xaml.Interactions.Core" - mc:Ignorable="d" + xmlns:wctui="using:Microsoft.Toolkit.Uwp.UI" + Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" NavigationCacheMode="Required" - Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + mc:Ignorable="d"> <Grid x:Name="RootGrid" Background="Transparent"> <Grid.BackgroundTransition> @@ -19,35 +19,37 @@ </Grid.BackgroundTransition> <Grid.RowDefinitions> - <RowDefinition Height="*"/> - <RowDefinition Height="Auto"/> - <RowDefinition Height="Auto"/> + <RowDefinition Height="*" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> </Grid.RowDefinitions> - <SplitView x:Name="RootSplitView" - Grid.Row="0" - AllowDrop="True" - IsPaneOpen="False" - OpenPaneLength="385" - DisplayMode="Overlay" - PaneBackground="Transparent" - PanePlacement="Right" - Style="{StaticResource CustomSplitViewStyle}"> + <SplitView + x:Name="RootSplitView" + Grid.Row="0" + AllowDrop="True" + DisplayMode="Overlay" + IsPaneOpen="False" + OpenPaneLength="385" + PaneBackground="Transparent" + PanePlacement="Right" + Style="{StaticResource CustomSplitViewStyle}"> <SplitView.Content> <Grid> - <controls:SetsView x:Name="Sets" - TabIndex="0" - SetsWidthBehavior="Equal" - CanCloseSets="True" - IsCloseButtonOverlay="False" - CanDragItems="True" - CanReorderItems="True" - AllowDrop="True" - Template="{StaticResource SetsViewTemplate}" - Background="Transparent" - Grid.ColumnSpan="2" - Loaded="Sets_Loaded"> + <controls:SetsView + x:Name="Sets" + Grid.ColumnSpan="2" + AllowDrop="True" + Background="Transparent" + CanCloseSets="True" + CanDragItems="True" + CanReorderItems="True" + IsCloseButtonOverlay="False" + Loaded="Sets_Loaded" + SetsWidthBehavior="Equal" + TabIndex="0" + Template="{StaticResource SetsViewTemplate}"> <!--<sets:SetsView.KeyboardAccelerators> <KeyboardAccelerator Key="N" Modifiers="Control" Invoked="KeyboardAccelerator_Ctrl_N_OnInvoked"/> @@ -64,144 +66,190 @@ <DoubleAnimation Storyboard.TargetName="NewSetButton" Storyboard.TargetProperty="Opacity" - From="0.0" To="1.0" Duration="0:0:1"/> + From="0.0" + To="1.0" + Duration="0:0:1" /> </Storyboard> </controls:SetsView.Resources> <controls:SetsView.SetsStartHeader> <Grid> <Grid.ColumnDefinitions> - <ColumnDefinition Width="*"/> - <ColumnDefinition Width="*"/> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> - <Button x:Name="ExitCompactOverlayButton" - Grid.Column="0" - IsTabStop="False" - Width="42" - Height="{StaticResource SetsViewItemHeaderMinHeight}" - Margin="0,0,0,0" - BorderThickness="0" - Background="Transparent" - Click="ExitCompactOverlayButton_OnClick" - Visibility="Collapsed" - Style="{ThemeResource ButtonRevealStyle}"> - <Viewbox MaxWidth="18" - MaxHeight="18"> - <FontIcon FontFamily="Segoe MDL2 Assets" - Glyph="" /> + <Button + x:Name="ExitCompactOverlayButton" + Grid.Column="0" + Width="42" + Height="{StaticResource SetsViewItemHeaderMinHeight}" + Margin="0,0,0,0" + Background="Transparent" + BorderThickness="0" + Click="ExitCompactOverlayButton_OnClick" + IsTabStop="False" + Style="{ThemeResource ButtonRevealStyle}" + Visibility="Collapsed"> + <Viewbox MaxWidth="18" MaxHeight="18"> + <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> </Viewbox> </Button> - <Button x:Name="MainMenuButton" - Grid.Column="1" - IsTabStop="False" - Width="42" - Height="{StaticResource SetsViewItemHeaderMinHeight}" - Margin="0,0,-1,0" - BorderThickness="0" - Background="Transparent" - Style="{ThemeResource ButtonRevealStyle}" - Padding="0"> + <Button + x:Name="MainMenuButton" + Grid.Column="1" + Width="42" + Height="{StaticResource SetsViewItemHeaderMinHeight}" + Margin="0,0,-1,0" + Padding="0" + Background="Transparent" + BorderThickness="0" + IsTabStop="False" + Style="{ThemeResource ButtonRevealStyle}"> <Viewbox MaxWidth="16" MaxHeight="16"> - <SymbolIcon Symbol="GlobalNavigationButton"/> + <SymbolIcon Symbol="GlobalNavigationButton" /> </Viewbox> <FlyoutBase.AttachedFlyout> - <MenuFlyout x:Name="MainMenuButtonFlyout" - Placement="BottomEdgeAlignedLeft"> - <MenuFlyoutItem x:Uid="MainMenu_Button_New" x:Name="MenuCreateNewButton" Icon="NewFolder" AccessKey="N"> + <MenuFlyout x:Name="MainMenuButtonFlyout" Placement="BottomEdgeAlignedLeft"> + <MenuFlyoutItem + x:Name="MenuCreateNewButton" + x:Uid="MainMenu_Button_New" + AccessKey="N" + Icon="NewFolder"> <MenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Key="N" Modifiers="Control" IsEnabled="False"/> + <KeyboardAccelerator + Key="N" + IsEnabled="False" + Modifiers="Control" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> - <MenuFlyoutItem x:Uid="MainMenu_Button_New_Window" x:Name="MenuCreateNewWindowButton" AccessKey="N"> + <MenuFlyoutItem + x:Name="MenuCreateNewWindowButton" + x:Uid="MainMenu_Button_New_Window" + AccessKey="N"> <MenuFlyoutItem.Icon> - <FontIcon FontFamily="Segoe MDL2 Assets" Glyph=""/> + <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> </MenuFlyoutItem.Icon> <MenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Key="N" Modifiers="Control,Shift" IsEnabled="False"/> + <KeyboardAccelerator + Key="N" + IsEnabled="False" + Modifiers="Control,Shift" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> - <MenuFlyoutItem x:Uid="MainMenu_Button_Open" x:Name="MenuOpenFileButton" Icon="OpenFile" AccessKey="O" > + <MenuFlyoutItem + x:Name="MenuOpenFileButton" + x:Uid="MainMenu_Button_Open" + AccessKey="O" + Icon="OpenFile"> <MenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Key="O" Modifiers="Control" IsEnabled="False"/> + <KeyboardAccelerator + Key="O" + IsEnabled="False" + Modifiers="Control" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> <MenuFlyoutSeparator /> - <MenuFlyoutItem x:Uid="MainMenu_Button_Save" x:Name="MenuSaveButton" Icon="Save"> + <MenuFlyoutItem + x:Name="MenuSaveButton" + x:Uid="MainMenu_Button_Save" + Icon="Save"> <MenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Key="S" Modifiers="Control" IsEnabled="False"/> + <KeyboardAccelerator + Key="S" + IsEnabled="False" + Modifiers="Control" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> - <MenuFlyoutItem x:Uid="MainMenu_Button_SaveAs" x:Name="MenuSaveAsButton"> + <MenuFlyoutItem x:Name="MenuSaveAsButton" x:Uid="MainMenu_Button_SaveAs"> <MenuFlyoutItem.Icon> - <FontIcon Glyph=""/> + <FontIcon Glyph="" /> </MenuFlyoutItem.Icon> <MenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Key="S" Modifiers="Control,Shift" IsEnabled="False"/> + <KeyboardAccelerator + Key="S" + IsEnabled="False" + Modifiers="Control,Shift" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> - <MenuFlyoutItem x:Uid="MainMenu_Button_SaveAll" x:Name="MenuSaveAllButton"> + <MenuFlyoutItem x:Name="MenuSaveAllButton" x:Uid="MainMenu_Button_SaveAll"> <MenuFlyoutItem.Icon> - <FontIcon Glyph=""/> + <FontIcon Glyph="" /> </MenuFlyoutItem.Icon> </MenuFlyoutItem> <MenuFlyoutSeparator /> - <MenuFlyoutItem x:Uid="MainMenu_Button_Find" x:Name="MenuFindButton" Icon="Find"> + <MenuFlyoutItem + x:Name="MenuFindButton" + x:Uid="MainMenu_Button_Find" + Icon="Find"> <MenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Key="F" Modifiers="Control" IsEnabled="False"/> + <KeyboardAccelerator + Key="F" + IsEnabled="False" + Modifiers="Control" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> - <MenuFlyoutItem x:Uid="MainMenu_Button_Replace" x:Name="MenuReplaceButton"> + <MenuFlyoutItem x:Name="MenuReplaceButton" x:Uid="MainMenu_Button_Replace"> <MenuFlyoutItem.Icon> <FontIcon Glyph="" /> </MenuFlyoutItem.Icon> <MenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Key="F" Modifiers="Control,Shift" IsEnabled="False"/> + <KeyboardAccelerator + Key="F" + IsEnabled="False" + Modifiers="Control,Shift" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> - <MenuFlyoutSeparator x:Name="MenuFullScreenSeparator"/> - <MenuFlyoutItem Text="Enter Full Screen" x:Name="MenuFullScreenButton"> + <MenuFlyoutSeparator x:Name="MenuFullScreenSeparator" /> + <MenuFlyoutItem x:Name="MenuFullScreenButton" Text="Enter Full Screen"> <MenuFlyoutItem.Icon> <FontIcon Glyph="" /> </MenuFlyoutItem.Icon> <MenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Key="F11" IsEnabled="False"/> + <KeyboardAccelerator Key="F11" IsEnabled="False" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> - <MenuFlyoutItem Text="CompactOverlay" x:Name="MenuCompactOverlayButton"> + <MenuFlyoutItem x:Name="MenuCompactOverlayButton" Text="CompactOverlay"> <MenuFlyoutItem.Icon> <FontIcon Glyph="" /> </MenuFlyoutItem.Icon> <MenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Key="F12" IsEnabled="False"/> + <KeyboardAccelerator Key="F12" IsEnabled="False" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> - <MenuFlyoutSeparator x:Name="MenuPrintSeparator"/> - <MenuFlyoutItem x:Uid="MainMenu_Button_Print" x:Name="MenuPrintButton" Icon="Print"> + <MenuFlyoutSeparator x:Name="MenuPrintSeparator" /> + <MenuFlyoutItem + x:Name="MenuPrintButton" + x:Uid="MainMenu_Button_Print" + Icon="Print"> <MenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Key="P" Modifiers="Control"/> + <KeyboardAccelerator Key="P" Modifiers="Control" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> - <MenuFlyoutItem x:Uid="MainMenu_Button_PrintAll" x:Name="MenuPrintAllButton"> + <MenuFlyoutItem x:Name="MenuPrintAllButton" x:Uid="MainMenu_Button_PrintAll"> <MenuFlyoutItem.Icon> - <FontIcon Glyph=""/> + <FontIcon Glyph="" /> </MenuFlyoutItem.Icon> <MenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Key="P" Modifiers="Control,Shift" IsEnabled="False"/> + <KeyboardAccelerator + Key="P" + IsEnabled="False" + Modifiers="Control,Shift" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> <MenuFlyoutSeparator x:Name="MenuSettingsSeparator" /> - <MenuFlyoutItem x:Uid="MainMenu_Button_Settings" x:Name="MenuSettingsButton" Icon="Setting"> + <MenuFlyoutItem + x:Name="MenuSettingsButton" + x:Uid="MainMenu_Button_Settings" + Icon="Setting"> <MenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Key="F1" IsEnabled="False"/> + <KeyboardAccelerator Key="F1" IsEnabled="False" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> <MenuFlyout.MenuFlyoutPresenterStyle> <Style TargetType="MenuFlyoutPresenter"> <Setter Property="BorderThickness" Value="0" /> - <!-- TODO: Remove CornerRadius property setter --> - <Setter Property="CornerRadius" Value="0" /> <Setter Property="MaxWidth" Value="1200" /> </Style> </MenuFlyout.MenuFlyoutPresenterStyle> @@ -212,102 +260,112 @@ </controls:SetsView.SetsStartHeader> <controls:SetsView.SetsActionHeader> - <Button x:Name="NewSetButton" - Grid.Column="0" - IsTabStop="False" - Width="42" - Height="{StaticResource SetsViewItemHeaderMinHeight}" - Margin="-1,0,0,0" - BorderThickness="0" - Background="Transparent" - Style="{ThemeResource ButtonRevealStyle}"> - <Viewbox MaxWidth="14" - MaxHeight="14"> - <FontIcon FontFamily="Segoe MDL2 Assets" - Glyph="" /> - </Viewbox> + <Button + x:Name="NewSetButton" + Grid.Column="0" + Width="42" + Height="{StaticResource SetsViewItemHeaderMinHeight}" + Margin="-1,0,0,0" + Background="Transparent" + BorderThickness="0" + IsTabStop="False" + Style="{ThemeResource ButtonRevealStyle}"> + <Viewbox MaxWidth="14" MaxHeight="14"> + <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> + </Viewbox> </Button> </controls:SetsView.SetsActionHeader> <controls:SetsView.SetsPaddingHeader> - <Grid x:Name="AppTitleBar" Background="Transparent" Height="32"/> + <Grid + x:Name="AppTitleBar" + Height="32" + Background="Transparent" /> </controls:SetsView.SetsPaddingHeader> <controls:SetsView.SetsEndHeader> - <Grid x:Name="TitleBarReservedArea" Background="Transparent" HorizontalAlignment="Center" Width="180" Height="32"/> + <Grid + x:Name="TitleBarReservedArea" + Width="180" + Height="32" + HorizontalAlignment="Center" + Background="Transparent" /> </controls:SetsView.SetsEndHeader> </controls:SetsView> - <!-- TODO: Change CornerRadius to {ThemeResource OverlayCornerRadius}--> - <wctc:InAppNotification x:Name="StatusNotification" - x:Load="false" - Style="{StaticResource InAppNotificationNoDismissButton}" - Content="" - ShowDismissButton="False" - AnimationDuration="0:0:0.080" - VerticalOffset="-20" - HorizontalOffset="0" - FontWeight="Light" - BorderThickness="1" - CornerRadius="0"> - </wctc:InAppNotification> + <wctc:InAppNotification + x:Name="StatusNotification" + x:Load="false" + AnimationDuration="0:0:0.080" + BorderThickness="1" + Content="" + FontWeight="Light" + HorizontalOffset="0" + ShowDismissButton="False" + Style="{StaticResource InAppNotificationNoDismissButton}" + VerticalOffset="-20" /> </Grid> </SplitView.Content> <SplitView.Pane> <Border x:Name="RootBorder" Padding="12,0,0,0"> <Grid> - <wctc:DropShadowPanel BlurRadius="12" - Color="Black" - Opacity="0.3" - HorizontalContentAlignment="Stretch" - VerticalContentAlignment="Stretch"> + <wctc:DropShadowPanel + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch" + BlurRadius="12" + Opacity="0.3" + Color="Black"> <Rectangle Fill="White" /> </wctc:DropShadowPanel> <Grid x:Name="PaneContentGrid" Background="{ThemeResource SystemControlChromeMediumLowAcrylicElementMediumBrush}"> - <Frame x:Name="SettingsFrame"/> + <Frame x:Name="SettingsFrame" /> </Grid> </Grid> </Border> </SplitView.Pane> </SplitView> - <Grid Grid.Row="1" x:Name="StatusBar" Height="25" x:Load="false"> + <Grid + x:Name="StatusBar" + Grid.Row="1" + Height="25" + x:Load="false"> <Grid.Resources> - <Style TargetType="TextBlock" x:Key="StatusBarTextBlockStyle"> - <Setter Property="Height" Value="25"/> - <Setter Property="Padding" Value="8,4,8,4"/> - <Setter Property="HorizontalAlignment" Value="Left"/> - <Setter Property="FontSize" Value="11"/> - <Setter Property="FontWeight" Value="Normal"/> - <Setter Property="Opacity" Value="1.0"/> - <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseMediumHighBrush}"/> + <Style x:Key="StatusBarTextBlockStyle" TargetType="TextBlock"> + <Setter Property="Height" Value="25" /> + <Setter Property="Padding" Value="8,4,8,4" /> + <Setter Property="HorizontalAlignment" Value="Left" /> + <Setter Property="FontSize" Value="11" /> + <Setter Property="FontWeight" Value="Normal" /> + <Setter Property="Opacity" Value="1.0" /> + <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseMediumHighBrush}" /> </Style> </Grid.Resources> <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto" MinWidth="4"/> - <ColumnDefinition Width="*"/> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="Auto" MinWidth="4" /> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <Grid Column="0" - CornerRadius="0"> - <Grid x:Name="FileModificationStateIndicator" - Padding="8,5,6,5" - IsTapEnabled="True" - wctui:FrameworkElementExtensions.Cursor="Hand" - Tapped="StatusBarComponent_OnTapped"> + + <Grid Column="0" CornerRadius="{ThemeResource ControlCornerRadius}"> + <Grid + x:Name="FileModificationStateIndicator" + Padding="8,5,6,5" + wctui:FrameworkElementExtensions.Cursor="Hand" + IsTapEnabled="True" + Tapped="StatusBarComponent_OnTapped"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}"/> + <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}" /> </Core:ChangePropertyAction.Value> </Core:ChangePropertyAction> </Core:EventTriggerBehavior> @@ -315,31 +373,36 @@ <Core:EventTriggerBehavior EventName="PointerExited"> <Core:ChangePropertyAction PropertyName="Background"> <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="Transparent"/> + <SolidColorBrush Color="Transparent" /> </Core:ChangePropertyAction.Value> </Core:ChangePropertyAction> </Core:EventTriggerBehavior> </Interactivity:Interaction.Behaviors> <Viewbox> - <FontIcon x:Name="FileModificationStateIndicatorIcon" Foreground="{StaticResource SystemControlForegroundAccentBrush}"/> + <FontIcon x:Name="FileModificationStateIndicatorIcon" Foreground="{StaticResource SystemControlForegroundAccentBrush}" /> </Viewbox> <Grid.ContextFlyout> - <MenuFlyout x:Name="FileModifiedOutsideFlyout" Placement="TopEdgeAlignedLeft" Closing="StatusBarFlyout_OnClosing"> - <MenuFlyoutItem x:Name="FileModifiedOutsideFlyoutReloadFileFromDiskFlyoutItem" - x:Uid="TextEditor_FileModifiedOutsideIndicator_MenuFlyoutItem_ReloadFileFromDisk" - Tag="ReloadFileFromDisk" - Click="ReloadFileFromDisk"> + <MenuFlyout + x:Name="FileModifiedOutsideFlyout" + Closing="StatusBarFlyout_OnClosing" + Placement="TopEdgeAlignedLeft"> + <MenuFlyoutItem + x:Name="FileModifiedOutsideFlyoutReloadFileFromDiskFlyoutItem" + x:Uid="TextEditor_FileModifiedOutsideIndicator_MenuFlyoutItem_ReloadFileFromDisk" + Click="ReloadFileFromDisk" + Tag="ReloadFileFromDisk"> <MenuFlyoutItem.Icon> - <FontIcon Glyph=""/> + <FontIcon Glyph="" /> </MenuFlyoutItem.Icon> <MenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Key="R" Modifiers="Control,Shift" IsEnabled="False"/> + <KeyboardAccelerator + Key="R" + IsEnabled="False" + Modifiers="Control,Shift" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> <MenuFlyout.MenuFlyoutPresenterStyle> <Style TargetType="MenuFlyoutPresenter"> - <!-- TODO: Remove CornerRadius property setter --> - <Setter Property="CornerRadius" Value="0" /> <Setter Property="BorderThickness" Value="0" /> </Style> </MenuFlyout.MenuFlyoutPresenterStyle> @@ -347,14 +410,17 @@ </Grid.ContextFlyout> </Grid> </Grid> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <Grid Column="1" - CornerRadius="0" - wctui:FrameworkElementExtensions.Cursor="Hand"> - <TextBlock x:Name="PathIndicator" Style="{StaticResource StatusBarTextBlockStyle}" - Padding ="4,4,8,4" - IsTapEnabled="True" - Tapped="StatusBarComponent_OnTapped"> + + <Grid + wctui:FrameworkElementExtensions.Cursor="Hand" + Column="1" + CornerRadius="{ThemeResource ControlCornerRadius}"> + <TextBlock + x:Name="PathIndicator" + Padding="4,4,8,4" + IsTapEnabled="True" + Style="{StaticResource StatusBarTextBlockStyle}" + Tapped="StatusBarComponent_OnTapped"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> @@ -374,48 +440,56 @@ </Core:EventTriggerBehavior> </Interactivity:Interaction.Behaviors> <TextBlock.ContextFlyout> - <MenuFlyout x:Name="PathIndicatorFlyout" Placement="TopEdgeAlignedLeft" Closing="StatusBarFlyout_OnClosing"> - <MenuFlyoutItem x:Name="PathIndicatorFlyoutReloadFileFromDiskFlyoutItem" - x:Uid="TextEditor_FileModifiedOutsideIndicator_MenuFlyoutItem_ReloadFileFromDisk" - Tag="ReloadFileFromDisk" - Click="ReloadFileFromDisk"> + <MenuFlyout + x:Name="PathIndicatorFlyout" + Closing="StatusBarFlyout_OnClosing" + Placement="TopEdgeAlignedLeft"> + <MenuFlyoutItem + x:Name="PathIndicatorFlyoutReloadFileFromDiskFlyoutItem" + x:Uid="TextEditor_FileModifiedOutsideIndicator_MenuFlyoutItem_ReloadFileFromDisk" + Click="ReloadFileFromDisk" + Tag="ReloadFileFromDisk"> <MenuFlyoutItem.Icon> - <FontIcon Glyph=""/> + <FontIcon Glyph="" /> </MenuFlyoutItem.Icon> <MenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Key="R" Modifiers="Control,Shift" IsEnabled="False"/> + <KeyboardAccelerator + Key="R" + IsEnabled="False" + Modifiers="Control,Shift" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> - <MenuFlyoutSeparator/> - <MenuFlyoutItem x:Name="PathIndicatorFlyoutCopyFullPathFlyoutItem" - Tag="CopyFullPath" - Click="CopyFullPath"> + <MenuFlyoutSeparator /> + <MenuFlyoutItem + x:Name="PathIndicatorFlyoutCopyFullPathFlyoutItem" + Click="CopyFullPath" + Tag="CopyFullPath"> <MenuFlyoutItem.Icon> - <FontIcon Glyph=""/> + <FontIcon Glyph="" /> </MenuFlyoutItem.Icon> </MenuFlyoutItem> - <MenuFlyoutItem x:Name="PathIndicatorFlyoutOpenContainingFolderFlyoutItem" - Tag="OpenContainingFolder" - Click="OpenContainingFolder"> + <MenuFlyoutItem + x:Name="PathIndicatorFlyoutOpenContainingFolderFlyoutItem" + Click="OpenContainingFolder" + Tag="OpenContainingFolder"> <MenuFlyoutItem.Icon> - <FontIcon Glyph=""/> + <FontIcon Glyph="" /> </MenuFlyoutItem.Icon> </MenuFlyoutItem> - <MenuFlyoutSeparator/> - <MenuFlyoutItem x:Name="PathIndicatorFlyoutFileRenameFlyoutItem" - Tag="Rename" - Click="RenameFileAsync"> + <MenuFlyoutSeparator /> + <MenuFlyoutItem + x:Name="PathIndicatorFlyoutFileRenameFlyoutItem" + Click="RenameFileAsync" + Tag="Rename"> <MenuFlyoutItem.Icon> - <FontIcon Glyph=""/> + <FontIcon Glyph="" /> </MenuFlyoutItem.Icon> <MenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Key="F2" IsEnabled="False"/> + <KeyboardAccelerator Key="F2" IsEnabled="False" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> <MenuFlyout.MenuFlyoutPresenterStyle> <Style TargetType="MenuFlyoutPresenter"> - <!-- TODO: Remove CornerRadius property setter --> - <Setter Property="CornerRadius" Value="0" /> <Setter Property="BorderThickness" Value="0" /> </Style> </MenuFlyout.MenuFlyoutPresenterStyle> @@ -423,15 +497,16 @@ </TextBlock.ContextFlyout> </TextBlock> </Grid> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <Grid Column="2" - CornerRadius="0" - wctui:FrameworkElementExtensions.Cursor="Hand"> + + <Grid + wctui:FrameworkElementExtensions.Cursor="Hand" + Column="2" + CornerRadius="{ThemeResource ControlCornerRadius}"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}"/> + <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}" /> </Core:ChangePropertyAction.Value> </Core:ChangePropertyAction> </Core:EventTriggerBehavior> @@ -439,40 +514,49 @@ <Core:EventTriggerBehavior EventName="PointerExited"> <Core:ChangePropertyAction PropertyName="Background"> <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="Transparent"/> + <SolidColorBrush Color="Transparent" /> </Core:ChangePropertyAction.Value> </Core:ChangePropertyAction> </Core:EventTriggerBehavior> </Interactivity:Interaction.Behaviors> - - <TextBlock x:Name="ModificationIndicator" Style="{StaticResource StatusBarTextBlockStyle}" - Foreground="{StaticResource SystemControlForegroundAccentBrush}" - IsTapEnabled="True" - Tapped="StatusBarComponent_OnTapped"> + + <TextBlock + x:Name="ModificationIndicator" + Foreground="{StaticResource SystemControlForegroundAccentBrush}" + IsTapEnabled="True" + Style="{StaticResource StatusBarTextBlockStyle}" + Tapped="StatusBarComponent_OnTapped"> <TextBlock.ContextFlyout> - <MenuFlyout x:Name="ModificationFlyout" Placement="TopEdgeAlignedRight" Closing="StatusBarFlyout_OnClosing"> - <MenuFlyoutItem x:Name="PreviewTextChangesFlyoutItem" - x:Uid="TextEditor_ModificationIndicator_MenuFlyoutItem_PreviewTextChanges" - Tag="PreviewTextChanges" Click="ModificationFlyoutSelection_OnClick"> + <MenuFlyout + x:Name="ModificationFlyout" + Closing="StatusBarFlyout_OnClosing" + Placement="TopEdgeAlignedRight"> + <MenuFlyoutItem + x:Name="PreviewTextChangesFlyoutItem" + x:Uid="TextEditor_ModificationIndicator_MenuFlyoutItem_PreviewTextChanges" + Click="ModificationFlyoutSelection_OnClick" + Tag="PreviewTextChanges"> <MenuFlyoutItem.Icon> - <FontIcon Glyph=""/> + <FontIcon Glyph="" /> </MenuFlyoutItem.Icon> <MenuFlyoutItem.KeyboardAccelerators> - <KeyboardAccelerator Key="D" Modifiers="Menu" IsEnabled="False"/> + <KeyboardAccelerator + Key="D" + IsEnabled="False" + Modifiers="Menu" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> - <MenuFlyoutItem x:Uid="TextEditor_ModificationIndicator_MenuFlyoutItem_RevertAllChanges" - Tag="RevertAllChanges" - Click="ModificationFlyoutSelection_OnClick"> + <MenuFlyoutItem + x:Uid="TextEditor_ModificationIndicator_MenuFlyoutItem_RevertAllChanges" + Click="ModificationFlyoutSelection_OnClick" + Tag="RevertAllChanges"> <MenuFlyoutItem.Icon> - <FontIcon Glyph=""/> + <FontIcon Glyph="" /> </MenuFlyoutItem.Icon> </MenuFlyoutItem> <MenuFlyout.MenuFlyoutPresenterStyle> <Style TargetType="MenuFlyoutPresenter"> - <!-- TODO: Remove CornerRadius property setter --> - <Setter Property="CornerRadius" Value="0" /> <Setter Property="BorderThickness" Value="0" /> </Style> </MenuFlyout.MenuFlyoutPresenterStyle> @@ -480,16 +564,17 @@ </TextBlock.ContextFlyout> </TextBlock> </Grid> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <Grid Column="3" - x:Name="LineColumnIndicatorButton" - CornerRadius="0" - wctui:FrameworkElementExtensions.Cursor="Hand"> + + <Grid + x:Name="LineColumnIndicatorButton" + wctui:FrameworkElementExtensions.Cursor="Hand" + Column="3" + CornerRadius="{ThemeResource ControlCornerRadius}"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}"/> + <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}" /> </Core:ChangePropertyAction.Value> </Core:ChangePropertyAction> </Core:EventTriggerBehavior> @@ -497,25 +582,27 @@ <Core:EventTriggerBehavior EventName="PointerExited"> <Core:ChangePropertyAction PropertyName="Background"> <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="Transparent"/> + <SolidColorBrush Color="Transparent" /> </Core:ChangePropertyAction.Value> </Core:ChangePropertyAction> </Core:EventTriggerBehavior> </Interactivity:Interaction.Behaviors> - <TextBlock x:Name="LineColumnIndicator" Style="{StaticResource StatusBarTextBlockStyle}" - IsTapEnabled="True" - Tapped="StatusBarComponent_OnTapped"> - </TextBlock> + <TextBlock + x:Name="LineColumnIndicator" + IsTapEnabled="True" + Style="{StaticResource StatusBarTextBlockStyle}" + Tapped="StatusBarComponent_OnTapped" /> </Grid> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <Grid Column="4" - CornerRadius="0" - wctui:FrameworkElementExtensions.Cursor="Hand"> + + <Grid + wctui:FrameworkElementExtensions.Cursor="Hand" + Column="4" + CornerRadius="{ThemeResource ControlCornerRadius}"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}"/> + <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}" /> </Core:ChangePropertyAction.Value> </Core:ChangePropertyAction> </Core:EventTriggerBehavior> @@ -523,101 +610,136 @@ <Core:EventTriggerBehavior EventName="PointerExited"> <Core:ChangePropertyAction PropertyName="Background"> <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="Transparent"/> + <SolidColorBrush Color="Transparent" /> </Core:ChangePropertyAction.Value> </Core:ChangePropertyAction> </Core:EventTriggerBehavior> </Interactivity:Interaction.Behaviors> - <TextBlock x:Name="FontZoomIndicator" Style="{StaticResource StatusBarTextBlockStyle}" - IsTapEnabled="True" - Tapped="StatusBarComponent_OnTapped"> + <TextBlock + x:Name="FontZoomIndicator" + IsTapEnabled="True" + Style="{StaticResource StatusBarTextBlockStyle}" + Tapped="StatusBarComponent_OnTapped"> <TextBlock.ContextFlyout> - <Flyout x:Name="FontZoomIndicatorFlyout" Placement="TopEdgeAlignedRight" Closing="StatusBarFlyout_OnClosing"> + <Flyout + x:Name="FontZoomIndicatorFlyout" + Closing="StatusBarFlyout_OnClosing" + Placement="TopEdgeAlignedRight"> <StackPanel> - <StackPanel Orientation="Horizontal" Margin="-10,0,-10,0"> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <AppBarButton x:Name="ZoomOut" - x:Uid="TextEditor_FontZoomIndicator_FlyoutItem_ZoomOut" - LabelPosition="Collapsed" - VerticalAlignment="Center" - BorderBrush="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}" - CornerRadius="0" - Width="40" - KeyboardAcceleratorTextOverride="Ctrl+Minus" - Click="FontZoomIndicatorFlyoutSelection_OnClick"> + <StackPanel Margin="-10,0,-10,0" Orientation="Horizontal"> + <AppBarButton + x:Name="ZoomOut" + x:Uid="TextEditor_FontZoomIndicator_FlyoutItem_ZoomOut" + Width="40" + VerticalAlignment="Center" + BorderBrush="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}" + Click="FontZoomIndicatorFlyoutSelection_OnClick" + CornerRadius="{ThemeResource ControlCornerRadius}" + KeyboardAcceleratorTextOverride="Ctrl+Minus" + LabelPosition="Collapsed"> <AppBarButton.Icon> - <FontIcon Glyph="" FontFamily="Segoe MDL2 Assets"/> + <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> </AppBarButton.Icon> <AppBarButton.KeyboardAccelerators> - <KeyboardAccelerator Key="Subtract" Modifiers="Control" IsEnabled="False"/> + <KeyboardAccelerator + Key="Subtract" + IsEnabled="False" + Modifiers="Control" /> </AppBarButton.KeyboardAccelerators> </AppBarButton> - <Slider x:Name="FontZoomSlider" - Style="{StaticResource CustomSliderStyle}" - Minimum="10" Maximum="500" Value="100" - VerticalAlignment="Center" Width="150" - Margin="5" - ValueChanged="FontZoomSlider_ValueChanged"/> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <AppBarButton x:Name="ZoomIn" - x:Uid="TextEditor_FontZoomIndicator_FlyoutItem_ZoomIn" - LabelPosition="Collapsed" - VerticalAlignment="Center" - BorderBrush="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}" - CornerRadius="0" - Width="40" - KeyboardAcceleratorTextOverride="Ctrl+Plus" - Click="FontZoomIndicatorFlyoutSelection_OnClick"> + <Slider + x:Name="FontZoomSlider" + Width="150" + Margin="5" + VerticalAlignment="Center" + Maximum="500" + Minimum="10" + ValueChanged="FontZoomSlider_ValueChanged" + Value="100" /> + <AppBarButton + x:Name="ZoomIn" + x:Uid="TextEditor_FontZoomIndicator_FlyoutItem_ZoomIn" + Width="40" + VerticalAlignment="Center" + BorderBrush="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}" + Click="FontZoomIndicatorFlyoutSelection_OnClick" + CornerRadius="{ThemeResource ControlCornerRadius}" + KeyboardAcceleratorTextOverride="Ctrl+Plus" + LabelPosition="Collapsed"> <AppBarButton.Icon> - <FontIcon Glyph="" FontFamily="Segoe MDL2 Assets"/> + <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> </AppBarButton.Icon> <AppBarButton.KeyboardAccelerators> - <KeyboardAccelerator Key="Add" Modifiers="Control" IsEnabled="False"/> + <KeyboardAccelerator + Key="Add" + IsEnabled="False" + Modifiers="Control" /> </AppBarButton.KeyboardAccelerators> </AppBarButton> </StackPanel> - <StackPanel Orientation="Horizontal" Margin="5,-5,0,0"> - <TextBlock x:Name="MinZoom" Text="10%" Margin="30,0,0,0" FontSize="10"/> - <TextBlock x:Name="MaxZoom" Text="500%" Margin="108,0,0,0" FontSize="10"/> + <StackPanel Margin="5,-5,0,0" Orientation="Horizontal"> + <TextBlock + x:Name="MinZoom" + Margin="30,0,0,0" + FontSize="10" + Text="10%" /> + <TextBlock + x:Name="MaxZoom" + Margin="108,0,0,0" + FontSize="10" + Text="500%" /> </StackPanel> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,-15,0,0"> - <TextBlock Text="{x:Bind FontZoomSlider.Value,Mode=OneWay}" VerticalAlignment="Center" FontSize="15"/> - <TextBlock Text="%" VerticalAlignment="Center" FontSize="15"/> + <StackPanel + Margin="0,-15,0,0" + HorizontalAlignment="Center" + Orientation="Horizontal"> + <TextBlock + VerticalAlignment="Center" + FontSize="15" + Text="{x:Bind FontZoomSlider.Value, Mode=OneWay}" /> + <TextBlock + VerticalAlignment="Center" + FontSize="15" + Text="%" /> </StackPanel> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <AppBarButton x:Name="RestoreDefaultZoom" - x:Uid="TextEditor_FontZoomIndicator_FlyoutItem_RestoreDefaultZoom" - Style="{StaticResource CustomAppBarButtonLabelToRightStyle}" - CornerRadius="0" - HorizontalAlignment="Stretch" - VerticalAlignment="Center" - Margin="-10,5,-10,-5" - Icon="Undo" - Click="FontZoomIndicatorFlyoutSelection_OnClick"> + <AppBarButton + x:Name="RestoreDefaultZoom" + x:Uid="TextEditor_FontZoomIndicator_FlyoutItem_RestoreDefaultZoom" + Margin="-10,5,-10,-5" + HorizontalAlignment="Stretch" + VerticalAlignment="Center" + Click="FontZoomIndicatorFlyoutSelection_OnClick" + CornerRadius="{ThemeResource ControlCornerRadius}" + Icon="Undo" + Style="{StaticResource CustomAppBarButtonLabelToRightStyle}"> <AppBarButton.KeyboardAccelerators> - <KeyboardAccelerator Key="Number0" Modifiers="Control" IsEnabled="False"/> + <KeyboardAccelerator + Key="Number0" + IsEnabled="False" + Modifiers="Control" /> </AppBarButton.KeyboardAccelerators> </AppBarButton> </StackPanel> <Flyout.FlyoutPresenterStyle> <Style TargetType="FlyoutPresenter"> - <Setter Property="BorderThickness" Value="0"/> + <Setter Property="BorderThickness" Value="0" /> </Style> </Flyout.FlyoutPresenterStyle> </Flyout> </TextBlock.ContextFlyout> </TextBlock> </Grid> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <Grid Column="5" - CornerRadius="0" - wctui:FrameworkElementExtensions.Cursor="Hand"> + + <Grid + wctui:FrameworkElementExtensions.Cursor="Hand" + Column="5" + CornerRadius="{ThemeResource ControlCornerRadius}"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}"/> + <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}" /> </Core:ChangePropertyAction.Value> </Core:ChangePropertyAction> </Core:EventTriggerBehavior> @@ -625,24 +747,36 @@ <Core:EventTriggerBehavior EventName="PointerExited"> <Core:ChangePropertyAction PropertyName="Background"> <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="Transparent"/> + <SolidColorBrush Color="Transparent" /> </Core:ChangePropertyAction.Value> </Core:ChangePropertyAction> </Core:EventTriggerBehavior> </Interactivity:Interaction.Behaviors> - - <TextBlock x:Name="LineEndingIndicator" Style="{StaticResource StatusBarTextBlockStyle}" - IsTapEnabled="True" - Tapped="StatusBarComponent_OnTapped"> + + <TextBlock + x:Name="LineEndingIndicator" + IsTapEnabled="True" + Style="{StaticResource StatusBarTextBlockStyle}" + Tapped="StatusBarComponent_OnTapped"> <TextBlock.ContextFlyout> - <MenuFlyout x:Name="LineEndingSelectionFlyout" Placement="TopEdgeAlignedRight" Closing="StatusBarFlyout_OnClosing"> - <MenuFlyoutItem Text="Windows (CRLF)" Tag="CRLF" Click="LineEndingSelection_OnClick"/> - <MenuFlyoutItem Text="Macintosh (CR)" Tag="CR" Click="LineEndingSelection_OnClick"/> - <MenuFlyoutItem Text="Unix (LF)" Tag="LF" Click="LineEndingSelection_OnClick"/> + <MenuFlyout + x:Name="LineEndingSelectionFlyout" + Closing="StatusBarFlyout_OnClosing" + Placement="TopEdgeAlignedRight"> + <MenuFlyoutItem + Click="LineEndingSelection_OnClick" + Tag="CRLF" + Text="Windows (CRLF)" /> + <MenuFlyoutItem + Click="LineEndingSelection_OnClick" + Tag="CR" + Text="Macintosh (CR)" /> + <MenuFlyoutItem + Click="LineEndingSelection_OnClick" + Tag="LF" + Text="Unix (LF)" /> <MenuFlyout.MenuFlyoutPresenterStyle> <Style TargetType="MenuFlyoutPresenter"> - <!-- TODO: Remove CornerRadius property setter --> - <Setter Property="CornerRadius" Value="0" /> <Setter Property="BorderThickness" Value="0" /> </Style> </MenuFlyout.MenuFlyoutPresenterStyle> @@ -650,15 +784,16 @@ </TextBlock.ContextFlyout> </TextBlock> </Grid> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <Grid Column="6" - CornerRadius="0" - wctui:FrameworkElementExtensions.Cursor="Hand"> + + <Grid + wctui:FrameworkElementExtensions.Cursor="Hand" + Column="6" + CornerRadius="{ThemeResource ControlCornerRadius}"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}"/> + <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}" /> </Core:ChangePropertyAction.Value> </Core:ChangePropertyAction> </Core:EventTriggerBehavior> @@ -666,21 +801,24 @@ <Core:EventTriggerBehavior EventName="PointerExited"> <Core:ChangePropertyAction PropertyName="Background"> <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="Transparent"/> + <SolidColorBrush Color="Transparent" /> </Core:ChangePropertyAction.Value> </Core:ChangePropertyAction> </Core:EventTriggerBehavior> </Interactivity:Interaction.Behaviors> - - <TextBlock x:Name="EncodingIndicator" Style="{StaticResource StatusBarTextBlockStyle}" - IsTapEnabled="True" - Tapped="StatusBarComponent_OnTapped"> + + <TextBlock + x:Name="EncodingIndicator" + IsTapEnabled="True" + Style="{StaticResource StatusBarTextBlockStyle}" + Tapped="StatusBarComponent_OnTapped"> <TextBlock.ContextFlyout> - <MenuFlyout x:Name="EncodingSelectionFlyout" Placement="TopEdgeAlignedRight" Closing="StatusBarFlyout_OnClosing"> + <MenuFlyout + x:Name="EncodingSelectionFlyout" + Closing="StatusBarFlyout_OnClosing" + Placement="TopEdgeAlignedRight"> <MenuFlyout.MenuFlyoutPresenterStyle> <Style TargetType="MenuFlyoutPresenter"> - <!-- TODO: Remove CornerRadius property setter --> - <Setter Property="CornerRadius" Value="0" /> <Setter Property="BorderThickness" Value="0" /> </Style> </MenuFlyout.MenuFlyoutPresenterStyle> @@ -688,15 +826,16 @@ </TextBlock.ContextFlyout> </TextBlock> </Grid> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <Grid Column="7" - CornerRadius="0" - wctui:FrameworkElementExtensions.Cursor="Hand"> + + <Grid + wctui:FrameworkElementExtensions.Cursor="Hand" + Column="7" + CornerRadius="{ThemeResource ControlCornerRadius}"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="PointerEntered"> <Core:ChangePropertyAction PropertyName="Background"> <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}"/> + <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}" /> </Core:ChangePropertyAction.Value> </Core:ChangePropertyAction> </Core:EventTriggerBehavior> @@ -704,26 +843,29 @@ <Core:EventTriggerBehavior EventName="PointerExited"> <Core:ChangePropertyAction PropertyName="Background"> <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="Transparent"/> + <SolidColorBrush Color="Transparent" /> </Core:ChangePropertyAction.Value> </Core:ChangePropertyAction> </Core:EventTriggerBehavior> </Interactivity:Interaction.Behaviors> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <Grid x:Name="ShadowWindowIndicator" - CornerRadius="0" - Visibility="Collapsed" - Padding="6,6,6,6" - IsTapEnabled="True" - Tapped="StatusBarComponent_OnTapped"> + <Grid + x:Name="ShadowWindowIndicator" + Padding="6,6,6,6" + CornerRadius="{ThemeResource ControlCornerRadius}" + IsTapEnabled="True" + Tapped="StatusBarComponent_OnTapped" + Visibility="Collapsed"> <Viewbox> - <FontIcon Glyph="" Foreground="{ThemeResource SystemControlForegroundBaseMediumHighBrush}"/> + <FontIcon Foreground="{ThemeResource SystemControlForegroundBaseMediumHighBrush}" Glyph="" /> </Viewbox> </Grid> </Grid> </Grid> - <Canvas Grid.Row="2" x:Name="PrintCanvas" Opacity="0"/> + <Canvas + x:Name="PrintCanvas" + Grid.Row="2" + Opacity="0" /> </Grid> </Page> diff --git a/src/Notepads/Views/Settings/AboutPage.xaml b/src/Notepads/Views/Settings/AboutPage.xaml index a051b084e..24d0f852c 100644 --- a/src/Notepads/Views/Settings/AboutPage.xaml +++ b/src/Notepads/Views/Settings/AboutPage.xaml @@ -4,13 +4,13 @@ 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" - mc:Ignorable="d" - Background="{ThemeResource SystemControlForegroundTransparentBrush}"> + Background="{ThemeResource SystemControlForegroundTransparentBrush}" + mc:Ignorable="d"> <Grid> <Grid.ChildrenTransitions> <TransitionCollection> - <EntranceThemeTransition FromHorizontalOffset="25" FromVerticalOffset="0"/> + <EntranceThemeTransition FromHorizontalOffset="25" FromVerticalOffset="0" /> </TransitionCollection> </Grid.ChildrenTransitions> <Grid.BackgroundTransition> @@ -24,28 +24,35 @@ UseSystemFocusVisuals="False" VerticalScrollBarVisibility="Auto" VerticalScrollMode="Auto"> - <StackPanel HorizontalAlignment="Left" Margin="0,0,0,40"> - <StackPanel Orientation="Horizontal" Margin="0,15,0,0"> - <Image x:Name="AppIconImage" Width="90" Margin="-6,0,0,0" Source="/Assets/appicon_ws.png"/> + <StackPanel Margin="0,0,0,40" HorizontalAlignment="Left"> + <StackPanel Margin="0,15,0,0" Orientation="Horizontal"> + <Image + x:Name="AppIconImage" + Width="90" + Margin="-6,0,0,0" + Source="/Assets/appicon_ws.png" /> <StackPanel Margin="10,0,0,0"> <TextBlock Margin="0,5,0,0" - FontWeight="Normal" FontSize="25" + FontWeight="Normal" Text="{x:Bind AppName, Mode=OneTime}" /> <TextBlock Margin="2,5,0,5" - FontWeight="Normal" FontSize="20" + FontWeight="Normal" Text="{x:Bind AppVersion, Mode=OneTime}" /> </StackPanel> </StackPanel> - <RichTextBlock MaxWidth="600" Margin="0,15,0,0" IsTextSelectionEnabled="False"> + <RichTextBlock + MaxWidth="600" + Margin="0,15,0,0" + IsTextSelectionEnabled="False"> <Paragraph> - <Run x:Uid="/Settings/AboutPage_NotepadsShortDescription"/> + <Run x:Uid="/Settings/AboutPage_NotepadsShortDescription" /> </Paragraph> <Paragraph Margin="0,15,0,0"> - <Run x:Uid="/Settings/AboutPage_Notepads_SourceCodeTitle"/> + <Run x:Uid="/Settings/AboutPage_Notepads_SourceCodeTitle" /> </Paragraph> <Paragraph> <Hyperlink NavigateUri="https://github.com/JasonStein/Notepads"> @@ -53,7 +60,7 @@ </Hyperlink> </Paragraph> <Paragraph Margin="0,15,0,0"> - <Run x:Uid="/Settings/AboutPage_Notepads_WebsiteTitle"/> + <Run x:Uid="/Settings/AboutPage_Notepads_WebsiteTitle" /> </Paragraph> <Paragraph> <Hyperlink NavigateUri="https://www.NotepadsApp.com"> @@ -61,13 +68,13 @@ </Hyperlink> </Paragraph> <Paragraph Margin="0,15,0,0"> - <Run x:Uid="/Settings/AboutPage_Notepads_AuthorContactsTitle"/> + <Run x:Uid="/Settings/AboutPage_Notepads_AuthorContactsTitle" /> <Hyperlink NavigateUri="mailto:NotepadsApp@outlook.com"> mailto:NotepadsApp@outlook.com </Hyperlink> </Paragraph> <Paragraph Margin="0,15,0,0"> - <Run x:Uid="/Settings/AboutPage_Notepads_IssueAndFeatureRequestsTitle"/> + <Run x:Uid="/Settings/AboutPage_Notepads_IssueAndFeatureRequestsTitle" /> </Paragraph> <Paragraph> <Hyperlink NavigateUri="https://github.com/JasonStein/Notepads/issues"> @@ -75,14 +82,20 @@ </Hyperlink> </Paragraph> </RichTextBlock> - <Button Content="Feedback" Margin="0,8,0,0" Visibility="Collapsed" /> + <Button + Margin="0,8,0,0" + Content="Feedback" + Visibility="Collapsed" /> <TextBlock x:Uid="/Settings/AboutPage_ChangelogUrl_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,20,0,0" - FontWeight="Normal"/> - <RichTextBlock IsTextSelectionEnabled="False" MaxWidth="600" Margin="0,10,0,0" > + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> + <RichTextBlock + MaxWidth="600" + Margin="0,10,0,0" + IsTextSelectionEnabled="False"> <Paragraph Margin="0,10,0,10"> <Hyperlink NavigateUri="https://github.com/JasonStein/Notepads/releases">Notepads Releases</Hyperlink> </Paragraph> @@ -90,10 +103,13 @@ <TextBlock x:Uid="/Settings/AboutPage_DependenciesAndReferences_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,20,0,0" - FontWeight="Normal"/> - <RichTextBlock IsTextSelectionEnabled="False" MaxWidth="600" Margin="0,10,0,0" > + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> + <RichTextBlock + MaxWidth="600" + Margin="0,10,0,0" + IsTextSelectionEnabled="False"> <Paragraph Margin="0,10,0,10"> <Hyperlink NavigateUri="https://github.com/Microsoft/microsoft-ui-xaml">Windows UI Library</Hyperlink> </Paragraph> @@ -119,19 +135,22 @@ <TextBlock x:Uid="/Settings/AboutPage_Disclaimer_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,20,0,0" - FontWeight="Normal"/> - <RichTextBlock MaxWidth="600" Margin="0,10,0,0" IsTextSelectionEnabled="False"> + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> + <RichTextBlock + MaxWidth="600" + Margin="0,10,0,0" + IsTextSelectionEnabled="False"> <Paragraph> - <Run x:Uid="/Settings/AboutPage_Disclaimer_Content"/> + <Run x:Uid="/Settings/AboutPage_Disclaimer_Content" /> </Paragraph> <Paragraph> - <LineBreak /> Copyright (c) 2020 Jackie (Jiaqi) Liu. - </Paragraph> + <LineBreak /> + Copyright (c) 2020 Jackie (Jiaqi) Liu.</Paragraph> <Paragraph Margin="0,10,0,10"> - <Hyperlink NavigateUri="https://github.com/JasonStein/Notepads" > - <Run x:Uid="/Settings/AboutPage_PrivacyStatementTitle"/> + <Hyperlink NavigateUri="https://github.com/JasonStein/Notepads"> + <Run x:Uid="/Settings/AboutPage_PrivacyStatementTitle" /> </Hyperlink> </Paragraph> </RichTextBlock> diff --git a/src/Notepads/Views/Settings/AdvancedSettingsPage.xaml b/src/Notepads/Views/Settings/AdvancedSettingsPage.xaml index 88e14cc37..e37d38f6c 100644 --- a/src/Notepads/Views/Settings/AdvancedSettingsPage.xaml +++ b/src/Notepads/Views/Settings/AdvancedSettingsPage.xaml @@ -5,13 +5,13 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:utilities="using:Notepads.Utilities" - mc:Ignorable="d" - Background="{ThemeResource SystemControlForegroundTransparentBrush}"> + Background="{ThemeResource SystemControlForegroundTransparentBrush}" + mc:Ignorable="d"> <Grid> <Grid.ChildrenTransitions> <TransitionCollection> - <EntranceThemeTransition FromHorizontalOffset="25" FromVerticalOffset="0"/> + <EntranceThemeTransition FromHorizontalOffset="25" FromVerticalOffset="0" /> </TransitionCollection> </Grid.ChildrenTransitions> <Grid.BackgroundTransition> @@ -25,84 +25,88 @@ UseSystemFocusVisuals="False" VerticalScrollBarVisibility="Auto" VerticalScrollMode="Auto"> - <StackPanel HorizontalAlignment="Left" Margin="0,0,0,40"> + <StackPanel Margin="0,0,0,40" HorizontalAlignment="Left"> <TextBlock x:Uid="/Settings/AdvancedPage_StatusBarSettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,15,0,0" - FontWeight="Normal"/> + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel Margin="0,10,0,0"> - <ToggleSwitch x:Uid="/Settings/AdvancedPage_StatusBarSettings_ShowHideStatusBarToggleSwitch" - Style="{StaticResource CustomToggleSwitchStyle}" - x:Name="ShowStatusBarToggleSwitch" /> + <ToggleSwitch x:Name="ShowStatusBarToggleSwitch" x:Uid="/Settings/AdvancedPage_StatusBarSettings_ShowHideStatusBarToggleSwitch" /> </StackPanel> <TextBlock x:Uid="/Settings/AdvancedPage_SmartCopySettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,15,0,0" - FontWeight="Normal"/> + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel Margin="0,10,0,0"> - <ToggleSwitch x:Uid="/Settings/AdvancedPage_SmartCopySettings_EnableSmartCopyToggleSwitch" - Style="{StaticResource CustomToggleSwitchStyle}" - x:Name="EnableSmartCopyToggleSwitch" /> - <TextBlock x:Uid="/Settings/AdvancedPage_SmartCopySettings_Description" Style="{ThemeResource DescriptionTextBlockStyle}" Margin="0,8,0,0"/> + <ToggleSwitch x:Name="EnableSmartCopyToggleSwitch" x:Uid="/Settings/AdvancedPage_SmartCopySettings_EnableSmartCopyToggleSwitch" /> + <TextBlock + x:Uid="/Settings/AdvancedPage_SmartCopySettings_Description" + Margin="0,8,0,0" + Style="{ThemeResource DescriptionTextBlockStyle}" /> </StackPanel> <TextBlock x:Name="SessionSnapshotSettingsTitle" x:Uid="/Settings/AdvancedPage_SessionSnapshotSettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,20,0,0" - FontWeight="Normal"/> + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel x:Name="SessionSnapshotSettingsControls" Margin="0,10,0,0"> - <ToggleSwitch x:Uid="/Settings/AdvancedPage_SessionSnapshotSettings_OnOffToggleSwitch" - Style="{StaticResource CustomToggleSwitchStyle}" - x:Name="EnableSessionSnapshotToggleSwitch" /> - <TextBlock x:Uid="/Settings/AdvancedPage_SessionSnapshotSettings_Description" Style="{ThemeResource DescriptionTextBlockStyle}" Margin="0,8,0,0"/> + <ToggleSwitch x:Name="EnableSessionSnapshotToggleSwitch" x:Uid="/Settings/AdvancedPage_SessionSnapshotSettings_OnOffToggleSwitch" /> + <TextBlock + x:Uid="/Settings/AdvancedPage_SessionSnapshotSettings_Description" + Margin="0,8,0,0" + Style="{ThemeResource DescriptionTextBlockStyle}" /> </StackPanel> <TextBlock x:Name="LaunchPreferenceSettingsTitle" x:Uid="/Settings/AdvancedPage_LaunchPreferenceSettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,25,0,0" - FontWeight="Normal"/> + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel x:Name="LaunchPreferenceSettingsControls" Margin="0,10,0,0"> - <ToggleSwitch x:Uid="/Settings/AdvancedPage_LaunchPreferenceSettings_AlwaysOpenNewWindowToggleSwitch" - Style="{StaticResource CustomToggleSwitchStyle}" - x:Name="AlwaysOpenNewWindowToggleSwitch" /> - <TextBlock x:Uid="/Settings/AdvancedPage_AlwaysOpenNewWindow_Description" Style="{ThemeResource DescriptionTextBlockStyle}" Margin="0,8,0,0"/> + <ToggleSwitch x:Name="AlwaysOpenNewWindowToggleSwitch" x:Uid="/Settings/AdvancedPage_LaunchPreferenceSettings_AlwaysOpenNewWindowToggleSwitch" /> + <TextBlock + x:Uid="/Settings/AdvancedPage_AlwaysOpenNewWindow_Description" + Margin="0,8,0,0" + Style="{ThemeResource DescriptionTextBlockStyle}" /> </StackPanel> <StackPanel x:Name="LanguagePreferenceSettingsPanel"> <TextBlock - x:Name="LanguagePreferenceSettingsTitle" - x:Uid="/Settings/AdvancedPage_LanguagePreferenceSettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" - Margin="0,25,0,0" - FontWeight="Normal"/> + x:Name="LanguagePreferenceSettingsTitle" + x:Uid="/Settings/AdvancedPage_LanguagePreferenceSettings_Title" + Margin="0,25,0,0" + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel x:Name="LanguagePreferenceSettingsControls" Margin="0,10,0,0"> - <ComboBox x:Name="LanguagePicker" - ItemsSource="{x:Bind SupportedLanguages, Mode=OneTime}" - HorizontalAlignment="Stretch" - VerticalAlignment="Center" - BorderThickness="1" - Height="36" - Background="Transparent" - IsTextSearchEnabled="True"> + <ComboBox + x:Name="LanguagePicker" + Height="36" + HorizontalAlignment="Stretch" + VerticalAlignment="Center" + Background="Transparent" + BorderThickness="1" + IsTextSearchEnabled="True" + ItemsSource="{x:Bind SupportedLanguages, Mode=OneTime}"> <ComboBox.ItemTemplate> <DataTemplate x:DataType="utilities:LanguageItem"> <TextBlock Text="{x:Bind Name}" /> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> - <TextBlock x:Name="RestartPrompt" - x:Uid="/Settings/AdvancedPage_LanguagePreferenceSettings_RestartPrompt" - Style="{ThemeResource DescriptionTextBlockStyle}" - Foreground="{ThemeResource SystemControlErrorTextForegroundBrush}" - TextWrapping="Wrap" - Visibility="Collapsed" - Margin="0,4,0,0"/> - <TextBlock x:Uid="/Settings/AdvancedPage_LanguagePreferenceSettings_Description" - Style="{ThemeResource DescriptionTextBlockStyle}" - Margin="0,8,0,0"/> + <TextBlock + x:Name="RestartPrompt" + x:Uid="/Settings/AdvancedPage_LanguagePreferenceSettings_RestartPrompt" + Margin="0,4,0,0" + Foreground="{ThemeResource SystemControlErrorTextForegroundBrush}" + Style="{ThemeResource DescriptionTextBlockStyle}" + TextWrapping="Wrap" + Visibility="Collapsed" /> + <TextBlock + x:Uid="/Settings/AdvancedPage_LanguagePreferenceSettings_Description" + Margin="0,8,0,0" + Style="{ThemeResource DescriptionTextBlockStyle}" /> </StackPanel> </StackPanel> </StackPanel> diff --git a/src/Notepads/Views/Settings/PersonalizationSettingsPage.xaml b/src/Notepads/Views/Settings/PersonalizationSettingsPage.xaml index 8d4d86ed9..3eebd5f68 100644 --- a/src/Notepads/Views/Settings/PersonalizationSettingsPage.xaml +++ b/src/Notepads/Views/Settings/PersonalizationSettingsPage.xaml @@ -5,88 +5,97 @@ 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 SystemControlForegroundTransparentBrush}"> + Background="{ThemeResource SystemControlForegroundTransparentBrush}" + mc:Ignorable="d"> <Grid> <Grid.ChildrenTransitions> <TransitionCollection> - <EntranceThemeTransition FromHorizontalOffset="25" FromVerticalOffset="0"/> + <EntranceThemeTransition FromHorizontalOffset="25" FromVerticalOffset="0" /> </TransitionCollection> </Grid.ChildrenTransitions> <Grid.BackgroundTransition> <BrushTransition /> </Grid.BackgroundTransition> - <ScrollViewer Grid.Row="0" - Padding="20,0,20,0" - IsTabStop="False" - UseSystemFocusVisuals="False" - VerticalScrollBarVisibility="Auto" - VerticalScrollMode="Auto"> - <StackPanel HorizontalAlignment="Left" Margin="0,0,0,40"> - <TextBlock x:Uid="/Settings/PersonalizationPage_ThemeModeSettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" - Margin="0,15,0,0" - FontWeight="Normal"/> + <ScrollViewer + Grid.Row="0" + Padding="20,0,20,0" + IsTabStop="False" + UseSystemFocusVisuals="False" + VerticalScrollBarVisibility="Auto" + VerticalScrollMode="Auto"> + <StackPanel Margin="0,0,0,40" HorizontalAlignment="Left"> + <TextBlock + x:Uid="/Settings/PersonalizationPage_ThemeModeSettings_Title" + Margin="0,15,0,0" + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel x:Name="ThemePanel" Margin="0,10,0,0"> - <RadioButton x:Uid="/Settings/PersonalizationPage_ThemeModeSettings_LightModeRadioButton" - Style="{StaticResource CustomRadioButtonStyle}" - x:Name="ThemeModeLightButton" - Tag="Light" /> - <RadioButton x:Uid="/Settings/PersonalizationPage_ThemeModeSettings_DarkModeRadioButton" - Style="{StaticResource CustomRadioButtonStyle}" - x:Name="ThemeModeDarkButton" - Tag="Dark" /> - <RadioButton x:Uid="/Settings/PersonalizationPage_ThemeModeSettings_WindowsModeRadioButton" - Style="{StaticResource CustomRadioButtonStyle}" - x:Name="ThemeModeDefaultButton" - Tag="Default" /> + <RadioButton + x:Name="ThemeModeLightButton" + x:Uid="/Settings/PersonalizationPage_ThemeModeSettings_LightModeRadioButton" + Tag="Light" /> + <RadioButton + x:Name="ThemeModeDarkButton" + x:Uid="/Settings/PersonalizationPage_ThemeModeSettings_DarkModeRadioButton" + Tag="Dark" /> + <RadioButton + x:Name="ThemeModeDefaultButton" + x:Uid="/Settings/PersonalizationPage_ThemeModeSettings_WindowsModeRadioButton" + Tag="Default" /> </StackPanel> - <TextBlock x:Name="BackgroundTintOpacityTitle" - x:Uid="/Settings/PersonalizationPage_BackgroundTintOpacitySettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" - Margin="0,20,0,0" - FontWeight="Normal"/> + <TextBlock + x:Name="BackgroundTintOpacityTitle" + x:Uid="/Settings/PersonalizationPage_BackgroundTintOpacitySettings_Title" + Margin="0,20,0,0" + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel x:Name="BackgroundTintOpacityControls" Margin="0,10,0,0"> <StackPanel Orientation="Horizontal"> - <Slider Style="{StaticResource CustomSliderStyle}" - x:Name="BackgroundTintOpacitySlider" - Minimum="0" Maximum="100" - StepFrequency="1" - Margin="0,0,10,0" - Width="200"/> - <TextBlock Text="{x:Bind BackgroundTintOpacitySlider.Value, Mode=OneWay}" - Height="{x:Bind BackgroundTintOpacitySlider.Height, Mode=OneWay}" - VerticalAlignment="Center" - FontSize="18"/> - <TextBlock Text="%" - Height="{x:Bind BackgroundTintOpacitySlider.Height, Mode=OneWay}" - VerticalAlignment="Center" - FontSize="18"/> + <Slider + x:Name="BackgroundTintOpacitySlider" + Width="200" + Margin="0,0,10,0" + Maximum="100" + Minimum="0" + StepFrequency="1" /> + <TextBlock + Height="{x:Bind BackgroundTintOpacitySlider.Height, Mode=OneWay}" + VerticalAlignment="Center" + FontSize="18" + Text="{x:Bind BackgroundTintOpacitySlider.Value, Mode=OneWay}" /> + <TextBlock + Height="{x:Bind BackgroundTintOpacitySlider.Height, Mode=OneWay}" + VerticalAlignment="Center" + FontSize="18" + Text="%" /> </StackPanel> - <TextBlock x:Uid="/Settings/PersonalizationPage_BackgroundTintOpacitySettings_Description" - Style="{ThemeResource DescriptionTextBlockStyle}" - Margin="0,8,0,0"/> + <TextBlock + x:Uid="/Settings/PersonalizationPage_BackgroundTintOpacitySettings_Description" + Margin="0,8,0,0" + Style="{ThemeResource DescriptionTextBlockStyle}" /> </StackPanel> - <TextBlock x:Uid="/Settings/PersonalizationPage_AccentColorSettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" - Margin="0,20,0,0" - FontWeight="Normal"/> + <TextBlock + x:Uid="/Settings/PersonalizationPage_AccentColorSettings_Title" + Margin="0,20,0,0" + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel Margin="0,10,0,0"> - <ToggleSwitch x:Uid="/Settings/PersonalizationPage_AccentColorSettings_UseWindowsAccentColorToggleSwitch" - Style="{StaticResource CustomToggleSwitchStyle}" - x:Name="AccentColorToggle" Margin="0,0,0,8"/> + <ToggleSwitch + x:Name="AccentColorToggle" + x:Uid="/Settings/PersonalizationPage_AccentColorSettings_UseWindowsAccentColorToggleSwitch" + Margin="0,0,0,8" /> <Viewbox MaxWidth="300" Stretch="Fill"> - <muxc:ColorPicker x:Name="AccentColorPicker" - ColorSpectrumShape="Ring" - IsColorSliderVisible="True" - IsColorChannelTextInputVisible="True" - IsHexInputVisible="True" - IsAlphaEnabled="False" - IsAlphaSliderVisible="True" - IsAlphaTextInputVisible="True"> - </muxc:ColorPicker> + <muxc:ColorPicker + x:Name="AccentColorPicker" + ColorSpectrumShape="Ring" + IsAlphaEnabled="False" + IsAlphaSliderVisible="True" + IsAlphaTextInputVisible="True" + IsColorChannelTextInputVisible="True" + IsColorSliderVisible="True" + IsHexInputVisible="True" /> </Viewbox> </StackPanel> diff --git a/src/Notepads/Views/Settings/SettingsPage.xaml b/src/Notepads/Views/Settings/SettingsPage.xaml index f1c09b810..763811473 100644 --- a/src/Notepads/Views/Settings/SettingsPage.xaml +++ b/src/Notepads/Views/Settings/SettingsPage.xaml @@ -6,54 +6,45 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:muxc="using:Microsoft.UI.Xaml.Controls" xmlns:settings="using:Notepads.Views.Settings" - mc:Ignorable="d" - Background="{ThemeResource SystemControlForegroundTransparentBrush}"> + Background="{ThemeResource SystemControlForegroundTransparentBrush}" + mc:Ignorable="d"> - <muxc:NavigationView x:Name="SettingsNavigationView" - IsPaneOpen="False" - IsSettingsVisible="False" - IsBackEnabled="False" - IsBackButtonVisible="Collapsed" - PaneDisplayMode="LeftCompact" - OpenPaneLength="200" - PaneToggleButtonStyle="{StaticResource PaneToggleButtonStyle}" - ItemInvoked="SettingsPanel_OnItemInvoked"> + <muxc:NavigationView + x:Name="SettingsNavigationView" + IsBackButtonVisible="Collapsed" + IsBackEnabled="False" + IsPaneOpen="False" + IsSettingsVisible="False" + ItemInvoked="SettingsPanel_OnItemInvoked" + OpenPaneLength="200" + PaneDisplayMode="LeftCompact" + PaneToggleButtonStyle="{StaticResource PaneToggleButtonStyle}"> <muxc:NavigationView.MenuItems> - <muxc:NavigationViewItem x:Uid="/Settings/TextAndEditorPage_Title" - Style="{StaticResource CustomNavigationViewItemStyle}" - Tag="TextAndEditor" - IsSelected="True"> + <muxc:NavigationViewItem + x:Uid="/Settings/TextAndEditorPage_Title" + IsSelected="True" + Tag="TextAndEditor"> <muxc:NavigationViewItem.Icon> - <FontIcon FontFamily="Segoe MDL2 Assets" - Glyph="" /> + <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> </muxc:NavigationViewItem.Icon> </muxc:NavigationViewItem> - <muxc:NavigationViewItem x:Uid="/Settings/PersonalizationPage_Title" - Style="{StaticResource CustomNavigationViewItemStyle}" - Tag="Personalization" > + <muxc:NavigationViewItem x:Uid="/Settings/PersonalizationPage_Title" Tag="Personalization"> <muxc:NavigationViewItem.Icon> - <FontIcon FontFamily="Segoe MDL2 Assets" - Glyph="" /> + <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> </muxc:NavigationViewItem.Icon> </muxc:NavigationViewItem> - <muxc:NavigationViewItem x:Uid="/Settings/AdvancedPage_Title" - Style="{StaticResource CustomNavigationViewItemStyle}" - Tag="Advanced" > + <muxc:NavigationViewItem x:Uid="/Settings/AdvancedPage_Title" Tag="Advanced"> <muxc:NavigationViewItem.Icon> - <FontIcon FontFamily="Segoe MDL2 Assets" - Glyph="" /> + <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> </muxc:NavigationViewItem.Icon> </muxc:NavigationViewItem> - <muxc:NavigationViewItem x:Uid="/Settings/AboutPage_Title" - Style="{StaticResource CustomNavigationViewItemStyle}" - Tag="About" > + <muxc:NavigationViewItem x:Uid="/Settings/AboutPage_Title" Tag="About"> <muxc:NavigationViewItem.Icon> - <FontIcon FontFamily="Segoe MDL2 Assets" - Glyph="" /> + <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> </muxc:NavigationViewItem.Icon> </muxc:NavigationViewItem> </muxc:NavigationView.MenuItems> - <settings:SettingsPanel x:Name="SettingsPanel"/> + <settings:SettingsPanel x:Name="SettingsPanel" /> </muxc:NavigationView> </Page> diff --git a/src/Notepads/Views/Settings/SettingsPanel.xaml b/src/Notepads/Views/Settings/SettingsPanel.xaml index 97cc6f703..e838a71be 100644 --- a/src/Notepads/Views/Settings/SettingsPanel.xaml +++ b/src/Notepads/Views/Settings/SettingsPanel.xaml @@ -4,23 +4,20 @@ 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" - mc:Ignorable="d" - Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" + mc:Ignorable="d"> <Page.Resources> <ResourceDictionary> <ResourceDictionary.ThemeDictionaries> <ResourceDictionary x:Key="Light"> - <SolidColorBrush x:Key="SettingsPanelBackgroundBrush" - Color="WhiteSmoke"/> + <SolidColorBrush x:Key="SettingsPanelBackgroundBrush" Color="WhiteSmoke" /> </ResourceDictionary> <ResourceDictionary x:Key="Dark"> - <SolidColorBrush x:Key="SettingsPanelBackgroundBrush" - Color="#222222"/> + <SolidColorBrush x:Key="SettingsPanelBackgroundBrush" Color="#222222" /> </ResourceDictionary> <ResourceDictionary x:Key="HighContrast"> - <SolidColorBrush x:Key="SettingsPanelBackgroundBrush" - Color="{StaticResource SystemColorHighlightColor}"/> + <SolidColorBrush x:Key="SettingsPanelBackgroundBrush" Color="{StaticResource SystemColorHighlightColor}" /> </ResourceDictionary> </ResourceDictionary.ThemeDictionaries> </ResourceDictionary> @@ -28,21 +25,23 @@ <Grid Background="{ThemeResource SettingsPanelBackgroundBrush}"> <Grid.RowDefinitions> - <RowDefinition Height="60"/> - <RowDefinition Height="*"/> + <RowDefinition Height="60" /> + <RowDefinition Height="*" /> </Grid.RowDefinitions> - <Grid Row="0" - Margin="18,0,18,0" - BorderThickness="0,0,0,1" - BorderBrush="{ThemeResource SystemControlForegroundBaseMediumLowBrush}"> - <TextBlock x:Name="TitleTextBlock" - Padding="0,0,0,10" - FontSize="24" - VerticalAlignment="Bottom"/> + <Grid + Margin="18,0,18,0" + BorderBrush="{ThemeResource SystemControlForegroundBaseMediumLowBrush}" + BorderThickness="0,0,0,1" + Row="0"> + <TextBlock + x:Name="TitleTextBlock" + Padding="0,0,0,10" + VerticalAlignment="Bottom" + FontSize="24" /> </Grid> <Grid Row="1"> - <Frame x:Name="ContentFrame"/> + <Frame x:Name="ContentFrame" /> </Grid> </Grid> </Page> diff --git a/src/Notepads/Views/Settings/TextAndEditorSettingsPage.xaml b/src/Notepads/Views/Settings/TextAndEditorSettingsPage.xaml index 450cc2ffd..1ed2e02b5 100644 --- a/src/Notepads/Views/Settings/TextAndEditorSettingsPage.xaml +++ b/src/Notepads/Views/Settings/TextAndEditorSettingsPage.xaml @@ -5,13 +5,13 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:settings="using:Notepads.Services" - mc:Ignorable="d" - Background="{ThemeResource SystemControlForegroundTransparentBrush}"> + Background="{ThemeResource SystemControlForegroundTransparentBrush}" + mc:Ignorable="d"> <Grid> <Grid.ChildrenTransitions> <TransitionCollection> - <EntranceThemeTransition FromHorizontalOffset="25" FromVerticalOffset="0"/> + <EntranceThemeTransition FromHorizontalOffset="25" FromVerticalOffset="0" /> </TransitionCollection> </Grid.ChildrenTransitions> <Grid.BackgroundTransition> @@ -25,202 +25,295 @@ UseSystemFocusVisuals="False" VerticalScrollBarVisibility="Auto" VerticalScrollMode="Auto"> - <StackPanel HorizontalAlignment="Left" Margin="0,0,0,40"> + <StackPanel Margin="0,0,0,40" HorizontalAlignment="Left"> <TextBlock x:Uid="/Settings/TextAndEditorPage_TextWrappingSettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,15,0,0" - FontWeight="Normal"/> + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel Margin="0,10,0,0"> - <ToggleSwitch x:Uid="/Settings/TextAndEditorPage_TextWrappingSettings_ToggleSwitch" - Style="{StaticResource CustomToggleSwitchStyle}" - x:Name="TextWrappingToggle"/> + <ToggleSwitch x:Name="TextWrappingToggle" x:Uid="/Settings/TextAndEditorPage_TextWrappingSettings_ToggleSwitch" /> </StackPanel> <TextBlock x:Uid="/Settings/TextAndEditorPage_SpellingSettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,20,0,0" - FontWeight="Normal"/> + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel Margin="0,10,0,0"> - <ToggleSwitch x:Uid="/Settings/TextAndEditorPage_SpellingSettings_HighlightMisspelledWordsToggleSwitch" - Style="{StaticResource CustomToggleSwitchStyle}" - x:Name="HighlightMisspelledWordsToggle"/> + <ToggleSwitch x:Name="HighlightMisspelledWordsToggle" x:Uid="/Settings/TextAndEditorPage_SpellingSettings_HighlightMisspelledWordsToggleSwitch" /> </StackPanel> <TextBlock x:Uid="/Settings/TextAndEditorPage_DisplaySettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,20,0,0" - FontWeight="Normal"/> + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel Margin="0,10,0,0"> - <ToggleSwitch x:Uid="/Settings/TextAndEditorPage_LineHighlighterSettings_ToggleSwitch" - Style="{StaticResource CustomToggleSwitchStyle}" - x:Name="LineHighlighterToggle" - Margin="0,0,0,10"/> - <ToggleSwitch x:Uid="/Settings/TextAndEditorPage_LineNumbersSettings_ToggleSwitch" - Style="{StaticResource CustomToggleSwitchStyle}" - x:Name="LineNumbersToggle"/> - <TextBlock x:Uid="/Settings/TextAndEditorPage_LineNumbersSettings_Description" Style="{ThemeResource DescriptionTextBlockStyle}" Margin="0,8,0,0"/> + <ToggleSwitch + x:Name="LineHighlighterToggle" + x:Uid="/Settings/TextAndEditorPage_LineHighlighterSettings_ToggleSwitch" + Margin="0,0,0,10" /> + <ToggleSwitch x:Name="LineNumbersToggle" x:Uid="/Settings/TextAndEditorPage_LineNumbersSettings_ToggleSwitch" /> + <TextBlock + x:Uid="/Settings/TextAndEditorPage_LineNumbersSettings_Description" + Margin="0,8,0,0" + Style="{ThemeResource DescriptionTextBlockStyle}" /> </StackPanel> <TextBlock x:Uid="/Settings/TextAndEditorPage_FontSettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,25,0,0" - FontWeight="Normal"/> + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel Margin="0,10,0,0"> - <ComboBox x:Name="FontFamilyPicker" - ItemsSource="{x:Bind AvailableFonts, Mode=OneTime}" - HorizontalAlignment="Stretch" - VerticalAlignment="Center" - BorderThickness="1" - Height="36" - Background="Transparent" - IsTextSearchEnabled="True"> + <ComboBox + x:Name="FontFamilyPicker" + Height="36" + HorizontalAlignment="Stretch" + VerticalAlignment="Center" + Background="Transparent" + BorderThickness="1" + IsTextSearchEnabled="True" + ItemsSource="{x:Bind AvailableFonts, Mode=OneTime}"> <ComboBox.ItemTemplate> <DataTemplate> - <TextBlock Text="{Binding}" - FontFamily="{Binding}" /> + <TextBlock FontFamily="{Binding}" Text="{Binding}" /> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> - <ComboBox x:Name="FontSizePicker" - ItemsSource="{x:Bind AvailableFontSizes, Mode=OneTime}" - IsEditable="False" - Margin="0,10,0,0" - VerticalAlignment="Center" - BorderThickness="1" - Height="36" - MinWidth="70" - Background="Transparent"> - </ComboBox> + <ComboBox + x:Name="FontSizePicker" + Height="36" + MinWidth="70" + Margin="0,10,0,0" + VerticalAlignment="Center" + Background="Transparent" + BorderThickness="1" + IsEditable="False" + ItemsSource="{x:Bind AvailableFontSizes, Mode=OneTime}" /> </StackPanel> <TextBlock x:Uid="/Settings/TextAndEditorPage_FontStyleSettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,20,0,0" - FontWeight="Normal"/> + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel Margin="0,10,0,0"> - <ComboBox x:Name="FontStylePicker" - ItemsSource="{x:Bind AvailableFontStyles, Mode=OneTime}" - FontFamily="{x:Bind settings:AppSettingsService.EditorFontFamily}" - VerticalAlignment="Center" - BorderThickness="1" - Height="36" - Background="Transparent" - IsTextSearchEnabled="True"> + <ComboBox + x:Name="FontStylePicker" + Height="36" + VerticalAlignment="Center" + Background="Transparent" + BorderThickness="1" + FontFamily="{x:Bind settings:AppSettingsService.EditorFontFamily}" + IsTextSearchEnabled="True" + ItemsSource="{x:Bind AvailableFontStyles, Mode=OneTime}"> <ComboBox.ItemTemplate> <DataTemplate> - <TextBlock Text="{Binding FontStyleLocalizedName}" - FontStyle="{Binding FontStyle}" /> + <TextBlock FontStyle="{Binding FontStyle}" Text="{Binding FontStyleLocalizedName}" /> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> </StackPanel> <TextBlock x:Uid="/Settings/TextAndEditorPage_FontWeightSettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,20,0,0" - FontWeight="Normal"/> + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel Margin="0,10,0,0"> - <ComboBox x:Name="FontWeightPicker" - ItemsSource="{x:Bind AvailableFontWeights, Mode=OneTime}" - FontFamily="{x:Bind settings:AppSettingsService.EditorFontFamily}" - IsEditable="False" - VerticalAlignment="Center" - BorderThickness="1" - Height="36" - MinWidth="70" - Background="Transparent"> + <ComboBox + x:Name="FontWeightPicker" + Height="36" + MinWidth="70" + VerticalAlignment="Center" + Background="Transparent" + BorderThickness="1" + FontFamily="{x:Bind settings:AppSettingsService.EditorFontFamily}" + IsEditable="False" + ItemsSource="{x:Bind AvailableFontWeights, Mode=OneTime}"> <ComboBox.ItemTemplate> <DataTemplate> - <TextBlock Text="{Binding FontWeightLocalizedName}" - FontWeight="{Binding FontWeight}" /> + <TextBlock FontWeight="{Binding FontWeight}" Text="{Binding FontWeightLocalizedName}" /> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> </StackPanel> <TextBlock x:Uid="/Settings/TextAndEditorPage_LineEndingSettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,25,0,0" - FontWeight="Normal"/> + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel x:Name="LineEndingPanel" Margin="0,10,0,0"> - <RadioButton Style="{StaticResource CustomRadioButtonStyle}" x:Name="CrlfRadioButton" Tag="Crlf" Content="Windows (CRLF)" GroupName="LineEndingGroup"/> - <RadioButton Style="{StaticResource CustomRadioButtonStyle}" x:Name="CrRadioButton" Tag="Cr" Content="Macintosh (CR)" GroupName="LineEndingGroup"/> - <RadioButton Style="{StaticResource CustomRadioButtonStyle}" x:Name="LfRadioButton" Tag="Lf" Content="Unix (LF)" GroupName="LineEndingGroup"/> + <RadioButton + x:Name="CrlfRadioButton" + Content="Windows (CRLF)" + GroupName="LineEndingGroup" + Tag="Crlf" /> + <RadioButton + x:Name="CrRadioButton" + Content="Macintosh (CR)" + GroupName="LineEndingGroup" + Tag="Cr" /> + <RadioButton + x:Name="LfRadioButton" + Content="Unix (LF)" + GroupName="LineEndingGroup" + Tag="Lf" /> </StackPanel> - <TextBlock x:Uid="/Settings/TextAndEditorPage_LineEndingSettings_Description" Style="{ThemeResource DescriptionTextBlockStyle}" Margin="0,8,0,0"/> + <TextBlock + x:Uid="/Settings/TextAndEditorPage_LineEndingSettings_Description" + Margin="0,8,0,0" + Style="{ThemeResource DescriptionTextBlockStyle}" /> <TextBlock x:Uid="/Settings/TextAndEditorPage_EncodingSettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,25,0,0" - FontWeight="Normal"/> + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel x:Name="EncodingPanel" Margin="0,10,0,0"> - <RadioButton Style="{StaticResource CustomRadioButtonStyle}" x:Name="Utf8EncodingRadioButton" Tag="UTF-8" Content="UTF-8" GroupName="EncodingGroup"/> - <RadioButton Style="{StaticResource CustomRadioButtonStyle}" x:Name="Utf8BomEncodingRadioButton" Tag="UTF-8-BOM" Content="UTF-8-BOM" GroupName="EncodingGroup"/> - <RadioButton Style="{StaticResource CustomRadioButtonStyle}" x:Name="Utf16LeBomEncodingRadioButton" Tag="UTF-16 LE BOM" Content="UTF-16 LE BOM" GroupName="EncodingGroup"/> - <RadioButton Style="{StaticResource CustomRadioButtonStyle}" x:Name="Utf16BeBomEncodingRadioButton" Tag="UTF-16 BE BOM" Content="UTF-16 BE BOM" GroupName="EncodingGroup"/> + <RadioButton + x:Name="Utf8EncodingRadioButton" + Content="UTF-8" + GroupName="EncodingGroup" + Tag="UTF-8" /> + <RadioButton + x:Name="Utf8BomEncodingRadioButton" + Content="UTF-8-BOM" + GroupName="EncodingGroup" + Tag="UTF-8-BOM" /> + <RadioButton + x:Name="Utf16LeBomEncodingRadioButton" + Content="UTF-16 LE BOM" + GroupName="EncodingGroup" + Tag="UTF-16 LE BOM" /> + <RadioButton + x:Name="Utf16BeBomEncodingRadioButton" + Content="UTF-16 BE BOM" + GroupName="EncodingGroup" + Tag="UTF-16 BE BOM" /> </StackPanel> - <TextBlock x:Uid="/Settings/TextAndEditorPage_EncodingSettings_Description" Style="{ThemeResource DescriptionTextBlockStyle}" Margin="0,8,0,0"/> + <TextBlock + x:Uid="/Settings/TextAndEditorPage_EncodingSettings_Description" + Margin="0,8,0,0" + Style="{ThemeResource DescriptionTextBlockStyle}" /> <TextBlock x:Uid="/Settings/TextAndEditorPage_DecodingSettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,25,0,0" - FontWeight="Normal"/> + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel x:Name="DecodingPanel" Margin="0,10,0,0"> - <RadioButton x:Uid="/Settings/TextAndEditorPage_DecodingSettings_AutoGuessRadioButton" Style="{StaticResource CustomRadioButtonStyle}" x:Name="AutoGuessDecodingRadioButton" Tag="Auto" GroupName="DecodingGroup"/> - <RadioButton x:Uid="/Settings/TextAndEditorPage_DecodingSettings_Utf8RadioButton" Style="{StaticResource CustomRadioButtonStyle}" x:Name="Utf8DecodingRadioButton" Tag="UTF-8" GroupName="DecodingGroup"/> - <RadioButton x:Uid="/Settings/TextAndEditorPage_DecodingSettings_AnsiRadioButton" Style="{StaticResource CustomRadioButtonStyle}" x:Name="AnsiDecodingRadioButton" Tag="ANSI" GroupName="DecodingGroup"/> + <RadioButton + x:Name="AutoGuessDecodingRadioButton" + x:Uid="/Settings/TextAndEditorPage_DecodingSettings_AutoGuessRadioButton" + GroupName="DecodingGroup" + Tag="Auto" /> + <RadioButton + x:Name="Utf8DecodingRadioButton" + x:Uid="/Settings/TextAndEditorPage_DecodingSettings_Utf8RadioButton" + GroupName="DecodingGroup" + Tag="UTF-8" /> + <RadioButton + x:Name="AnsiDecodingRadioButton" + x:Uid="/Settings/TextAndEditorPage_DecodingSettings_AnsiRadioButton" + GroupName="DecodingGroup" + Tag="ANSI" /> </StackPanel> - <TextBlock x:Uid="/Settings/TextAndEditorPage_DecodingSettings_Description" Style="{ThemeResource DescriptionTextBlockStyle}" Margin="0,8,0,0"/> + <TextBlock + x:Uid="/Settings/TextAndEditorPage_DecodingSettings_Description" + Margin="0,8,0,0" + Style="{ThemeResource DescriptionTextBlockStyle}" /> <TextBlock x:Uid="/Settings/TextAndEditorPage_TabKeySettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,25,0,0" - FontWeight="Normal"/> + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel x:Name="TabBehaviorPanel" Margin="0,10,0,0"> - <RadioButton x:Uid="/Settings/TextAndEditorPage_TabKeySettings_DefaultRadioButton" Style="{StaticResource CustomRadioButtonStyle}" x:Name="TabDefaultRadioButton" Tag="-1" GroupName="TabBehaviorGroup"/> - <RadioButton x:Uid="/Settings/TextAndEditorPage_TabKeySettings_TwoSpacesRadioButton" Style="{StaticResource CustomRadioButtonStyle}" x:Name="TabTwoSpacesRadioButton" Tag="2" GroupName="TabBehaviorGroup"/> - <RadioButton x:Uid="/Settings/TextAndEditorPage_TabKeySettings_FourSpacesRadioButton" Style="{StaticResource CustomRadioButtonStyle}" x:Name="TabFourSpacesRadioButton" Tag="4" GroupName="TabBehaviorGroup"/> - <RadioButton x:Uid="/Settings/TextAndEditorPage_TabKeySettings_EightSpacesRadioButton" Style="{StaticResource CustomRadioButtonStyle}" x:Name="TabEightSpacesRadioButton" Tag="8" GroupName="TabBehaviorGroup"/> + <RadioButton + x:Name="TabDefaultRadioButton" + x:Uid="/Settings/TextAndEditorPage_TabKeySettings_DefaultRadioButton" + GroupName="TabBehaviorGroup" + Tag="-1" /> + <RadioButton + x:Name="TabTwoSpacesRadioButton" + x:Uid="/Settings/TextAndEditorPage_TabKeySettings_TwoSpacesRadioButton" + GroupName="TabBehaviorGroup" + Tag="2" /> + <RadioButton + x:Name="TabFourSpacesRadioButton" + x:Uid="/Settings/TextAndEditorPage_TabKeySettings_FourSpacesRadioButton" + GroupName="TabBehaviorGroup" + Tag="4" /> + <RadioButton + x:Name="TabEightSpacesRadioButton" + x:Uid="/Settings/TextAndEditorPage_TabKeySettings_EightSpacesRadioButton" + GroupName="TabBehaviorGroup" + Tag="8" /> </StackPanel> - <TextBlock x:Uid="/Settings/TextAndEditorPage_TabKeySettings_Description" Style="{ThemeResource DescriptionTextBlockStyle}" Margin="0,8,0,0"/> + <TextBlock + x:Uid="/Settings/TextAndEditorPage_TabKeySettings_Description" + Margin="0,8,0,0" + Style="{ThemeResource DescriptionTextBlockStyle}" /> <TextBlock x:Uid="/Settings/TextAndEditorPage_SearchEngineSettings_Title" - Style="{StaticResource CompactSubtitleTextBlockStyle}" Margin="0,25,0,0" - FontWeight="Normal"/> + FontWeight="Normal" + Style="{StaticResource CompactSubtitleTextBlockStyle}" /> <StackPanel x:Name="SearchEnginePanel" Margin="0,10,0,0"> - <RadioButton Style="{StaticResource CustomRadioButtonStyle}" x:Name="BingRadioButton" GroupName="SearchEngineGroup"> + <RadioButton x:Name="BingRadioButton" GroupName="SearchEngineGroup"> <StackPanel Orientation="Horizontal"> - <Image Source="ms-appx:///Assets/search_bing.png" Width="16" Stretch="Uniform"/> - <TextBlock Text="Bing" Margin="8,0,0,0"/> + <Image + Width="16" + Source="ms-appx:///Assets/search_bing.png" + Stretch="Uniform" /> + <TextBlock Margin="8,0,0,0" Text="Bing" /> </StackPanel> </RadioButton> - <RadioButton Style="{StaticResource CustomRadioButtonStyle}" x:Name="GoogleRadioButton" GroupName="SearchEngineGroup"> + <RadioButton x:Name="GoogleRadioButton" GroupName="SearchEngineGroup"> <StackPanel Orientation="Horizontal"> - <Image Source="ms-appx:///Assets/search_google.png" Width="16" Stretch="Uniform"/> - <TextBlock Text="Google" Margin="8,0,0,0"/> + <Image + Width="16" + Source="ms-appx:///Assets/search_google.png" + Stretch="Uniform" /> + <TextBlock Margin="8,0,0,0" Text="Google" /> </StackPanel> </RadioButton> - <RadioButton Style="{StaticResource CustomRadioButtonStyle}" x:Name="DuckDuckGoRadioButton" GroupName="SearchEngineGroup"> + <RadioButton x:Name="DuckDuckGoRadioButton" GroupName="SearchEngineGroup"> <StackPanel Orientation="Horizontal"> - <Image Source="ms-appx:///Assets/search_duckduckgo.png" Width="16" Stretch="Uniform"/> - <TextBlock Text="Duck Duck Go" Margin="8,0,0,0"/> + <Image + Width="16" + Source="ms-appx:///Assets/search_duckduckgo.png" + Stretch="Uniform" /> + <TextBlock Margin="8,0,0,0" Text="Duck Duck Go" /> </StackPanel> </RadioButton> - <RadioButton Style="{StaticResource CustomRadioButtonStyle}" x:Name="CustomSearchUrlRadioButton" GroupName="SearchEngineGroup"> + <RadioButton x:Name="CustomSearchUrlRadioButton" GroupName="SearchEngineGroup"> <StackPanel Orientation="Horizontal"> - <Image Source="ms-appx:///Assets/search_custom.png" Width="16" Stretch="Uniform"/> - <TextBlock x:Uid="/Settings/TextAndEditorPage_SearchEngineSettings_CustomSearchUrlRadioButton" Text="Custom Search Engine" Margin="8,0,0,0"/> + <Image + Width="16" + Source="ms-appx:///Assets/search_custom.png" + Stretch="Uniform" /> + <TextBlock + x:Uid="/Settings/TextAndEditorPage_SearchEngineSettings_CustomSearchUrlRadioButton" + Margin="8,0,0,0" + Text="Custom Search Engine" /> </StackPanel> </RadioButton> - <StackPanel Margin="28,5,0,10"> - <!-- TODO: Change CornerRadius to {ThemeResource ControlCornerRadius}--> - <TextBox Style="{StaticResource TransparentTextBoxStyle}" BorderThickness="0" CornerRadius="0" x:Name="CustomSearchUrl" PlaceholderText="https://www.example.com/search?q={0}" IsSpellCheckEnabled="False" TextChanged="CustomSearchUrl_TextChanged" LostFocus="CustomSearchUrl_LostFocus"/> - <TextBlock x:Name="CustomUrlErrorReport" x:Uid="/Settings/TextAndEditorPage_SearchEngineSettings_CustomSearchUrlRadioButton_CustomUrlErrorReport" Style="{ThemeResource DescriptionTextBlockStyle}" Foreground="Red" Visibility="Collapsed"/> + <StackPanel Margin="28,5,0,10"> + <TextBox + x:Name="CustomSearchUrl" + BorderThickness="0" + IsSpellCheckEnabled="False" + LostFocus="CustomSearchUrl_LostFocus" + PlaceholderText="https://www.example.com/search?q={0}" + TextChanged="CustomSearchUrl_TextChanged" /> + <TextBlock + x:Name="CustomUrlErrorReport" + x:Uid="/Settings/TextAndEditorPage_SearchEngineSettings_CustomSearchUrlRadioButton_CustomUrlErrorReport" + Foreground="Red" + Style="{ThemeResource DescriptionTextBlockStyle}" + Visibility="Collapsed" /> </StackPanel> </StackPanel> - <TextBlock x:Uid="/Settings/TextAndEditorPage_SearchEngineSettings_Description" Style="{ThemeResource DescriptionTextBlockStyle}" Margin="0,8,0,0"/> + <TextBlock + x:Uid="/Settings/TextAndEditorPage_SearchEngineSettings_Description" + Margin="0,8,0,0" + Style="{ThemeResource DescriptionTextBlockStyle}" /> </StackPanel> </ScrollViewer> </Grid> From 32812900fdddf3cc2131d9a82baa3d5d1fada23c Mon Sep 17 00:00:00 2001 From: Soumya Ranjan Mahunt <devsoumyamahunt@gmail.com> Date: Sun, 1 Aug 2021 16:13:30 +0530 Subject: [PATCH 13/15] update designes to latest winui --- .../Notepads.Controls.csproj | 218 --- .../Properties/AssemblyInfo.cs | 28 - .../Properties/Notepads.Controls.rd.xml | 33 - .../SetsView/SetClosingEventArgs.cs | 40 - .../SetsView/SetDraggedOutsideEventArgs.cs | 35 - .../SetsView/SetSelectedEventArgs.cs | 35 - .../SetsView/SetsView.HeaderLayout.cs | 220 --- .../SetsView/SetsView.ItemSources.cs | 114 -- .../SetsView/SetsView.Properties.cs | 277 ---- src/Notepads.Controls/SetsView/SetsView.cs | 548 -------- src/Notepads.Controls/SetsView/SetsView.xaml | 1036 -------------- .../SetsView/SetsViewItem.Properties.cs | 96 -- .../SetsView/SetsViewItem.cs | 183 --- .../SetsView/SetsWidthMode.cs | 36 - src/Notepads.Controls/Themes/Generic.xaml | 8 - src/Notepads.sln | 47 +- src/Notepads/App.xaml | 54 +- .../Dialog/AppCloseSaveReminderDialog.cs | 24 - .../Dialog/AppCloseSaveReminderDialog.xaml | 20 + .../Dialog/AppCloseSaveReminderDialog.xaml.cs | 38 + .../Controls/Dialog/FileOpenErrorDialog.cs | 12 - .../Controls/Dialog/FileOpenErrorDialog.xaml | 13 + .../Dialog/FileOpenErrorDialog.xaml.cs | 19 + .../Controls/Dialog/FileRenameDialog.xaml | 37 + ...nameDialog.cs => FileRenameDialog.xaml.cs} | 107 +- .../Controls/Dialog/FileSaveErrorDialog.cs | 13 - .../Controls/Dialog/FileSaveErrorDialog.xaml | 13 + .../Dialog/FileSaveErrorDialog.xaml.cs | 19 + .../Controls/Dialog/INotepadsDialog.cs | 14 + .../Controls/Dialog/NotepadsDialog.cs | 60 - .../RevertAllChangesConfirmationDialog.cs | 17 - .../RevertAllChangesConfirmationDialog.xaml | 16 + ...RevertAllChangesConfirmationDialog.xaml.cs | 26 + .../Dialog/SetCloseSaveReminderDialog.cs | 19 - .../Dialog/SetCloseSaveReminderDialog.xaml | 18 + .../Dialog/SetCloseSaveReminderDialog.xaml.cs | 33 + .../DiffViewer/SideBySideDiffViewer.xaml | 33 +- .../FindAndReplace/FindAndReplaceControl.xaml | 52 +- .../FindAndReplacePlaceHolder.xaml | 104 -- src/Notepads/Controls/GoTo/GoToControl.xaml | 15 +- .../Controls/TextEditor/TextEditor.xaml | 70 +- .../Controls/TextEditor/TextEditorCore.xaml | 153 ++- src/Notepads/Core/NotepadsCore.cs | 148 +- src/Notepads/Notepads.csproj | 184 ++- .../Resource/CustomAppBarButtonStyle.xaml | 339 ----- .../Resource/CustomFlyoutItemStyle.xaml | 425 ------ .../Resource/CustomNavigationViewStyle.xaml | 261 ---- .../Resource/CustomRadioButtonStyle.xaml | 200 --- src/Notepads/Resource/CustomSliderStyle.xaml | 315 ----- .../Resource/CustomToggleSwitchStyle.xaml | 388 ------ src/Notepads/Resource/DismissButtonStyle.xaml | 168 ++- .../Resource/NotepadsDialogStyle.xaml | 354 +++++ ...ml => NotepadsInAppNotificationStyle.xaml} | 31 +- .../NotepadsInteractiveGridStyle.xaml | 102 ++ .../Resource/NotepadsSettingsViewStyle.xaml | 718 ++++++++++ ...Style.xaml => NotepadsSplitViewStyle.xaml} | 10 +- .../Resource/NotepadsTabViewStyle.xaml | 1203 +++++++++++++++++ src/Notepads/Resource/Theme.xaml | 841 ++++++++++++ .../Resource/TransparentTextBoxStyle.xaml | 373 ++++- src/Notepads/Services/ThemeSettingsService.cs | 2 +- src/Notepads/Strings/ar-YE/Resources.resw | 92 +- src/Notepads/Strings/ar-YE/Settings.resw | 8 +- src/Notepads/Strings/bg-BG/Resources.resw | 38 +- src/Notepads/Strings/bg-BG/Settings.resw | 8 +- src/Notepads/Strings/cs-CZ/Resources.resw | 38 +- src/Notepads/Strings/cs-CZ/Settings.resw | 8 +- src/Notepads/Strings/de-CH/Resources.resw | 38 +- src/Notepads/Strings/de-CH/Settings.resw | 8 +- src/Notepads/Strings/de-DE/Resources.resw | 38 +- src/Notepads/Strings/de-DE/Settings.resw | 8 +- src/Notepads/Strings/en-US/Resources.resw | 38 +- src/Notepads/Strings/en-US/Settings.resw | 8 +- src/Notepads/Strings/es-ES/Resources.resw | 38 +- src/Notepads/Strings/es-ES/Settings.resw | 8 +- src/Notepads/Strings/fi-FI/Resources.resw | 38 +- src/Notepads/Strings/fi-FI/Settings.resw | 8 +- src/Notepads/Strings/fr-FR/Resources.resw | 38 +- src/Notepads/Strings/fr-FR/Settings.resw | 8 +- src/Notepads/Strings/hi-IN/Resources.resw | 38 +- src/Notepads/Strings/hi-IN/Settings.resw | 8 +- src/Notepads/Strings/hr-HR/Resources.resw | 38 +- src/Notepads/Strings/hr-HR/Settings.resw | 8 +- src/Notepads/Strings/hu-HU/Resources.resw | 38 +- src/Notepads/Strings/hu-HU/Settings.resw | 8 +- src/Notepads/Strings/it-IT/Resources.resw | 38 +- src/Notepads/Strings/it-IT/Settings.resw | 8 +- src/Notepads/Strings/ja-JP/Resources.resw | 38 +- src/Notepads/Strings/ja-JP/Settings.resw | 8 +- src/Notepads/Strings/ka-GE/Resources.resw | 38 +- src/Notepads/Strings/ka-GE/Settings.resw | 8 +- src/Notepads/Strings/ko-KR/Resources.resw | 38 +- src/Notepads/Strings/ko-KR/Settings.resw | 8 +- src/Notepads/Strings/or-IN/Resources.resw | 38 +- src/Notepads/Strings/or-IN/Settings.resw | 8 +- src/Notepads/Strings/pl-PL/Resources.resw | 38 +- src/Notepads/Strings/pl-PL/Settings.resw | 8 +- src/Notepads/Strings/pt-BR/Resources.resw | 38 +- src/Notepads/Strings/pt-BR/Settings.resw | 8 +- src/Notepads/Strings/pt-PT/Resources.resw | 38 +- src/Notepads/Strings/pt-PT/Settings.resw | 8 +- src/Notepads/Strings/ru-RU/Resources.resw | 38 +- src/Notepads/Strings/ru-RU/Settings.resw | 8 +- src/Notepads/Strings/tr-TR/Resources.resw | 38 +- src/Notepads/Strings/tr-TR/Settings.resw | 8 +- src/Notepads/Strings/uk-UA/Resources.resw | 38 +- src/Notepads/Strings/uk-UA/Settings.resw | 8 +- src/Notepads/Strings/zh-CN/Resources.resw | 38 +- src/Notepads/Strings/zh-CN/Settings.resw | 8 +- src/Notepads/Strings/zh-TW/Resources.resw | 38 +- src/Notepads/Strings/zh-TW/Settings.resw | 8 +- src/Notepads/Utilities/BehaviorUtility.cs | 47 + src/Notepads/Utilities/DialogManager.cs | 6 +- .../Views/MainPage/NotepadsMainPage.xaml | 507 ++----- .../Views/MainPage/NotepadsMainPage.xaml.cs | 7 +- src/Notepads/Views/Settings/SettingsPage.xaml | 27 +- .../Views/Settings/SettingsPage.xaml.cs | 4 +- .../Views/Settings/SettingsPanel.xaml | 16 - 117 files changed, 5283 insertions(+), 6550 deletions(-) delete mode 100644 src/Notepads.Controls/Notepads.Controls.csproj delete mode 100644 src/Notepads.Controls/Properties/AssemblyInfo.cs delete mode 100644 src/Notepads.Controls/Properties/Notepads.Controls.rd.xml delete mode 100644 src/Notepads.Controls/SetsView/SetClosingEventArgs.cs delete mode 100644 src/Notepads.Controls/SetsView/SetDraggedOutsideEventArgs.cs delete mode 100644 src/Notepads.Controls/SetsView/SetSelectedEventArgs.cs delete mode 100644 src/Notepads.Controls/SetsView/SetsView.HeaderLayout.cs delete mode 100644 src/Notepads.Controls/SetsView/SetsView.ItemSources.cs delete mode 100644 src/Notepads.Controls/SetsView/SetsView.Properties.cs delete mode 100644 src/Notepads.Controls/SetsView/SetsView.cs delete mode 100644 src/Notepads.Controls/SetsView/SetsView.xaml delete mode 100644 src/Notepads.Controls/SetsView/SetsViewItem.Properties.cs delete mode 100644 src/Notepads.Controls/SetsView/SetsViewItem.cs delete mode 100644 src/Notepads.Controls/SetsView/SetsWidthMode.cs delete mode 100644 src/Notepads.Controls/Themes/Generic.xaml delete mode 100644 src/Notepads/Controls/Dialog/AppCloseSaveReminderDialog.cs create mode 100644 src/Notepads/Controls/Dialog/AppCloseSaveReminderDialog.xaml create mode 100644 src/Notepads/Controls/Dialog/AppCloseSaveReminderDialog.xaml.cs delete mode 100644 src/Notepads/Controls/Dialog/FileOpenErrorDialog.cs create mode 100644 src/Notepads/Controls/Dialog/FileOpenErrorDialog.xaml create mode 100644 src/Notepads/Controls/Dialog/FileOpenErrorDialog.xaml.cs create mode 100644 src/Notepads/Controls/Dialog/FileRenameDialog.xaml rename src/Notepads/Controls/Dialog/{FileRenameDialog.cs => FileRenameDialog.xaml.cs} (52%) delete mode 100644 src/Notepads/Controls/Dialog/FileSaveErrorDialog.cs create mode 100644 src/Notepads/Controls/Dialog/FileSaveErrorDialog.xaml create mode 100644 src/Notepads/Controls/Dialog/FileSaveErrorDialog.xaml.cs create mode 100644 src/Notepads/Controls/Dialog/INotepadsDialog.cs delete mode 100644 src/Notepads/Controls/Dialog/NotepadsDialog.cs delete mode 100644 src/Notepads/Controls/Dialog/RevertAllChangesConfirmationDialog.cs create mode 100644 src/Notepads/Controls/Dialog/RevertAllChangesConfirmationDialog.xaml create mode 100644 src/Notepads/Controls/Dialog/RevertAllChangesConfirmationDialog.xaml.cs delete mode 100644 src/Notepads/Controls/Dialog/SetCloseSaveReminderDialog.cs create mode 100644 src/Notepads/Controls/Dialog/SetCloseSaveReminderDialog.xaml create mode 100644 src/Notepads/Controls/Dialog/SetCloseSaveReminderDialog.xaml.cs delete mode 100644 src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml delete mode 100644 src/Notepads/Resource/CustomAppBarButtonStyle.xaml delete mode 100644 src/Notepads/Resource/CustomFlyoutItemStyle.xaml delete mode 100644 src/Notepads/Resource/CustomNavigationViewStyle.xaml delete mode 100644 src/Notepads/Resource/CustomRadioButtonStyle.xaml delete mode 100644 src/Notepads/Resource/CustomSliderStyle.xaml delete mode 100644 src/Notepads/Resource/CustomToggleSwitchStyle.xaml create mode 100644 src/Notepads/Resource/NotepadsDialogStyle.xaml rename src/Notepads/Resource/{InAppNotificationNoDismissButton.xaml => NotepadsInAppNotificationStyle.xaml} (83%) create mode 100644 src/Notepads/Resource/NotepadsInteractiveGridStyle.xaml create mode 100644 src/Notepads/Resource/NotepadsSettingsViewStyle.xaml rename src/Notepads/Resource/{CustomSplitViewStyle.xaml => NotepadsSplitViewStyle.xaml} (99%) create mode 100644 src/Notepads/Resource/NotepadsTabViewStyle.xaml create mode 100644 src/Notepads/Resource/Theme.xaml create mode 100644 src/Notepads/Utilities/BehaviorUtility.cs diff --git a/src/Notepads.Controls/Notepads.Controls.csproj b/src/Notepads.Controls/Notepads.Controls.csproj deleted file mode 100644 index b8bc24640..000000000 --- a/src/Notepads.Controls/Notepads.Controls.csproj +++ /dev/null @@ -1,218 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProjectGuid>{7AA5E631-B663-420E-A08F-002CD81DF855}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>Notepads.Controls</RootNamespace> - <AssemblyName>Notepads.Controls</AssemblyName> - <DefaultLanguage>en-US</DefaultLanguage> - <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier> - <TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.19041.0</TargetPlatformVersion> - <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion> - <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion> - <FileAlignment>512</FileAlignment> - <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <PlatformTarget>AnyCPU</PlatformTarget> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <PlatformTarget>AnyCPU</PlatformTarget> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Production|AnyCPU'"> - <PlatformTarget>AnyCPU</PlatformTarget> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Production\</OutputPath> - <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> - <PlatformTarget>x86</PlatformTarget> - <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> - <NoWarn>;2008</NoWarn> - <DebugType>full</DebugType> - <UseVSHostingProcess>false</UseVSHostingProcess> - <ErrorReport>prompt</ErrorReport> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> - <PlatformTarget>x86</PlatformTarget> - <OutputPath>bin\x86\Release\</OutputPath> - <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> - <Optimize>true</Optimize> - <NoWarn>;2008</NoWarn> - <DebugType>pdbonly</DebugType> - <UseVSHostingProcess>false</UseVSHostingProcess> - <ErrorReport>prompt</ErrorReport> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Production|x86'"> - <PlatformTarget>x86</PlatformTarget> - <OutputPath>bin\x86\Production\</OutputPath> - <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> - <Optimize>true</Optimize> - <NoWarn>;2008</NoWarn> - <DebugType>pdbonly</DebugType> - <UseVSHostingProcess>false</UseVSHostingProcess> - <ErrorReport>prompt</ErrorReport> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'"> - <PlatformTarget>ARM</PlatformTarget> - <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\ARM\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> - <NoWarn>;2008</NoWarn> - <DebugType>full</DebugType> - <UseVSHostingProcess>false</UseVSHostingProcess> - <ErrorReport>prompt</ErrorReport> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'"> - <PlatformTarget>ARM</PlatformTarget> - <OutputPath>bin\ARM\Release\</OutputPath> - <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> - <Optimize>true</Optimize> - <NoWarn>;2008</NoWarn> - <DebugType>pdbonly</DebugType> - <UseVSHostingProcess>false</UseVSHostingProcess> - <ErrorReport>prompt</ErrorReport> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Production|ARM'"> - <PlatformTarget>ARM</PlatformTarget> - <OutputPath>bin\ARM\Production\</OutputPath> - <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> - <Optimize>true</Optimize> - <NoWarn>;2008</NoWarn> - <DebugType>pdbonly</DebugType> - <UseVSHostingProcess>false</UseVSHostingProcess> - <ErrorReport>prompt</ErrorReport> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'"> - <PlatformTarget>ARM64</PlatformTarget> - <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\ARM64\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> - <NoWarn>;2008</NoWarn> - <DebugType>full</DebugType> - <UseVSHostingProcess>false</UseVSHostingProcess> - <ErrorReport>prompt</ErrorReport> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'"> - <PlatformTarget>ARM64</PlatformTarget> - <OutputPath>bin\ARM64\Release\</OutputPath> - <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> - <Optimize>true</Optimize> - <NoWarn>;2008</NoWarn> - <DebugType>pdbonly</DebugType> - <UseVSHostingProcess>false</UseVSHostingProcess> - <ErrorReport>prompt</ErrorReport> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Production|ARM64'"> - <PlatformTarget>ARM64</PlatformTarget> - <OutputPath>bin\ARM64\Production\</OutputPath> - <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> - <Optimize>true</Optimize> - <NoWarn>;2008</NoWarn> - <DebugType>pdbonly</DebugType> - <UseVSHostingProcess>false</UseVSHostingProcess> - <ErrorReport>prompt</ErrorReport> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> - <PlatformTarget>x64</PlatformTarget> - <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\x64\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> - <NoWarn>;2008</NoWarn> - <DebugType>full</DebugType> - <UseVSHostingProcess>false</UseVSHostingProcess> - <ErrorReport>prompt</ErrorReport> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> - <PlatformTarget>x64</PlatformTarget> - <OutputPath>bin\x64\Release\</OutputPath> - <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> - <Optimize>true</Optimize> - <NoWarn>;2008</NoWarn> - <DebugType>pdbonly</DebugType> - <UseVSHostingProcess>false</UseVSHostingProcess> - <ErrorReport>prompt</ErrorReport> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Production|x64'"> - <PlatformTarget>x64</PlatformTarget> - <OutputPath>bin\x64\Production\</OutputPath> - <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> - <Optimize>true</Optimize> - <NoWarn>;2008</NoWarn> - <DebugType>pdbonly</DebugType> - <UseVSHostingProcess>false</UseVSHostingProcess> - <ErrorReport>prompt</ErrorReport> - </PropertyGroup> - <PropertyGroup> - <RestoreProjectStyle>PackageReference</RestoreProjectStyle> - </PropertyGroup> - <ItemGroup> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="SetsView\SetSelectedEventArgs.cs" /> - <Compile Include="SetsView\SetClosingEventArgs.cs" /> - <Compile Include="SetsView\SetDraggedOutsideEventArgs.cs" /> - <Compile Include="SetsView\SetsView.cs" /> - <Compile Include="SetsView\SetsView.HeaderLayout.cs" /> - <Compile Include="SetsView\SetsView.ItemSources.cs" /> - <Compile Include="SetsView\SetsView.Properties.cs" /> - <Compile Include="SetsView\SetsViewItem.cs" /> - <Compile Include="SetsView\SetsViewItem.Properties.cs" /> - <Compile Include="SetsView\SetsWidthMode.cs" /> - <EmbeddedResource Include="Properties\Notepads.Controls.rd.xml" /> - </ItemGroup> - <ItemGroup> - <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> - <Version>6.2.12</Version> - </PackageReference> - <PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls"> - <Version>7.0.1</Version> - </PackageReference> - <PackageReference Include="Microsoft.UI.Xaml"> - <Version>2.5.0</Version> - </PackageReference> - </ItemGroup> - <ItemGroup> - <Page Include="SetsView\SetsView.xaml"> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - <Page Include="Themes\Generic.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:Compile</Generator> - </Page> - </ItemGroup> - <ItemGroup /> - <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' "> - <VisualStudioVersion>14.0</VisualStudioVersion> - </PropertyGroup> - <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> -</Project> \ No newline at end of file diff --git a/src/Notepads.Controls/Properties/AssemblyInfo.cs b/src/Notepads.Controls/Properties/AssemblyInfo.cs deleted file mode 100644 index 62afbfb43..000000000 --- a/src/Notepads.Controls/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Notepads.Controls")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Notepads.Controls")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: ComVisible(false)] \ No newline at end of file diff --git a/src/Notepads.Controls/Properties/Notepads.Controls.rd.xml b/src/Notepads.Controls/Properties/Notepads.Controls.rd.xml deleted file mode 100644 index 49f7e139e..000000000 --- a/src/Notepads.Controls/Properties/Notepads.Controls.rd.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - This file contains Runtime Directives, specifications about types your application accesses - through reflection and other dynamic code patterns. Runtime Directives are used to control the - .NET Native optimizer and ensure that it does not remove code accessed by your library. If your - library does not do any reflection, then you generally do not need to edit this file. However, - if your library reflects over types, especially types passed to it or derived from its types, - then you should write Runtime Directives. - - The most common use of reflection in libraries is to discover information about types passed - to the library. Runtime Directives have three ways to express requirements on types passed to - your library. - - 1. Parameter, GenericParameter, TypeParameter, TypeEnumerableParameter - Use these directives to reflect over types passed as a parameter. - - 2. SubTypes - Use a SubTypes directive to reflect over types derived from another type. - - 3. AttributeImplies - Use an AttributeImplies directive to indicate that your library needs to reflect over - types or methods decorated with an attribute. - - For more information on writing Runtime Directives for libraries, please visit - https://go.microsoft.com/fwlink/?LinkID=391919 ---> -<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata"> - <Library Name="Notepads.Controls"> - - <!-- add directives for your library here --> - - </Library> -</Directives> diff --git a/src/Notepads.Controls/SetsView/SetClosingEventArgs.cs b/src/Notepads.Controls/SetsView/SetClosingEventArgs.cs deleted file mode 100644 index c09a24721..000000000 --- a/src/Notepads.Controls/SetsView/SetClosingEventArgs.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace Notepads.Controls -{ - using System; - - /// <summary> - /// Event arguments for <see cref="SetsView.SetClosing"/> event. - /// </summary> - public class SetClosingEventArgs : EventArgs - { - /// <summary> - /// Initializes a new instance of the <see cref="SetClosingEventArgs"/> class. - /// </summary> - /// <param name="item">Item being closed.</param> - /// <param name="set"><see cref="SetsViewItem"/> container being closed.</param> - public SetClosingEventArgs(object item, SetsViewItem set) - { - Item = item; - Set = set; - } - - /// <summary> - /// Gets the Item being closed. - /// </summary> - public object Item { get; } - - /// <summary> - /// Gets the Set being closed. - /// </summary> - public SetsViewItem Set { get; } - - /// <summary> - /// Gets or sets a value indicating whether the notification should be closed. - /// </summary> - public bool Cancel { get; set; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/SetsView/SetDraggedOutsideEventArgs.cs b/src/Notepads.Controls/SetsView/SetDraggedOutsideEventArgs.cs deleted file mode 100644 index 058bc07f2..000000000 --- a/src/Notepads.Controls/SetsView/SetDraggedOutsideEventArgs.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace Notepads.Controls -{ - using System; - - /// <summary> - /// A class used by the <see cref="SetsView"/> TabDraggedOutside Event - /// </summary> - public class SetDraggedOutsideEventArgs : EventArgs - { - /// <summary> - /// Initializes a new instance of the <see cref="SetDraggedOutsideEventArgs"/> class. - /// </summary> - /// <param name="item">data context of element dragged</param> - /// <param name="set"><see cref="SetsViewItem"/> container being dragged.</param> - public SetDraggedOutsideEventArgs(object item, SetsViewItem set) - { - Item = item; - Set = set; - } - - /// <summary> - /// Gets or sets the Item/Data Context of the item being dragged outside of the <see cref="SetsView"/>. - /// </summary> - public object Item { get; set; } - - /// <summary> - /// Gets the Set being dragged outside of the <see cref="SetsView"/>. - /// </summary> - public SetsViewItem Set { get; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/SetsView/SetSelectedEventArgs.cs b/src/Notepads.Controls/SetsView/SetSelectedEventArgs.cs deleted file mode 100644 index b42981e19..000000000 --- a/src/Notepads.Controls/SetsView/SetSelectedEventArgs.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace Notepads.Controls -{ - using System; - - /// <summary> - /// Event arguments for <see cref="SetsView.SetSelected"/> event. - /// </summary> - public class SetSelectedEventArgs : EventArgs - { - /// <summary> - /// Initializes a new instance of the <see cref="SetSelectedEventArgs"/> class. - /// </summary> - /// <param name="item">Selected item.</param> - /// <param name="set"><see cref="SetsViewItem"/> Selected set.</param> - public SetSelectedEventArgs(object item, SetsViewItem set) - { - Item = item; - Set = set; - } - - /// <summary> - /// Gets the Selected Item. - /// </summary> - public object Item { get; } - - /// <summary> - /// Gets the Selected Set. - /// </summary> - public SetsViewItem Set { get; } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/SetsView/SetsView.HeaderLayout.cs b/src/Notepads.Controls/SetsView/SetsView.HeaderLayout.cs deleted file mode 100644 index 27707bdda..000000000 --- a/src/Notepads.Controls/SetsView/SetsView.HeaderLayout.cs +++ /dev/null @@ -1,220 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace Notepads.Controls -{ - using System; - using System.Linq; - using Windows.UI.Xaml; - - /// <summary> - /// SetsView methods related to calculating the width of the <see cref="SetsViewItem"/> Headers. - /// </summary> - public partial class SetsView - { - // Attached property for storing widths of sets if set by other means during layout. - private static double GetOriginalWidth(SetsViewItem obj) - { - return (double)obj.GetValue(OriginalWidthProperty); - } - - private static void SetOriginalWidth(SetsViewItem obj, double value) - { - obj.SetValue(OriginalWidthProperty, value); - } - - // Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc... - private static readonly DependencyProperty OriginalWidthProperty = - DependencyProperty.RegisterAttached("OriginalWidth", typeof(double), typeof(SetsView), new PropertyMetadata(null)); - - private static void OnLayoutEffectingPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) - { - if (sender is SetsView setsView && setsView._hasLoaded) - { - setsView.SetsView_SizeChanged(setsView, null); - } - } - - private void SetsView_SizeChanged(object sender, SizeChangedEventArgs e) - { - // We need to do this calculation here in Size Changed as the - // Columns don't have their Actual Size calculated in Measure or Arrange. - if (_hasLoaded && _setsViewContainer != null) - { - // Look for our special columns to calculate size of other 'stuff' - var taken = _setsViewContainer.ColumnDefinitions.Sum(cd => GetIgnoreColumn(cd) ? 0 : cd.ActualWidth); - - // Get the column we want to work on for available space - var setc = _setsViewContainer.ColumnDefinitions.FirstOrDefault(cd => GetConstrainColumn(cd)); - if (setc != null) - { - var available = ActualWidth - taken; - var required = 0.0; - var minsetwidth = double.MaxValue; - - if (SetsWidthBehavior == SetsWidthMode.Actual) - { - if (_setsScroller != null) - { - // If we have a scroll container, get its size. - required = _setsScroller.ExtentWidth; - } - - // Restore original widths - foreach (var item in Items) - { - if (!(ContainerFromItem(item) is SetsViewItem set)) - { - continue; // container not generated yet - } - - if (set.ReadLocalValue(OriginalWidthProperty) != DependencyProperty.UnsetValue) - { - set.Width = GetOriginalWidth(set); - } - } - } - else if (available > 0) - { - // Calculate the width for each set from the provider and determine how much space they take. - foreach (var item in Items) - { - if (!(ContainerFromItem(item) is SetsViewItem set)) - { - continue; // container not generated yet - } - - minsetwidth = Math.Min(minsetwidth, set.MinWidth); - - double width = double.NaN; - - switch (SetsWidthBehavior) - { - case SetsWidthMode.Equal: - width = ProvideEqualWidth(set, available); - break; - case SetsWidthMode.Compact: - width = ProvideCompactWidth(set); - break; - } - - if (set.ReadLocalValue(OriginalWidthProperty) == DependencyProperty.UnsetValue) - { - SetOriginalWidth(set, set.Width); - } - - if (width > double.Epsilon) - { - set.Width = width; - required += Math.Max(Math.Min(width, set.MaxWidth), set.MinWidth); - } - else - { - set.Width = GetOriginalWidth(set); - required += set.ActualWidth; - } - } - } - else - { - // Fix negative bounds. - available = 0.0; - - // Still need to determine a 'minimum' width (if available) - // TODO: Consolidate this logic with above better? - foreach (var item in Items) - { - if (!(ContainerFromItem(item) is SetsViewItem set)) - { - continue; // container not generated yet - } - - minsetwidth = Math.Min(minsetwidth, set.MinWidth); - } - } - - if (!(minsetwidth < double.MaxValue)) - { - minsetwidth = 0.0; // No Containers, no visual, 0 size. - } - - if (available > minsetwidth) - { - // Constrain the column based on our required and available space - setc.MaxWidth = available; - } - - //// TODO: If it's less, should we move the selected set to only be the one shown by default? - - if (available <= minsetwidth || Math.Abs(available - minsetwidth) < double.Epsilon) - { - setc.Width = new GridLength(minsetwidth); - } - else if (required >= available) - { - // Fix size as we don't have enough space for all the sets. - setc.Width = new GridLength(available); - } - else - { - // We haven't filled up our space, so we want to expand to take as much as needed. - setc.Width = GridLength.Auto; - } - } - UpdateScrollViewerShadows(); - UpdateScrollViewerNavigateButtons(); - UpdateSetSeparators(); - } - } - - private double ProvideEqualWidth(SetsViewItem set, double availableWidth) - { - if (double.IsNaN(SelectedSetWidth)) - { - if (Items.Count <= 1) - { - return availableWidth; - } - - return Math.Max(set.MinWidth, availableWidth / Items.Count); - } - else if (Items.Count() <= 1) - { - // Default case of a single set, make it full size. - return Math.Min(SelectedSetWidth, availableWidth); - } - else - { - var width = (availableWidth - SelectedSetWidth) / (Items.Count - 1); - - // Constrain between Min and Selected (Max) - if (width < set.MinWidth) - { - width = set.MinWidth; - } - else if (width > SelectedSetWidth) - { - width = SelectedSetWidth; - } - - // If it's selected make it full size, otherwise whatever the size should be. - return set.IsSelected - ? Math.Min(SelectedSetWidth, availableWidth) - : width; - } - } - - private double ProvideCompactWidth(SetsViewItem set) - { - // If we're selected and have a value for that, then just return that. - if (set.IsSelected && !double.IsNaN(SelectedSetWidth)) - { - return SelectedSetWidth; - } - - // Otherwise use min size. - return set.MinWidth; - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/SetsView/SetsView.ItemSources.cs b/src/Notepads.Controls/SetsView/SetsView.ItemSources.cs deleted file mode 100644 index 7ae0cecb0..000000000 --- a/src/Notepads.Controls/SetsView/SetsView.ItemSources.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace Notepads.Controls -{ - using System.Reflection; - using Windows.Foundation.Collections; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls.Primitives; - - /// <summary> - /// SetsView methods related to tracking Items and ItemsSource changes. - /// </summary> - public partial class SetsView - { - // Temporary tracking of previous collections for removing events. - private MethodInfo _removeItemsSourceMethod; - - /// <inheritdoc/> - protected override void OnItemsChanged(object e) - { - IVectorChangedEventArgs args = (IVectorChangedEventArgs)e; - - base.OnItemsChanged(e); - - if (args?.CollectionChange == CollectionChange.ItemRemoved && SelectedIndex == -1) - { - // If we remove the selected item we should select the previous item - int startIndex = (int)args.Index + 1; - if (startIndex > Items?.Count) - { - startIndex = 0; - } - - SelectedIndex = FindNextSetIndex(startIndex, -1); - } - - // Update Sizing (in case there are less items now) - SetsView_SizeChanged(this, null); - } - - private void ItemContainerGenerator_ItemsChanged(object sender, ItemsChangedEventArgs e) - { - var action = (CollectionChange)e.Action; - if (action == CollectionChange.Reset) - { - // Reset collection to reload later. - _hasLoaded = false; - } - } - - private void SetInitialSelection() - { - if (SelectedItem == null) - { - // If we have an index, but didn't get the selection, make the selection - if (SelectedIndex >= 0 && SelectedIndex < Items.Count) - { - SelectedItem = Items[SelectedIndex]; - } - - // Otherwise, select the first item by default - else if (Items.Count >= 1) - { - SelectedItem = Items[0]; - } - } - } - - // Finds the next visible & enabled set index. - private int FindNextSetIndex(int startIndex, int direction) - { - int index = startIndex; - if (direction != 0) - { - for (int i = 0; i < Items.Count; i++) - { - index += direction; - - if (index >= Items.Count) - { - index = 0; - } - else if (index < 0) - { - index = Items.Count - 1; - } - - if (ContainerFromIndex(index) is SetsViewItem setItem && setItem.IsEnabled && setItem.Visibility == Visibility.Visible) - { - break; - } - } - } - - return index; - } - - private void ItemsSource_PropertyChanged(DependencyObject sender, DependencyProperty dp) - { - // Use reflection to store a 'Remove' method of any possible collection in ItemsSource - // Cache for efficiency later. - if (ItemsSource != null) - { - _removeItemsSourceMethod = ItemsSource.GetType().GetMethod("Remove"); - } - else - { - _removeItemsSourceMethod = null; - } - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/SetsView/SetsView.Properties.cs b/src/Notepads.Controls/SetsView/SetsView.Properties.cs deleted file mode 100644 index 9b9a2702e..000000000 --- a/src/Notepads.Controls/SetsView/SetsView.Properties.cs +++ /dev/null @@ -1,277 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace Notepads.Controls -{ - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - - /// <summary> - /// SetsView properties. - /// </summary> - public partial class SetsView - { - /// <summary> - /// Gets or sets the content to appear to the left or above the set strip. - /// </summary> - public object SetsStartHeader - { - get => GetValue(SetsStartHeaderProperty); - set => SetValue(SetsStartHeaderProperty, value); - } - - /// <summary> - /// Identifies the <see cref="SetsStartHeader"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="SetsStartHeader"/> dependency property.</returns> - public static readonly DependencyProperty SetsStartHeaderProperty = - DependencyProperty.Register(nameof(SetsStartHeader), typeof(object), typeof(SetsView), new PropertyMetadata(null, OnLayoutEffectingPropertyChanged)); - - /// <summary> - /// Gets or sets the <see cref="DataTemplate"/> for the <see cref="SetsStartHeader"/>. - /// </summary> - public DataTemplate SetsStartHeaderTemplate - { - get => (DataTemplate)GetValue(SetsStartHeaderTemplateProperty); - set => SetValue(SetsStartHeaderTemplateProperty, value); - } - - /// <summary> - /// Identifies the <see cref="SetsStartHeaderTemplate"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="SetsStartHeaderTemplate"/> dependency property.</returns> - public static readonly DependencyProperty SetsStartHeaderTemplateProperty = - DependencyProperty.Register(nameof(SetsStartHeaderTemplate), typeof(DataTemplate), typeof(SetsView), new PropertyMetadata(null, OnLayoutEffectingPropertyChanged)); - - /// <summary> - /// Gets or sets the content to appear next to the set strip. - /// </summary> - public object SetsActionHeader - { - get => GetValue(SetsActionHeaderProperty); - set => SetValue(SetsActionHeaderProperty, value); - } - - /// <summary> - /// Identifies the <see cref="SetsActionHeader"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="SetsActionHeader"/> dependency property.</returns> - public static readonly DependencyProperty SetsActionHeaderProperty = - DependencyProperty.Register(nameof(SetsActionHeader), typeof(object), typeof(SetsView), new PropertyMetadata(null, OnLayoutEffectingPropertyChanged)); - - /// <summary> - /// Gets or sets the <see cref="DataTemplate"/> for the <see cref="SetsActionHeader"/>. - /// </summary> - public DataTemplate SetsActionHeaderTemplate - { - get => (DataTemplate)GetValue(SetsActionHeaderTemplateProperty); - set => SetValue(SetsActionHeaderTemplateProperty, value); - } - - /// <summary> - /// Identifies the <see cref="SetsActionHeaderTemplate"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="SetsActionHeaderTemplate"/> dependency property.</returns> - public static readonly DependencyProperty SetsActionHeaderTemplateProperty = - DependencyProperty.Register(nameof(SetsActionHeaderTemplate), typeof(DataTemplate), typeof(SetsView), new PropertyMetadata(null, OnLayoutEffectingPropertyChanged)); - - /// <summary> - /// Gets or sets the content to appear to the right or below the action header. - /// </summary> - public object SetsPaddingHeader - { - get => GetValue(SetsPaddingHeaderProperty); - set => SetValue(SetsPaddingHeaderProperty, value); - } - - /// <summary> - /// Identifies the <see cref="SetsPaddingHeader"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="SetsPaddingHeader"/> dependency property.</returns> - public static readonly DependencyProperty SetsPaddingHeaderProperty = - DependencyProperty.Register(nameof(SetsPaddingHeader), typeof(object), typeof(SetsView), new PropertyMetadata(null, OnLayoutEffectingPropertyChanged)); - - /// <summary> - /// Gets or sets the <see cref="DataTemplate"/> for the <see cref="SetsPaddingHeader"/>. - /// </summary> - public DataTemplate SetsPaddingHeaderTemplate - { - get => (DataTemplate)GetValue(SetsPaddingHeaderTemplateProperty); - set => SetValue(SetsPaddingHeaderTemplateProperty, value); - } - - /// <summary> - /// Identifies the <see cref="SetsPaddingHeaderTemplate"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="SetsPaddingHeaderTemplate"/> dependency property.</returns> - public static readonly DependencyProperty SetsPaddingHeaderTemplateProperty = - DependencyProperty.Register(nameof(SetsPaddingHeaderTemplate), typeof(DataTemplate), typeof(SetsView), new PropertyMetadata(null, OnLayoutEffectingPropertyChanged)); - - /// <summary> - /// Gets or sets the content to appear to the right or below the set strip. - /// </summary> - public object SetsEndHeader - { - get => GetValue(SetsEndHeaderProperty); - set => SetValue(SetsEndHeaderProperty, value); - } - - /// <summary> - /// Identifies the <see cref="SetsEndHeader"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="SetsEndHeader"/> dependency property.</returns> - public static readonly DependencyProperty SetsEndHeaderProperty = - DependencyProperty.Register(nameof(SetsEndHeader), typeof(object), typeof(SetsView), new PropertyMetadata(null, OnLayoutEffectingPropertyChanged)); - - /// <summary> - /// Gets or sets the <see cref="DataTemplate"/> for the <see cref="SetsEndHeader"/>. - /// </summary> - public DataTemplate SetsEndHeaderTemplate - { - get => (DataTemplate)GetValue(SetsEndHeaderTemplateProperty); - set => SetValue(SetsEndHeaderTemplateProperty, value); - } - - /// <summary> - /// Identifies the <see cref="SetsEndHeaderTemplate"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="SetsEndHeaderTemplate"/> dependency property.</returns> - public static readonly DependencyProperty SetsEndHeaderTemplateProperty = - DependencyProperty.Register(nameof(SetsEndHeaderTemplate), typeof(DataTemplate), typeof(SetsView), new PropertyMetadata(null, OnLayoutEffectingPropertyChanged)); - - /// <summary> - /// Gets or sets the default <see cref="DataTemplate"/> for the <see cref="SetsViewItem.HeaderTemplate"/>. - /// </summary> - public DataTemplate ItemHeaderTemplate - { - get => (DataTemplate)GetValue(ItemHeaderTemplateTemplateProperty); - set => SetValue(ItemHeaderTemplateTemplateProperty, value); - } - - /// <summary> - /// Identifies the <see cref="ItemHeaderTemplate"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="ItemHeaderTemplate"/> dependency property.</returns> - public static readonly DependencyProperty ItemHeaderTemplateTemplateProperty = - DependencyProperty.Register(nameof(ItemHeaderTemplate), typeof(DataTemplate), typeof(SetsView), new PropertyMetadata(null, OnLayoutEffectingPropertyChanged)); - - /// <summary> - /// Gets or sets a value indicating whether by default a Set can be closed or not if no value to <see cref="SetsViewItem.IsClosable"/> is provided. - /// </summary> - public bool CanCloseSets - { - get => (bool)GetValue(CanCloseSetsProperty); - set => SetValue(CanCloseSetsProperty, value); - } - - /// <summary> - /// Identifies the <see cref="CanCloseSets"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="CanCloseSets"/> dependency property.</returns> - public static readonly DependencyProperty CanCloseSetsProperty = - DependencyProperty.Register(nameof(CanCloseSets), typeof(bool), typeof(SetsView), new PropertyMetadata(false, OnLayoutEffectingPropertyChanged)); - - /// <summary> - /// Gets or sets a value indicating whether a <see cref="SetsViewItem"/> Close Button should be included in layout calculations. - /// </summary> - public bool IsCloseButtonOverlay - { - get => (bool)GetValue(IsCloseButtonOverlayProperty); - set => SetValue(IsCloseButtonOverlayProperty, value); - } - - /// <summary> - /// Identifies the <see cref="IsCloseButtonOverlay"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="IsCloseButtonOverlay"/> dependency property.</returns> - public static readonly DependencyProperty IsCloseButtonOverlayProperty = - DependencyProperty.Register(nameof(IsCloseButtonOverlay), typeof(bool), typeof(SetsView), new PropertyMetadata(false, OnLayoutEffectingPropertyChanged)); - - /// <summary> - /// Gets or sets a value indicating the size of the selected set. By default this is set to Auto and the selected set size doesn't change. - /// </summary> - public double SelectedSetWidth - { - get => (double)GetValue(SelectedSetWidthProperty); - set => SetValue(SelectedSetWidthProperty, value); - } - - /// <summary> - /// Identifies the <see cref="SelectedSetWidth"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="SelectedSetWidth"/> dependency property.</returns> - public static readonly DependencyProperty SelectedSetWidthProperty = - DependencyProperty.Register(nameof(SelectedSetWidth), typeof(double), typeof(SetsView), new PropertyMetadata(double.NaN, OnLayoutEffectingPropertyChanged)); - - /// <summary> - /// Gets or sets the current <see cref="SetsWidthMode"/> which determins how set headers' width behave. - /// </summary> - public SetsWidthMode SetsWidthBehavior - { - get => (SetsWidthMode)GetValue(SetsWidthBehaviorProperty); - set => SetValue(SetsWidthBehaviorProperty, value); - } - - /// <summary> - /// Identifies the <see cref="SetsWidthBehavior"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="SetsWidthBehavior"/> dependency property.</returns> - public static readonly DependencyProperty SetsWidthBehaviorProperty = - DependencyProperty.Register(nameof(SetsWidthBehavior), typeof(SetsWidthMode), typeof(SetsView), new PropertyMetadata(SetsWidthMode.Actual, OnLayoutEffectingPropertyChanged)); - - /// <summary> - /// Gets the attached property value to indicate if this grid column should be ignored when calculating header sizes. - /// </summary> - /// <param name="obj">Grid Column.</param> - /// <returns>Boolean indicating if this column is ignored by SetsViewHeader logic.</returns> - public static bool GetIgnoreColumn(ColumnDefinition obj) - { - return (bool)obj.GetValue(IgnoreColumnProperty); - } - - /// <summary> - /// Sets the attached property value for <see cref="IgnoreColumnProperty"/> - /// </summary> - /// <param name="obj">Grid Column.</param> - /// <param name="value">Boolean value</param> - public static void SetIgnoreColumn(ColumnDefinition obj, bool value) - { - obj?.SetValue(IgnoreColumnProperty, value); - } - - /// <summary> - /// Identifies the <see cref="IgnoreColumnProperty"/> attached property. - /// </summary> - /// <returns>The identifier for the IgnoreColumn attached property.</returns> - public static readonly DependencyProperty IgnoreColumnProperty = - DependencyProperty.RegisterAttached("IgnoreColumn", typeof(bool), typeof(SetsView), new PropertyMetadata(false)); - - /// <summary> - /// Gets the attached value indicating this column should be restricted for the <see cref="SetsViewItem"/> headers. - /// </summary> - /// <param name="obj">Grid Column.</param> - /// <returns>True if this column should be constrained.</returns> - public static bool GetConstrainColumn(ColumnDefinition obj) - { - return (bool)obj.GetValue(ConstrainColumnProperty); - } - - /// <summary> - /// Sets the attached property value for the <see cref="ConstrainColumnProperty"/> - /// </summary> - /// <param name="obj">Grid Column.</param> - /// <param name="value">Boolean value.</param> - public static void SetConstrainColumn(ColumnDefinition obj, bool value) - { - obj?.SetValue(ConstrainColumnProperty, value); - } - - /// <summary> - /// Identifies the <see cref="ConstrainColumnProperty"/> attached property. - /// </summary> - /// <returns>The identifier for the ConstrainColumn attached property.</returns> - public static readonly DependencyProperty ConstrainColumnProperty = - DependencyProperty.RegisterAttached("ConstrainColumn", typeof(bool), typeof(SetsView), new PropertyMetadata(false)); - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/SetsView/SetsView.cs b/src/Notepads.Controls/SetsView/SetsView.cs deleted file mode 100644 index 005cc0a7f..000000000 --- a/src/Notepads.Controls/SetsView/SetsView.cs +++ /dev/null @@ -1,548 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace Notepads.Controls -{ - using System; - using System.Linq; - using Microsoft.Toolkit.Uwp.UI; - using Microsoft.Toolkit.Uwp.UI.Controls; - using Windows.ApplicationModel.DataTransfer; - 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; - - /// <summary> - /// SetsView is a control for displaying a set of sets and their content. - /// </summary> - [TemplatePart(Name = SetsContentPresenterName, Type = typeof(ContentPresenter))] - [TemplatePart(Name = SetsViewContainerName, Type = typeof(Grid))] - [TemplatePart(Name = SetsItemsPresenterName, Type = typeof(ItemsPresenter))] - [TemplatePart(Name = SetsScrollViewerName, Type = typeof(ScrollViewer))] - [TemplatePart(Name = SetsScrollBackButtonName, Type = typeof(ButtonBase))] - [TemplatePart(Name = SetsScrollForwardButtonName, Type = typeof(ButtonBase))] - [TemplatePart(Name = SetsItemsScrollViewerLeftSideShadowName, Type = typeof(DropShadowPanel))] - [TemplatePart(Name = SetsItemsScrollViewerRightSideShadowName, Type = typeof(DropShadowPanel))] - public partial class SetsView : ListViewBase - { - private const int ScrollAmount = 50; // TODO: Should this be based on SetsWidthMode - - private const string SetsContentPresenterName = "SetsContentPresenter"; - private const string SetsViewContainerName = "SetsViewContainer"; - private const string SetsItemsPresenterName = "SetsItemsPresenter"; - private const string SetsScrollViewerName = "ScrollViewer"; - private const string SetsItemsScrollViewerLeftSideShadowName = "SetsItemsScrollViewerLeftSideShadow"; - private const string SetsItemsScrollViewerRightSideShadowName = "SetsItemsScrollViewerRightSideShadow"; - private const string SetsScrollBackButtonName = "SetsScrollBackButton"; - private const string SetsScrollForwardButtonName = "SetsScrollForwardButton"; - - private ContentPresenter _setsContentPresenter; - private Grid _setsViewContainer; - private ItemsPresenter _setItemsPresenter; - private ScrollViewer _setsScroller; - private DropShadowPanel _setsItemsScrollViewerLeftSideShadow; - private DropShadowPanel _setsItemsScrollViewerRightSideShadow; - private ButtonBase _setsScrollBackButton; - private ButtonBase _setsScrollForwardButton; - - private bool _hasLoaded; - private bool _isDragging; - - private double _scrollViewerHorizontalOffset = .0f; - public double ScrollViewerHorizontalOffset => _scrollViewerHorizontalOffset; - - /// <summary> - /// Initializes a new instance of the <see cref="SetsView"/> class. - /// </summary> - public SetsView() - { - DefaultStyleKey = typeof(SetsView); - - // Container Generation Hooks - RegisterPropertyChangedCallback(ItemsSourceProperty, ItemsSource_PropertyChanged); - ItemContainerGenerator.ItemsChanged += ItemContainerGenerator_ItemsChanged; - - // Drag and Layout Hooks - DragItemsStarting += SetsView_DragItemsStarting; - DragItemsCompleted += SetsView_DragItemsCompleted; - SizeChanged += SetsView_SizeChanged; - - // Selection Hook - SelectionChanged += SetsView_SelectionChanged; - } - - /// <summary> - /// Occurs when a set is dragged by the user outside of the <see cref="SetsView"/>. Generally, this paradigm is used to create a new-window with the torn-off set. - /// The creation and handling of the new-window is left to the app's developer. - /// </summary> - public event EventHandler<SetDraggedOutsideEventArgs> SetDraggedOutside; - - /// <summary> - /// Occurs when a set's Close button is clicked. Set <see cref="SetClosingEventArgs.Cancel"/> to true to prevent automatic Set Closure. - /// </summary> - public event EventHandler<SetClosingEventArgs> SetClosing; - - /// <summary> - /// Occurs when a set is selected in <see cref="SetsView"/>. - /// </summary> - public event EventHandler<SetSelectedEventArgs> SetSelected; - - /// <summary> - /// Occurs when a set is tapped in <see cref="SetsView"/>. - /// </summary> - public event EventHandler<SetSelectedEventArgs> SetTapped; - - /// <summary> - /// Occurs when a set is double tapped in <see cref="SetsView"/>. - /// </summary> - public event EventHandler<SetSelectedEventArgs> SetDoubleTapped; - - /// <inheritdoc/> - protected override DependencyObject GetContainerForItemOverride() - { - return new SetsViewItem(); - } - - /// <inheritdoc/> - protected override bool IsItemItsOwnContainerOverride(object item) - { - return item is SetsViewItem; - } - - /// <inheritdoc/> - protected override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - if (_setItemsPresenter != null) - { - _setItemsPresenter.SizeChanged -= SetsView_SizeChanged; - } - - if (_setsScroller != null) - { - _setsScroller.Loaded -= SetsScrollViewer_Loaded; - _setsScroller.ViewChanged -= SetsScrollViewer_ViewChanged; - } - - _setsContentPresenter = GetTemplateChild(SetsContentPresenterName) as ContentPresenter; - _setsViewContainer = GetTemplateChild(SetsViewContainerName) as Grid; - _setItemsPresenter = GetTemplateChild(SetsItemsPresenterName) as ItemsPresenter; - _setsScroller = GetTemplateChild(SetsScrollViewerName) as ScrollViewer; - - if (_setItemsPresenter != null) - { - _setItemsPresenter.SizeChanged += SetsView_SizeChanged; - } - - if (_setsScroller != null) - { - _setsScroller.Loaded += SetsScrollViewer_Loaded; - _setsScroller.ViewChanged += SetsScrollViewer_ViewChanged; - } - } - - private void SetsScrollViewer_Loaded(object sender, RoutedEventArgs e) - { - _setsScroller.Loaded -= SetsScrollViewer_Loaded; - - if (_setsScrollBackButton != null) - { - _setsScrollBackButton.Click -= ScrollSetBackButton_Click; - } - - if (_setsScrollForwardButton != null) - { - _setsScrollForwardButton.Click -= ScrollSetForwardButton_Click; - } - - _setsScrollBackButton = _setsScroller.FindDescendant(SetsScrollBackButtonName) as ButtonBase; - _setsScrollForwardButton = _setsScroller.FindDescendant(SetsScrollForwardButtonName) as ButtonBase; - _setsItemsScrollViewerLeftSideShadow = _setsScroller.FindDescendant(SetsItemsScrollViewerLeftSideShadowName) as DropShadowPanel; - _setsItemsScrollViewerRightSideShadow = _setsScroller.FindDescendant(SetsItemsScrollViewerRightSideShadowName) as DropShadowPanel; - - if (_setsScrollBackButton != null) - { - _setsScrollBackButton.Click += ScrollSetBackButton_Click; - } - - if (_setsScrollForwardButton != null) - { - _setsScrollForwardButton.Click += ScrollSetForwardButton_Click; - } - } - - private void ScrollSetBackButton_Click(object sender, RoutedEventArgs e) - { - _setsScroller.ChangeView(Math.Max(0, _setsScroller.HorizontalOffset - ScrollAmount), null, null); - } - - private void ScrollSetForwardButton_Click(object sender, RoutedEventArgs e) - { - _setsScroller.ChangeView(Math.Min(_setsScroller.ScrollableWidth, _setsScroller.HorizontalOffset + ScrollAmount), null, null); - } - - private void SetsView_SelectionChanged(object sender, SelectionChangedEventArgs e) - { - if (_isDragging) - { - // Skip if we're dragging, we'll reset when we're done. - return; - } - - if (_setsContentPresenter != null) - { - if (SelectedItem == null) - { - _setsContentPresenter.Content = null; - _setsContentPresenter.ContentTemplate = null; - } - else - { - if (ContainerFromItem(SelectedItem) is SetsViewItem container) - { - _setsContentPresenter.Content = container.Content; - _setsContentPresenter.ContentTemplate = container.ContentTemplate; - - if (e != null) _setsContentPresenter.Loaded += SetsContentPresenter_Loaded; - } - } - - UpdateScrollViewerShadows(); - UpdateSetSeparators(); - } - - // If our width can be effected by the selection, need to run algorithm. - if (!double.IsNaN(SelectedSetWidth)) - { - SetsView_SizeChanged(sender, null); - } - } - - private void UpdateSetSeparators() - { - if (SelectedIndex > 0) - { - (ContainerFromIndex(0) as SetsViewItem)?.ShowLeftSideSeparator(); - } - else - { - (ContainerFromIndex(0) as SetsViewItem)?.HideLeftSideSeparator(); - } - - for (int i = 0; i < Items?.Count; i++) - { - if (i != SelectedIndex && i != SelectedIndex - 1) - { - (ContainerFromIndex(i) as SetsViewItem)?.ShowRightSideSeparator(); - } - else - { - (ContainerFromIndex(i) as SetsViewItem)?.HideRightSideSeparator(); - } - } - } - - private void SetsContentPresenter_Loaded(object sender, RoutedEventArgs e) - { - _setsContentPresenter.Loaded -= SetsContentPresenter_Loaded; - var args = new SetSelectedEventArgs(((SetsViewItem)ContainerFromItem(SelectedItem))?.Content, (SetsViewItem)ContainerFromItem(SelectedItem)); - SetSelected?.Invoke(this, args); - } - - /// <inheritdoc/> - protected override void PrepareContainerForItemOverride(DependencyObject element, object item) - { - base.PrepareContainerForItemOverride(element, item); - - if (!(element is SetsViewItem setItem)) return; - - setItem.Loaded -= SetsViewItem_Loaded; - setItem.Closing -= SetsViewItem_Closing; - setItem.Tapped -= SetsViewItem_Tapped; - setItem.DoubleTapped -= SetsViewItem_DoubleTapped; - setItem.PointerEntered -= SetItem_PointerEntered; - setItem.PointerExited -= SetItem_PointerExited; - setItem.Loaded += SetsViewItem_Loaded; - setItem.Closing += SetsViewItem_Closing; - setItem.Tapped += SetsViewItem_Tapped; - setItem.DoubleTapped += SetsViewItem_DoubleTapped; - setItem.PointerEntered += SetItem_PointerEntered; - setItem.PointerExited += SetItem_PointerExited; - - if (setItem.Header == null) - { - setItem.Header = item; - } - - if (setItem.HeaderTemplate == null) - { - var headertemplatebinding = new Binding() - { - Source = this, - Path = new PropertyPath(nameof(ItemHeaderTemplate)), - Mode = BindingMode.OneWay - }; - setItem.SetBinding(SetsViewItem.HeaderTemplateProperty, headertemplatebinding); - } - - if (setItem.IsClosable != true && setItem.ReadLocalValue(SetsViewItem.IsClosableProperty) == - DependencyProperty.UnsetValue) - { - var iscloseablebinding = new Binding() - { - Source = this, - Path = new PropertyPath(nameof(CanCloseSets)), - Mode = BindingMode.OneWay, - }; - setItem.SetBinding(SetsViewItem.IsClosableProperty, iscloseablebinding); - } - } - - private void SetItem_PointerEntered(object sender, PointerRoutedEventArgs e) - { - if (sender is SetsViewItem set) - { - set.HideRightSideSeparator(); - var index = IndexFromContainer(set); - if (index > 0) - { - (ContainerFromIndex(index - 1) as SetsViewItem)?.HideRightSideSeparator(); - } - - set.HideLeftSideSeparator(); - } - } - - private void SetItem_PointerExited(object sender, PointerRoutedEventArgs e) - { - if (sender is SetsViewItem set) - { - var index = IndexFromContainer(set); - - if (index == 0 && SelectedIndex != index) - { - set.ShowLeftSideSeparator(); - } - - if (SelectedIndex == index - 1) - { - set.ShowRightSideSeparator(); - } - else if (SelectedIndex == index + 1) - { - if (index > 0) - { - (ContainerFromIndex(index - 1) as SetsViewItem)?.ShowRightSideSeparator(); - } - } - else if (SelectedIndex != index) - { - set.ShowRightSideSeparator(); - if (index > 0) - { - (ContainerFromIndex(index - 1) as SetsViewItem)?.ShowRightSideSeparator(); - } - } - } - } - - private void SetsViewItem_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e) - { - var args = new SetSelectedEventArgs(((SetsViewItem)ContainerFromItem(SelectedItem))?.Content, (SetsViewItem)ContainerFromItem(SelectedItem)); - SetDoubleTapped?.Invoke(sender, args); - } - - private void SetsViewItem_Tapped(object sender, TappedRoutedEventArgs e) - { - var args = new SetSelectedEventArgs(((SetsViewItem)ContainerFromItem(SelectedItem))?.Content, (SetsViewItem)ContainerFromItem(SelectedItem)); - SetTapped?.Invoke(sender, args); - } - - private void SetsViewItem_Loaded(object sender, RoutedEventArgs e) - { - var setItem = sender as SetsViewItem; - - setItem.Loaded -= SetsViewItem_Loaded; - - // Only need to do this once. - if (!_hasLoaded) - { - _hasLoaded = true; - - // Need to set a set's selection on load, otherwise ListView resets to null. - SetInitialSelection(); - - // Need to make sure ContentPresenter is set to content based on selection. - SetsView_SelectionChanged(this, null); - - // Need to make sure we've registered our removal method. - ItemsSource_PropertyChanged(this, null); - - // Make sure we complete layout now. - SetsView_SizeChanged(this, null); - } - } - - private void SetsViewItem_Closing(object sender, SetClosingEventArgs e) - { - var item = ItemFromContainer(e.Set); - - var args = new SetClosingEventArgs(item, e.Set); - SetClosing?.Invoke(this, args); - - if (!args.Cancel) - { - e.Set.PrepareForClosing(); - if (ItemsSource != null) - { - _removeItemsSourceMethod?.Invoke(ItemsSource, new object[] { item }); - } - else - { - Items?.Remove(item); - } - } - } - - private void SetsView_DragItemsStarting(object sender, DragItemsStartingEventArgs e) - { - // Keep track of drag so we don't modify content until done. - _isDragging = true; - - _setsItemsScrollViewerLeftSideShadow.Visibility = Visibility.Collapsed; - _setsItemsScrollViewerRightSideShadow.Visibility = Visibility.Collapsed; - } - - private void SetsView_DragItemsCompleted(ListViewBase sender, DragItemsCompletedEventArgs args) - { - _isDragging = false; - - // args.DropResult == None when outside of area (e.g. create new window) - if (args.DropResult == DataPackageOperation.None) - { - var item = args.Items.FirstOrDefault(); - var set = ContainerFromItem(item) as SetsViewItem; - - if (set == null && item is FrameworkElement fe) - { - set = fe.FindParent<SetsViewItem>(); - } - - if (set == null) - { - // We still don't have a SetsViewItem, most likely is a static SetsViewItem in the template being dragged and not selected. - // This is a fallback scenario for static sets. - // Note: This can be wrong if two SetsViewItems share the exact same Content (i.e. a string), this should be unlikely in any practical scenario. - for (int i = 0; i < Items.Count; i++) - { - var setItem = ContainerFromIndex(i) as SetsViewItem; - if (ReferenceEquals(setItem.Content, item)) - { - set = setItem; - break; - } - } - } - - SetDraggedOutside?.Invoke(this, new SetDraggedOutsideEventArgs(item, set)); - - UpdateScrollViewerShadows(); - } - else - { - // If dragging the active set, there's an issue with the CP blanking. - SetsView_SelectionChanged(this, null); - } - } - - private void SetsScrollViewer_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e) - { - _scrollViewerHorizontalOffset = _setsScroller.HorizontalOffset; - UpdateScrollViewerShadows(); - UpdateScrollViewerNavigateButtons(); - } - - public void ScrollToLastSet() - { - ScrollTo(double.MaxValue); - } - - public void ScrollTo(double offset) - { - try - { - _setsScroller?.UpdateLayout(); - _setsScroller?.ChangeView(offset, 0.0f, 1.0f); - } - catch (Exception ex) - { - throw new Exception($"SetsView failed to scroll to offset: {(long)offset}, Exception: {ex}"); - } - } - - // HACK: Simulate left most and right most (tab) edge shadow - // since I am too lazy to figure out the "right way" to make shadow visible on scroll viewer edges - /// TODO This method should be removed when better solution is available in the future - private void UpdateScrollViewerShadows() - { - if (_setsItemsScrollViewerLeftSideShadow == null || - _setsItemsScrollViewerRightSideShadow == null) - { - return; - } - - if (Items?.Count == 1) - { - _setsItemsScrollViewerLeftSideShadow.Visibility = Visibility.Visible; - _setsItemsScrollViewerRightSideShadow.Visibility = Visibility.Visible; - return; - } - - if (SelectedIndex == 0) - { - if (Math.Abs(_scrollViewerHorizontalOffset) < 3) - { - _setsItemsScrollViewerLeftSideShadow.Visibility = Visibility.Visible; - _setsItemsScrollViewerRightSideShadow.Visibility = Visibility.Collapsed; - return; - } - } - else if (SelectedIndex == Items?.Count - 1) - { - var offset = _setsScroller.ExtentWidth - _setsScroller.ViewportWidth - _scrollViewerHorizontalOffset; - if (Math.Abs(offset) < 3) - { - _setsItemsScrollViewerLeftSideShadow.Visibility = Visibility.Collapsed; - _setsItemsScrollViewerRightSideShadow.Visibility = Visibility.Visible; - return; - } - } - - _setsItemsScrollViewerLeftSideShadow.Visibility = Visibility.Collapsed; - _setsItemsScrollViewerRightSideShadow.Visibility = Visibility.Collapsed; - } - - private void UpdateScrollViewerNavigateButtons() - { - if (Math.Abs(_setsScroller.HorizontalOffset - _setsScroller.ScrollableWidth) < 0.1) - { - _setsScrollBackButton.IsEnabled = true; - _setsScrollForwardButton.IsEnabled = false; - } - else if (Math.Abs(_setsScroller.HorizontalOffset) < 0.1) - { - _setsScrollBackButton.IsEnabled = false; - _setsScrollForwardButton.IsEnabled = true; - } - else - { - _setsScrollBackButton.IsEnabled = true; - _setsScrollForwardButton.IsEnabled = true; - } - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/SetsView/SetsView.xaml b/src/Notepads.Controls/SetsView/SetsView.xaml deleted file mode 100644 index 4d2245f51..000000000 --- a/src/Notepads.Controls/SetsView/SetsView.xaml +++ /dev/null @@ -1,1036 +0,0 @@ -<ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters" - xmlns:local="using:Notepads.Controls" - xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls" - xmlns:wctui="using:Microsoft.Toolkit.Uwp.UI"> - - <ResourceDictionary.ThemeDictionaries> - <ResourceDictionary x:Key="Light"> - <SolidColorBrush x:Key="SetsViewBackground" Color="Transparent" /> - <SolidColorBrush - x:Key="SetsViewItemHeaderBackgroundSelected" - Opacity="0.25" - Color="White" /> - <SolidColorBrush - x:Key="SetsViewItemHeaderBackgroundPointerOver" - Opacity="0.15" - Color="White" /> - <SolidColorBrush - x:Key="SetsViewItemHeaderBackgroundPressed" - Opacity="0.25" - Color="White" /> - <StaticResource x:Key="SetsViewItemHeaderBackground" ResourceKey="SystemControlTransparentBrush" /> - <StaticResource x:Key="SetsViewSelectionIndicatorForeground" ResourceKey="SystemControlForegroundAccentBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundPressed" ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundSelected" ResourceKey="SystemControlForegroundBaseHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundPointerOver" ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" /> - <StaticResource x:Key="SetsViewItemHeaderRevealBorderBrush" ResourceKey="SystemControlBackgroundTransparentRevealBorderBrush" /> - <x:Double x:Key="SetsEdgeShadowOpacity">0.55</x:Double> - <RevealBackgroundBrush - x:Key="SetsViewItemRevealBackgroundBrush" - FallbackColor="Gray" - Opacity="0.3" - Color="Gray" /> - </ResourceDictionary> - - <ResourceDictionary x:Key="Dark"> - <SolidColorBrush x:Key="SetsViewBackground" Color="Transparent" /> - <SolidColorBrush - x:Key="SetsViewItemHeaderBackgroundSelected" - Opacity="0.25" - Color="Black" /> - <SolidColorBrush - x:Key="SetsViewItemHeaderBackgroundPointerOver" - Opacity="0.20" - Color="Black" /> - <SolidColorBrush - x:Key="SetsViewItemHeaderBackgroundPressed" - Opacity="0.25" - Color="Black" /> - <StaticResource x:Key="SetsViewItemHeaderBackground" ResourceKey="SystemControlTransparentBrush" /> - <StaticResource x:Key="SetsViewSelectionIndicatorForeground" ResourceKey="SystemControlForegroundAccentBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundPressed" ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundSelected" ResourceKey="SystemControlForegroundBaseHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundPointerOver" ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" /> - <StaticResource x:Key="SetsViewItemHeaderRevealBorderBrush" ResourceKey="SystemControlBackgroundTransparentRevealBorderBrush" /> - <x:Double x:Key="SetsEdgeShadowOpacity">0.7</x:Double> - <RevealBackgroundBrush - x:Key="SetsViewItemRevealBackgroundBrush" - FallbackColor="Transparent" - Color="Transparent" /> - </ResourceDictionary> - - <ResourceDictionary x:Key="HighContrast"> - <SolidColorBrush x:Key="SetsViewBackground" Color="{ThemeResource SystemChromeLowColor}" /> - <SolidColorBrush x:Key="SetsViewItemHeaderBackgroundSelected" Color="{ThemeResource SystemColorHighlightColor}" /> - <SolidColorBrush x:Key="SetsViewItemHeaderBackgroundPointerOver" Color="{ThemeResource SystemColorHighlightColor}" /> - <SolidColorBrush x:Key="SetsViewItemHeaderBackgroundPressed" Color="{ThemeResource SystemColorHighlightColor}" /> - <StaticResource x:Key="SetsViewItemHeaderBackground" ResourceKey="SystemControlTransparentBrush" /> - <StaticResource x:Key="SetsViewSelectionIndicatorForeground" ResourceKey="SystemControlForegroundAccentBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundPressed" ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundSelected" ResourceKey="SystemControlForegroundBaseHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundPointerOver" ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> - <StaticResource x:Key="SetsViewItemHeaderForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" /> - <StaticResource x:Key="SetsViewItemHeaderRevealBorderBrush" ResourceKey="SystemControlBackgroundTransparentRevealBorderBrush" /> - <x:Double x:Key="SetsEdgeShadowOpacity">0.0</x:Double> - <SolidColorBrush x:Key="SetsViewItemRevealBackgroundBrush" Color="Transparent" /> - </ResourceDictionary> - </ResourceDictionary.ThemeDictionaries> - - <Thickness x:Key="SetsViewItemHeaderMargin">0</Thickness> - <Thickness x:Key="SetsViewItemHeaderIconMargin">0,2,6,0</Thickness> - <Thickness x:Key="SetsViewItemHeaderCloseMargin">0,1,0,0</Thickness> - <Thickness x:Key="SetsViewItemHeaderBorderThickness">0,1,0,0</Thickness> - <x:Double x:Key="SetsViewItemHeaderIconSize">10</x:Double> - <x:Double x:Key="SetsViewItemHeaderMinWidth">48</x:Double> - <x:Double x:Key="SetsViewItemHeaderMinHeight">40</x:Double> - <x:Double x:Key="SetsViewItemHeaderMaxWidth">NaN</x:Double> - <x:Double x:Key="SetsViewItemHeaderCloseWidth">24</x:Double> - - <converters:EmptyObjectToObjectConverter - x:Key="NullVisibilityConverter" - EmptyValue="Collapsed" - NotEmptyValue="Visible" /> - <converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" /> - - <!-- 65 is the size of both scroll buttons + 1 for layout rounding. --> - <converters:DoubleToVisibilityConverter x:Key="GreaterThanToleranceVisibilityConverter" GreaterThan="65.0" /> - - <converters:BoolToObjectConverter - x:Key="CloseCollapsingSizeConverter" - FalseValue="{StaticResource SetsViewItemHeaderCloseWidth}" - TrueValue="NaN" /> - - <Style x:Key="TopEdgeShadowStyle" TargetType="wctc:DropShadowPanel"> - <Setter Property="BlurRadius" Value="10" /> - <Setter Property="ShadowOpacity" Value="{ThemeResource SetsEdgeShadowOpacity}" /> - <Setter Property="VerticalAlignment" Value="Top" /> - <Setter Property="HorizontalAlignment" Value="Stretch" /> - <Setter Property="HorizontalContentAlignment" Value="Stretch" /> - </Style> - - <Style x:Key="BottomEdgeShadowStyle" TargetType="wctc:DropShadowPanel"> - <Setter Property="BlurRadius" Value="10" /> - <Setter Property="ShadowOpacity" Value="{ThemeResource SetsEdgeShadowOpacity}" /> - <Setter Property="VerticalAlignment" Value="Bottom" /> - <Setter Property="HorizontalAlignment" Value="Stretch" /> - <Setter Property="HorizontalContentAlignment" Value="Stretch" /> - </Style> - - <Style x:Key="SideEdgeShadowStyle" TargetType="wctc:DropShadowPanel"> - <Setter Property="BlurRadius" Value="8" /> - <Setter Property="ShadowOpacity" Value="{ThemeResource SetsEdgeShadowOpacity}" /> - <Setter Property="Visibility" Value="Collapsed" /> - </Style> - - <!-- Default style for compatibility with WPF migrators. --> - <Style TargetType="local:SetsView"> - <Setter Property="Background" Value="{ThemeResource SetsViewBackground}" /> - <Setter Property="IsTabStop" Value="False" /> - <Setter Property="TabNavigation" Value="Local" /> - <Setter Property="IsSwipeEnabled" Value="False" /> - <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" /> - <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled" /> - <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Enabled" /> - <Setter Property="ScrollViewer.IsHorizontalRailEnabled" Value="False" /> - <Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled" /> - <Setter Property="ScrollViewer.IsVerticalRailEnabled" Value="False" /> - <Setter Property="ScrollViewer.ZoomMode" Value="Disabled" /> - <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" /> - <Setter Property="ScrollViewer.BringIntoViewOnFocusChange" Value="True" /> - <!-- Need UseLayoutRounding as Width being dynamically changed in same cases to fill up an entire space, otherwise gap. --> - <Setter Property="UseLayoutRounding" Value="False" /> - <Setter Property="ItemContainerTransitions"> - <Setter.Value> - <TransitionCollection> - <ContentThemeTransition /> - <EntranceThemeTransition IsStaggeringEnabled="False" /> - <EdgeUIThemeTransition Edge="Bottom" /> - </TransitionCollection> - </Setter.Value> - </Setter> - <Setter Property="ItemsPanel"> - <Setter.Value> - <ItemsPanelTemplate> - <!-- Note: We have to use StackPanel here due to other issues using ItemsStackPanel or VirtualizingStackPanel --> - <StackPanel Orientation="Horizontal" /> - </ItemsPanelTemplate> - </Setter.Value> - </Setter> - <Setter Property="Template" Value="{StaticResource SetsViewTemplate}" /> - </Style> - - <ControlTemplate x:Key="SetsViewTemplate" TargetType="local:SetsView"> - <Grid x:Name="SetsViewContainer"> - <Grid.RowDefinitions> - <!-- 0 Header --> - <RowDefinition Height="Auto" /> - <!-- 1 Sets --> - <RowDefinition Height="Auto" /> - <!-- 2 Content --> - <RowDefinition Height="*" /> - <!-- 3 Footer --> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - <Grid.ColumnDefinitions> - <!-- 0 SetsStartHeader --> - <ColumnDefinition Width="Auto" /> - <!-- 1 Sets --> - <ColumnDefinition - Width="Auto" - local:SetsView.ConstrainColumn="True" - local:SetsView.IgnoreColumn="True" /> - <!-- 2 Reserved: Overflow Drop-down --> - <ColumnDefinition Width="Auto" /> - <!-- 3 Auto Add Button --> - <ColumnDefinition Width="Auto" /> - <!-- 4 Padding --> - <ColumnDefinition Width="*" local:SetsView.IgnoreColumn="True" /> - <!-- 5 SetsEndHeader --> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> - <ContentPresenter - Grid.Row="0" - Grid.ColumnSpan="6" - Content="{TemplateBinding Header}" - ContentTemplate="{TemplateBinding HeaderTemplate}" /> - - <!-- Shadow under Start Header --> - <wctc:DropShadowPanel - Grid.Row="1" - Grid.Column="0" - Style="{StaticResource BottomEdgeShadowStyle}"> - <Grid Height="1" Margin="0,0,0,-1" /> - <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="0,-12,1024,12" /> - </wctc:DropShadowPanel.Clip> - </wctc:DropShadowPanel> - - <ContentPresenter - Grid.Row="1" - Grid.Column="0" - Content="{TemplateBinding SetsStartHeader}" - ContentTemplate="{TemplateBinding SetsStartHeaderTemplate}" /> - - <ScrollViewer - x:Name="ScrollViewer" - Grid.Row="1" - Grid.Column="1" - AutomationProperties.AccessibilityView="Raw" - BorderThickness="0" - BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}" - HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" - HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" - IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" - IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" - IsHorizontalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsHorizontalScrollChainingEnabled}" - IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" - IsVerticalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsVerticalScrollChainingEnabled}" - Style="{StaticResource SetsViewScrollViewer}" - TabNavigation="{TemplateBinding TabNavigation}" - VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" - VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" - ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"> - <ItemsPresenter x:Name="SetsItemsPresenter" Padding="{TemplateBinding Padding}" /> - </ScrollViewer> - - <!-- Shadow under Add Button --> - <wctc:DropShadowPanel - Grid.Row="1" - Grid.Column="3" - Style="{StaticResource BottomEdgeShadowStyle}"> - <Grid Height="1" Margin="-1,0,0,-1" /> - <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="0,-12,1024,12" /> - </wctc:DropShadowPanel.Clip> - </wctc:DropShadowPanel> - - <ContentPresenter - Grid.Row="1" - Grid.Column="3" - HorizontalAlignment="Left" - Content="{TemplateBinding SetsActionHeader}" - ContentTemplate="{TemplateBinding SetsActionHeaderTemplate}" /> - - <!-- Shadow under Padding area (23040 = 3 x 8k resolution in width just in case) --> - <wctc:DropShadowPanel - Grid.Row="1" - Grid.Column="4" - Style="{StaticResource BottomEdgeShadowStyle}"> - <Grid Height="1" Margin="0,0,0,-1" /> - <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="0,-12,23040,12" /> - </wctc:DropShadowPanel.Clip> - </wctc:DropShadowPanel> - - <ContentPresenter - Grid.Row="1" - Grid.Column="4" - HorizontalAlignment="Stretch" - Content="{TemplateBinding SetsPaddingHeader}" - ContentTemplate="{TemplateBinding SetsPaddingHeaderTemplate}" /> - - <!-- Shadow under SetsEndHeader --> - <wctc:DropShadowPanel - Grid.Row="1" - Grid.Column="5" - Style="{StaticResource BottomEdgeShadowStyle}"> - <Grid Height="1" Margin="0,0,0,-1" /> - <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="0,-12,1024,12" /> - </wctc:DropShadowPanel.Clip> - </wctc:DropShadowPanel> - - <ContentPresenter - Grid.Row="1" - Grid.Column="5" - Content="{TemplateBinding SetsEndHeader}" - ContentTemplate="{TemplateBinding SetsEndHeaderTemplate}" /> - - <ContentPresenter - x:Name="SetsContentPresenter" - Grid.Row="2" - Grid.Column="0" - Grid.ColumnSpan="6" - Background="{ThemeResource SetsViewItemHeaderBackgroundPressed}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - Canvas.ZIndex="100" /> - - <!-- Shadow above Footer --> - <wctc:DropShadowPanel - Grid.Row="3" - Grid.Column="0" - Grid.ColumnSpan="6" - Canvas.ZIndex="50" - Style="{StaticResource TopEdgeShadowStyle}"> - <Grid Height="1" /> - <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="0,0,23040,12" /> - </wctc:DropShadowPanel.Clip> - </wctc:DropShadowPanel> - - <ContentPresenter - Grid.Row="3" - Grid.Column="0" - Grid.ColumnSpan="6" - Canvas.ZIndex="50" - Content="{TemplateBinding Footer}" - ContentTemplate="{TemplateBinding FooterTemplate}" /> - </Grid> - </ControlTemplate> - - <!-- Based on Style for ListViewItemExpanded Template - https://msdn.microsoft.com/en-us/library/windows/apps/mt299136.aspx --> - <ControlTemplate x:Key="SetsViewItemHeaderTemplate" TargetType="local:SetsViewItem"> - <Grid - x:Name="LayoutRoot" - wctui:FrameworkElementExtensions.AncestorType="local:SetsView" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - Control.IsTemplateFocusTarget="True" - CornerRadius="{ThemeResource ControlCornerRadius}" - FocusVisualMargin="{TemplateBinding FocusVisualMargin}" - RenderTransformOrigin="0.5,0.5"> - <Grid.BackgroundTransition> - <BrushTransition /> - </Grid.BackgroundTransition> - <Grid.RenderTransform> - <ScaleTransform x:Name="LayoutRootScale" /> - </Grid.RenderTransform> - - <wctc:DropShadowPanel - x:Name="ItemLeftSideShadow" - HorizontalAlignment="Left" - Style="{StaticResource SideEdgeShadowStyle}"> - - <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="-8,0,8,32" /> - </wctc:DropShadowPanel.Clip> - - <Grid Width="1" /> - - </wctc:DropShadowPanel> - - <wctc:DropShadowPanel - x:Name="ItemRightSideShadow" - HorizontalAlignment="Right" - Style="{StaticResource SideEdgeShadowStyle}"> - - <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="1,0,8,32" /> - </wctc:DropShadowPanel.Clip> - - <Grid Width="1" /> - - </wctc:DropShadowPanel> - - <wctc:DropShadowPanel x:Name="ItemBottomSideShadow" Style="{StaticResource BottomEdgeShadowStyle}"> - <Grid Height="1" /> - </wctc:DropShadowPanel> - - <Rectangle - x:Name="SelectionIndicator" - Height="2" - Margin="0,-1" - VerticalAlignment="Top" - Fill="{TemplateBinding SelectionIndicatorForeground}" - Opacity="0" /> - - <Border - x:Name="LeftSideSeparator" - Grid.Column="0" - Width="1" - Margin="0,6,0,6" - HorizontalAlignment="Left" - BorderBrush="{ThemeResource SystemControlBackgroundBaseLowRevealBorderBrush}" - BorderThickness="1" - Visibility="Collapsed" /> - - <Border - x:Name="RightSideSeparator" - Width="1" - Margin="0,6,0,6" - HorizontalAlignment="Right" - BorderBrush="{ThemeResource SystemControlBackgroundBaseLowRevealBorderBrush}" - BorderThickness="1" - Visibility="Collapsed" /> - - <Grid Padding="{TemplateBinding Padding}"> - <Grid x:Name="ContentPresenterGrid"> - <Grid.RenderTransform> - <TranslateTransform x:Name="ContentPresenterTranslateTransform" /> - </Grid.RenderTransform> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> - <!-- Modifications of default ListViewItem Template for our Set Here --> - <Viewbox - x:Name="IconBox" - MaxWidth="{ThemeResource SetsViewItemHeaderIconSize}" - MaxHeight="{ThemeResource SetsViewItemHeaderIconSize}" - Margin="{ThemeResource SetsViewItemHeaderIconMargin}" - Visibility="{Binding Icon, Converter={StaticResource NullVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}"> - <ContentPresenter - x:Name="Icon" - Content="{TemplateBinding Icon}" - Foreground="{TemplateBinding Foreground}" /> - </Viewbox> - <ContentPresenter - x:Name="ContentPresenter" - Grid.Column="1" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - Content="{TemplateBinding Header}" - ContentTemplate="{TemplateBinding HeaderTemplate}" - ContentTransitions="{TemplateBinding ContentTransitions}" - FontWeight="{TemplateBinding FontWeight}" - OpticalMarginAlignment="TrimSideBearings" /> - <!-- Use grid to toggle visibility based on IsClosable property and inner border for hover animations. --> - <Border - x:Name="CloseButtonContainer" - Grid.Column="2" - Width="{Binding (wctui:FrameworkElementExtensions.Ancestor).IsCloseButtonOverlay, Converter={StaticResource CloseCollapsingSizeConverter}, ElementName=LayoutRoot}" - HorizontalAlignment="Center" - Visibility="{Binding IsClosable, Converter={StaticResource BoolToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}"> - <Border - x:Name="CloseButtonBorder" - Width="{StaticResource SetsViewItemHeaderCloseWidth}" - Margin="{ThemeResource SetsViewItemHeaderCloseMargin}" - Background="{TemplateBinding Background}" - Visibility="Collapsed"> - <Button - x:Name="CloseButton" - x:Uid="/SetsView/Resources/SetsView_CloseButton" - Style="{StaticResource SetsViewItemCloseButtonStyle}"> -  - </Button> - </Border> - </Border> - </Grid> - </Grid> - - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal" /> - - <VisualState x:Name="PointerOver"> - <VisualState.Setters> - <Setter Target="LayoutRoot.(RevealBrush.State)" Value="PointerOver" /> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource SetsViewItemRevealBackgroundBrush}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SetsViewItemHeaderForegroundPointerOver}" /> - <Setter Target="Icon.Foreground" Value="{ThemeResource SetsViewItemHeaderForegroundPointerOver}" /> - </VisualState.Setters> - - <Storyboard> - <!-- Close Button --> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - - <VisualState x:Name="Pressed"> - <VisualState.Setters> - <Setter Target="LayoutRoot.(RevealBrush.State)" Value="Pressed" /> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource SetsViewItemRevealBackgroundBrush}" /> - <Setter Target="Icon.Foreground" Value="{ThemeResource SetsViewItemHeaderForegroundPressed}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SetsViewItemHeaderForegroundPressed}" /> - <Setter Target="SelectionIndicator.Opacity" Value="0.4" /> - </VisualState.Setters> - </VisualState> - - <VisualState x:Name="Selected"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource SetsViewItemHeaderBackgroundSelected}" /> - <Setter Target="Icon.Foreground" Value="{ThemeResource SetsViewItemHeaderForegroundSelected}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SetsViewItemHeaderForegroundSelected}" /> - </VisualState.Setters> - - <Storyboard> - <!-- Selected Bar --> - <DoubleAnimation - Storyboard.TargetName="SelectionIndicator" - Storyboard.TargetProperty="Opacity" - To="1" - Duration="0" /> - - <!-- Close Button --> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - - <!-- Left, right and bottom shadows --> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemLeftSideShadow" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemRightSideShadow" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemBottomSideShadow" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - - <VisualState x:Name="PointerOverSelected"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource SetsViewItemHeaderBackgroundPointerOver}" /> - <Setter Target="Icon.Foreground" Value="{ThemeResource SetsViewItemHeaderForegroundPointerOver}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SetsViewItemHeaderForegroundPointerOver}" /> - </VisualState.Setters> - - <Storyboard> - <!-- Selected Bar --> - <DoubleAnimation - Storyboard.TargetName="SelectionIndicator" - Storyboard.TargetProperty="Opacity" - To="1" - Duration="0" /> - - <!-- Close Button --> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - - <!-- Left, right and bottom shadows --> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemLeftSideShadow" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemRightSideShadow" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemBottomSideShadow" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - - <VisualState x:Name="PressedSelected"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource SetsViewItemHeaderBackgroundSelected}" /> - <Setter Target="Icon.Foreground" Value="{ThemeResource SetsViewItemHeaderForegroundPressed}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SetsViewItemHeaderForegroundPressed}" /> - </VisualState.Setters> - - <Storyboard> - <!-- Selected Bar --> - <DoubleAnimation - Storyboard.TargetName="SelectionIndicator" - Storyboard.TargetProperty="Opacity" - To="1" - Duration="0" /> - - <!-- Close Button --> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonBorder" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - - <!-- Left, right and bottom shadows --> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemLeftSideShadow" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemRightSideShadow" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemBottomSideShadow" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - - <VisualStateGroup x:Name="DisabledStates"> - <VisualState x:Name="Enabled" /> - - <VisualState x:Name="Disabled"> - <VisualState.Setters> - <Setter Target="Icon.Foreground" Value="{ThemeResource SetsViewItemHeaderForegroundDisabled}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SetsViewItemHeaderForegroundDisabled}" /> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - - <VisualStateGroup x:Name="DataVirtualizationStates"> - <VisualState x:Name="DataAvailable" /> - - <VisualState x:Name="DataPlaceholder" /> - </VisualStateGroup> - - <VisualStateGroup x:Name="ReorderHintStates"> - <VisualState x:Name="NoReorderHint" /> - - <VisualState x:Name="BottomReorderHint"> - <Storyboard> - <DragOverThemeAnimation - Direction="Bottom" - ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" - TargetName="LayoutRoot" /> - </Storyboard> - </VisualState> - - <VisualState x:Name="TopReorderHint"> - <Storyboard> - <DragOverThemeAnimation - Direction="Top" - ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" - TargetName="LayoutRoot" /> - </Storyboard> - </VisualState> - - <VisualState x:Name="RightReorderHint"> - <Storyboard> - <DragOverThemeAnimation - Direction="Right" - ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" - TargetName="LayoutRoot" /> - </Storyboard> - </VisualState> - - <VisualState x:Name="LeftReorderHint"> - <Storyboard> - <DragOverThemeAnimation - Direction="Left" - ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" - TargetName="LayoutRoot" /> - </Storyboard> - </VisualState> - - <VisualStateGroup.Transitions> - <VisualTransition GeneratedDuration="0:0:0.2" To="NoReorderHint" /> - </VisualStateGroup.Transitions> - </VisualStateGroup> - - <VisualStateGroup x:Name="DragStates"> - <VisualState x:Name="NotDragging" /> - - <VisualState x:Name="Dragging"> - <Storyboard> - <DoubleAnimation - Storyboard.TargetName="LayoutRoot" - Storyboard.TargetProperty="Opacity" - To="{ThemeResource ListViewItemDragThemeOpacity}" - Duration="0" /> - <DragItemThemeAnimation TargetName="LayoutRoot" /> - </Storyboard> - </VisualState> - - <VisualState x:Name="DraggingTarget" /> - - <VisualState x:Name="MultipleDraggingPrimary" /> - - <VisualState x:Name="MultipleDraggingSecondary" /> - - <VisualState x:Name="DraggedPlaceholder" /> - - <VisualState x:Name="Reordering"> - <Storyboard> - <DoubleAnimation - Storyboard.TargetName="LayoutRoot" - Storyboard.TargetProperty="Opacity" - To="{ThemeResource ListViewItemReorderThemeOpacity}" - Duration="0:0:0.240" /> - </Storyboard> - </VisualState> - - <VisualState x:Name="ReorderingTarget"> - <Storyboard> - <DoubleAnimation - Storyboard.TargetName="LayoutRoot" - Storyboard.TargetProperty="Opacity" - To="{ThemeResource ListViewItemReorderTargetThemeOpacity}" - Duration="0:0:0.240" /> - <DoubleAnimation - Storyboard.TargetName="LayoutRootScale" - Storyboard.TargetProperty="ScaleX" - To="{ThemeResource ListViewItemReorderTargetThemeScale}" - Duration="0:0:0.240" /> - <DoubleAnimation - Storyboard.TargetName="LayoutRootScale" - Storyboard.TargetProperty="ScaleY" - To="{ThemeResource ListViewItemReorderTargetThemeScale}" - Duration="0:0:0.240" /> - </Storyboard> - </VisualState> - - <VisualState x:Name="MultipleReorderingPrimary" /> - - <VisualState x:Name="ReorderedPlaceholder"> - <Storyboard> - <FadeOutThemeAnimation TargetName="LayoutRoot" /> - </Storyboard> - </VisualState> - - <VisualState x:Name="DragOver"> - <Storyboard> - <DropTargetItemThemeAnimation TargetName="LayoutRoot" /> - </Storyboard> - </VisualState> - - <VisualStateGroup.Transitions> - <VisualTransition GeneratedDuration="0:0:0.2" To="NotDragging" /> - </VisualStateGroup.Transitions> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - </Grid> - </ControlTemplate> - - <!-- Based on Style for Windows.UI.Xaml.Controls.ListViewItem --> - <Style TargetType="local:SetsViewItem"> - <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> - <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> - <Setter Property="FontWeight" Value="Normal" /> - <Setter Property="BorderBrush" Value="{ThemeResource SetsViewItemHeaderRevealBorderBrush}" /> - <Setter Property="BorderThickness" Value="{ThemeResource SetsViewItemHeaderBorderThickness}" /> - <Setter Property="Background" Value="{ThemeResource SetsViewItemHeaderBackground}" /> - <Setter Property="Foreground" Value="{ThemeResource SetsViewItemHeaderForeground}" /> - <Setter Property="Margin" Value="{ThemeResource SetsViewItemHeaderMargin}" /> - <Setter Property="TabNavigation" Value="Local" /> - <Setter Property="IsHoldingEnabled" Value="True" /> - <Setter Property="Padding" Value="8,0,4,0" /> - <Setter Property="HorizontalContentAlignment" Value="Left" /> - <Setter Property="VerticalContentAlignment" Value="Center" /> - <Setter Property="MinWidth" Value="{ThemeResource SetsViewItemHeaderMinWidth}" /> - <Setter Property="MinHeight" Value="{ThemeResource SetsViewItemHeaderMinHeight}" /> - <Setter Property="MaxWidth" Value="{ThemeResource SetsViewItemHeaderMaxWidth}" /> - <Setter Property="UseSystemFocusVisuals" Value="True" /> - <Setter Property="FocusVisualMargin" Value="0" /> - <Setter Property="IsClosable" Value="False" /> - <Setter Property="SelectionIndicatorForeground" Value="{ThemeResource SetsViewSelectionIndicatorForeground}" /> - <Setter Property="Template" Value="{StaticResource SetsViewItemHeaderTemplate}" /> - </Style> - - <Style x:Key="SetsViewItemCloseButtonStyle" TargetType="Button"> - <Setter Property="Background" Value="Transparent" /> - <Setter Property="BorderThickness" Value="0" /> - <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseMediumHighBrush}" /> - <Setter Property="Padding" Value="0" /> - <Setter Property="Margin" Value="2,0,2,0" /> - <Setter Property="HorizontalAlignment" Value="Center" /> - <Setter Property="VerticalAlignment" Value="Center" /> - <Setter Property="FontFamily" Value="Segoe MDL2 Assets" /> - <Setter Property="FontWeight" Value="Normal" /> - <Setter Property="FontSize" Value="14" /> - <Setter Property="UseSystemFocusVisuals" Value="True" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="Button"> - <Grid x:Name="RootGrid" Background="{TemplateBinding Background}"> - <ContentPresenter - x:Name="ContentPresenter" - Padding="{TemplateBinding Padding}" - HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" - AutomationProperties.AccessibilityView="Raw" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - Content="{TemplateBinding Content}" - ContentTemplate="{TemplateBinding ContentTemplate}" - ContentTransitions="{TemplateBinding ContentTransitions}" /> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal"> - <Storyboard> - <PointerUpThemeAnimation Storyboard.TargetName="RootGrid" /> - </Storyboard> - </VisualState> - <VisualState x:Name="PointerOver"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonPointerOverForegroundThemeBrush}" /> - </ObjectAnimationUsingKeyFrames> - <PointerUpThemeAnimation Storyboard.TargetName="RootGrid" /> - </Storyboard> - </VisualState> - <VisualState x:Name="Pressed"> - <Storyboard> - <!--<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" - Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlBackgroundBaseMediumLowBrush}" /> - </ObjectAnimationUsingKeyFrames>--> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseHighBrush}" /> - </ObjectAnimationUsingKeyFrames> - <PointerDownThemeAnimation Storyboard.TargetName="RootGrid" /> - </Storyboard> - </VisualState> - <VisualState x:Name="Disabled"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlBackgroundBaseLowBrush}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledTransparentBrush}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - - <Style x:Key="SetsViewRepeatButtonStyle" TargetType="RepeatButton"> - <Setter Property="Background" Value="{ThemeResource RepeatButtonRevealBackground}" /> - <Setter Property="BackgroundSizing" Value="OuterBorderEdge" /> - <Setter Property="Foreground" Value="{ThemeResource RepeatButtonForeground}" /> - <Setter Property="BorderBrush" Value="{ThemeResource RepeatButtonRevealBorderBrush}" /> - <Setter Property="BorderThickness" Value="{ThemeResource ButtonBorderThemeThickness}" /> - <Setter Property="Padding" Value="{StaticResource ButtonPadding}" /> - <Setter Property="HorizontalAlignment" Value="Left" /> - <Setter Property="VerticalAlignment" Value="Center" /> - <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> - <Setter Property="FontWeight" Value="Normal" /> - <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> - <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> - <Setter Property="FocusVisualMargin" Value="-3" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="RepeatButton"> - <ContentPresenter - x:Name="ContentPresenter" - Padding="{TemplateBinding Padding}" - HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" - AutomationProperties.AccessibilityView="Raw" - Background="{TemplateBinding Background}" - BackgroundSizing="{TemplateBinding BackgroundSizing}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - Content="{TemplateBinding Content}" - ContentTemplate="{TemplateBinding ContentTemplate}" - ContentTransitions="{TemplateBinding ContentTransitions}" - CornerRadius="{TemplateBinding CornerRadius}"> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal" /> - <VisualState x:Name="PointerOver"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonBackgroundPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonBorderBrushPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonForegroundPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="Pressed"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonBackgroundPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonBorderBrushPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonForegroundPressed}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="Disabled"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource HyperlinkButtonBackgroundDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonBorderBrushDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RepeatButtonForegroundDisabled}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - </ContentPresenter> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - - <Style x:Key="SetsViewScrollViewer" TargetType="ScrollViewer"> - <Setter Property="HorizontalScrollMode" Value="Auto" /> - <Setter Property="VerticalScrollMode" Value="Auto" /> - <Setter Property="IsHorizontalRailEnabled" Value="True" /> - <Setter Property="IsVerticalRailEnabled" Value="True" /> - <Setter Property="IsTabStop" Value="False" /> - <Setter Property="ZoomMode" Value="Disabled" /> - <Setter Property="HorizontalContentAlignment" Value="Left" /> - <Setter Property="VerticalContentAlignment" Value="Top" /> - <Setter Property="VerticalScrollBarVisibility" Value="Visible" /> - <Setter Property="Padding" Value="0" /> - <Setter Property="BorderThickness" Value="1,0,0,0" /> - <Setter Property="BorderBrush" Value="{ThemeResource SetsViewItemHeaderRevealBorderBrush}" /> - <Setter Property="Background" Value="Transparent" /> - <Setter Property="UseSystemFocusVisuals" Value="True" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="ScrollViewer"> - <Border - x:Name="Root" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}"> - <Grid Background="{TemplateBinding Background}"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> - - <!-- Scroll to the left button bottom shadow --> - <wctc:DropShadowPanel Grid.Column="0" Style="{StaticResource BottomEdgeShadowStyle}"> - <Grid Height="1" Margin="-1,0,0,-1" /> - <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="-1,-12,1024,12" /> - </wctc:DropShadowPanel.Clip> - </wctc:DropShadowPanel> - - <RepeatButton - x:Name="SetsScrollBackButton" - Grid.Column="0" - VerticalAlignment="Stretch" - Background="Transparent" - BorderBrush="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}" - BorderThickness="1" - CornerRadius="{ThemeResource ControlCornerRadius}" - Delay="50" - FontFamily="Segoe MDL2 Assets" - Interval="100" - Style="{ThemeResource SetsViewRepeatButtonStyle}" - Visibility="{Binding ScrollableWidth, Converter={StaticResource GreaterThanToleranceVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}, FallbackValue=Collapsed, TargetNullValue=Collapsed}"> -  - </RepeatButton> - - <!-- SetsItemsScrollViewer left side shadow --> - <wctc:DropShadowPanel - x:Name="SetsItemsScrollViewerLeftSideShadow" - Grid.Column="1" - HorizontalAlignment="Left" - Style="{StaticResource SideEdgeShadowStyle}"> - <Grid Width="1" /> - <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="-10,0,10,32" /> - </wctc:DropShadowPanel.Clip> - </wctc:DropShadowPanel> - - <!-- SetsItemsScrollViewer right side shadow --> - <wctc:DropShadowPanel - x:Name="SetsItemsScrollViewerRightSideShadow" - Grid.Column="1" - HorizontalAlignment="Right" - Style="{StaticResource SideEdgeShadowStyle}"> - <Grid Width="1" /> - <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="1,0,10,32" /> - </wctc:DropShadowPanel.Clip> - </wctc:DropShadowPanel> - - <ScrollContentPresenter - x:Name="ScrollContentPresenter" - Grid.Column="1" - Margin="{TemplateBinding Padding}" - TabFocusNavigation="Once" /> - - <!-- Scroll to the right button bottom shadow --> - <wctc:DropShadowPanel Grid.Column="2" Style="{StaticResource BottomEdgeShadowStyle}"> - <Grid Height="1" Margin="0,0,0,-1" /> - <wctc:DropShadowPanel.Clip> - <RectangleGeometry Rect="0,-12,1024,12" /> - </wctc:DropShadowPanel.Clip> - </wctc:DropShadowPanel> - - <RepeatButton - x:Name="SetsScrollForwardButton" - Grid.Column="2" - VerticalAlignment="Stretch" - Background="Transparent" - BorderBrush="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}" - BorderThickness="1" - CornerRadius="{ThemeResource ControlCornerRadius}" - Delay="50" - FontFamily="Segoe MDL2 Assets" - Interval="100" - Style="{ThemeResource SetsViewRepeatButtonStyle}" - Visibility="{Binding ScrollableWidth, Converter={StaticResource GreaterThanToleranceVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}, FallbackValue=Collapsed, TargetNullValue=Collapsed}"> -  - </RepeatButton> - </Grid> - </Border> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> -</ResourceDictionary> diff --git a/src/Notepads.Controls/SetsView/SetsViewItem.Properties.cs b/src/Notepads.Controls/SetsView/SetsViewItem.Properties.cs deleted file mode 100644 index 2a01fd140..000000000 --- a/src/Notepads.Controls/SetsView/SetsViewItem.Properties.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace Notepads.Controls -{ - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Media; - - /// <summary> - /// Item Container for a <see cref="SetsView"/>. - /// </summary> - public partial class SetsViewItem - { - /// <summary> - /// Gets or sets the header content for the set. - /// </summary> - public object Header - { - get => GetValue(HeaderProperty); - set => SetValue(HeaderProperty, value); - } - - /// <summary> - /// Identifies the <see cref="Header"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="Header"/> dependency property.</returns> - public static readonly DependencyProperty HeaderProperty = - DependencyProperty.Register(nameof(Header), typeof(object), typeof(SetsViewItem), new PropertyMetadata(null)); - - /// <summary> - /// Gets or sets the icon to appear in the set header. - /// </summary> - public IconElement Icon - { - get => (IconElement)GetValue(IconProperty); - set => SetValue(IconProperty, value); - } - - /// <summary> - /// Identifies the <see cref="Icon"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="Icon"/> dependency property.</returns> - public static readonly DependencyProperty IconProperty = - DependencyProperty.Register(nameof(Icon), typeof(IconElement), typeof(SetsViewItem), new PropertyMetadata(null)); - - /// <summary> - /// Gets or sets the template to override for the set header. - /// </summary> - public DataTemplate HeaderTemplate - { - get => (DataTemplate)GetValue(HeaderTemplateProperty); - set => SetValue(HeaderTemplateProperty, value); - } - - /// <summary> - /// Identifies the <see cref="HeaderTemplate"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="HeaderTemplate"/> dependency property.</returns> - public static readonly DependencyProperty HeaderTemplateProperty = - DependencyProperty.Register(nameof(HeaderTemplate), typeof(DataTemplate), typeof(SetsViewItem), new PropertyMetadata(null)); - - /// <summary> - /// Gets or sets a value indicating whether the set can be closed by the user with the close button. - /// </summary> - public bool IsClosable - { - get => (bool)GetValue(IsClosableProperty); - set => SetValue(IsClosableProperty, value); - } - - /// <summary> - /// Identifies the <see cref="IsClosable"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="IsClosable"/> dependency property.</returns> - public static readonly DependencyProperty IsClosableProperty = - DependencyProperty.Register(nameof(IsClosable), typeof(bool), typeof(SetsViewItem), new PropertyMetadata(null)); - - /// <summary> - /// Gets or sets the selection indicator brush - /// </summary> - public Brush SelectionIndicatorForeground - { - get => (Brush)GetValue(SelectionIndicatorForegroundProperty); - set => SetValue(SelectionIndicatorForegroundProperty, value); - } - - /// <summary> - /// Identifies the <see cref="SelectionIndicatorForeground"/> dependency property. - /// </summary> - /// <returns>The identifier for the <see cref="SelectionIndicatorForeground"/> dependency property.</returns> - public static readonly DependencyProperty SelectionIndicatorForegroundProperty = - DependencyProperty.Register(nameof(SelectionIndicatorForeground), typeof(Brush), typeof(SetsViewItem), new PropertyMetadata(null)); - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/SetsView/SetsViewItem.cs b/src/Notepads.Controls/SetsView/SetsViewItem.cs deleted file mode 100644 index 51b840645..000000000 --- a/src/Notepads.Controls/SetsView/SetsViewItem.cs +++ /dev/null @@ -1,183 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace Notepads.Controls -{ - using System; - using Windows.Devices.Input; - using Windows.System; - using Windows.UI; - using Windows.UI.Core; - using Windows.UI.Input; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Controls.Primitives; - using Windows.UI.Xaml.Input; - using Windows.UI.Xaml.Media; - using Windows.UI.Xaml.Shapes; - - /// <summary> - /// Item Container for a <see cref="SetsView"/>. - /// </summary> - [TemplatePart(Name = SetCloseButtonName, Type = typeof(ButtonBase))] - [TemplatePart(Name = SetLeftSideSeparatorName, Type = typeof(Border))] - [TemplatePart(Name = SetRightSideSeparatorName, Type = typeof(Border))] - [TemplatePart(Name = SetSelectionIndicatorName, Type = typeof(Rectangle))] - public partial class SetsViewItem : ListViewItem - { - private const string SetCloseButtonName = "CloseButton"; - - private const string SetLeftSideSeparatorName = "LeftSideSeparator"; - - private const string SetRightSideSeparatorName = "RightSideSeparator"; - - private const string SetSelectionIndicatorName = "SelectionIndicator"; - - private ButtonBase _setCloseButton; - - private Border _setLeftSideSeparator; - - private Border _setRightSideSeparator; - - private Rectangle _setSelectionIndicator; - - private bool _isMiddleClick; - - /// <summary> - /// Initializes a new instance of the <see cref="SetsViewItem"/> class. - /// </summary> - public SetsViewItem() - { - DefaultStyleKey = typeof(SetsViewItem); - } - - /// <summary> - /// Fired when the Set's close button is clicked. - /// </summary> - public event EventHandler<SetClosingEventArgs> Closing; - - public void ShowLeftSideSeparator() - { - if (_setLeftSideSeparator != null) - { - _setLeftSideSeparator.Visibility = Visibility.Visible; - } - } - - public void HideLeftSideSeparator() - { - if (_setLeftSideSeparator != null) - { - _setLeftSideSeparator.Visibility = Visibility.Collapsed; - } - } - - public void ShowRightSideSeparator() - { - if (_setRightSideSeparator != null) - { - _setRightSideSeparator.Visibility = Visibility.Visible; - } - } - - public void HideRightSideSeparator() - { - if (_setRightSideSeparator != null) - { - _setRightSideSeparator.Visibility = Visibility.Collapsed; - } - } - - /// <inheritdoc/> - protected override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - if (_setCloseButton != null) - { - _setCloseButton.Click -= SetCloseButton_Click; - } - - _setCloseButton = GetTemplateChild(SetCloseButtonName) as ButtonBase; - - if (_setCloseButton != null) - { - _setCloseButton.Click += SetCloseButton_Click; - } - - _setLeftSideSeparator = GetTemplateChild(SetLeftSideSeparatorName) as Border; - _setRightSideSeparator = GetTemplateChild(SetRightSideSeparatorName) as Border; - _setSelectionIndicator = GetTemplateChild(SetSelectionIndicatorName) as Rectangle; - } - - /// <inheritdoc/> - protected override void OnPointerPressed(PointerRoutedEventArgs e) - { - _isMiddleClick = false; - - if (e?.Pointer.PointerDeviceType == PointerDeviceType.Mouse) - { - PointerPoint pointerPoint = e.GetCurrentPoint(this); - - // Record if middle button is pressed - if (pointerPoint.Properties.IsMiddleButtonPressed) - { - _isMiddleClick = true; - } - - // Disable unwanted behaviour inherited by ListViewItem: - // Disable "Ctrl + Left click" to deselect tab - // Or variant like "Ctrl + Shift + Left click" - // Or "Ctrl + Alt + Left click" - if (pointerPoint.Properties.IsLeftButtonPressed) - { - var ctrl = Window.Current.CoreWindow.GetKeyState(VirtualKey.Control); - if (ctrl.HasFlag(CoreVirtualKeyStates.Down)) - { - // return here so the event won't be picked up by the base class - // but keep this event unhandled so it can be picked up further - return; - } - } - } - - base.OnPointerPressed(e); - } - - /// <inheritdoc/> - protected override void OnPointerReleased(PointerRoutedEventArgs e) - { - base.OnPointerReleased(e); - - // Close on Middle-Click - if (_isMiddleClick) - { - SetCloseButton_Click(this, null); - } - - _isMiddleClick = false; - } - - public void PrepareForClosing() - { - _setSelectionIndicator.Fill = new SolidColorBrush(Colors.Transparent); - } - - public void Close() - { - if (IsClosable) - { - Closing?.Invoke(this, new SetClosingEventArgs(Content, this)); - } - } - - private void SetCloseButton_Click(object sender, RoutedEventArgs e) - { - if (IsClosable) - { - Closing?.Invoke(this, new SetClosingEventArgs(Content, this)); - } - } - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/SetsView/SetsWidthMode.cs b/src/Notepads.Controls/SetsView/SetsWidthMode.cs deleted file mode 100644 index ead2b759a..000000000 --- a/src/Notepads.Controls/SetsView/SetsWidthMode.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace Notepads.Controls -{ - using Windows.UI.Xaml; - - /// <summary> - /// Possible modes for how to layout a <see cref="SetsViewItem"/> Header's Width in the <see cref="SetsView"/>. - /// </summary> - public enum SetsWidthMode - { - /// <summary> - /// Each set header takes up as much space as it needs. This is similar to how WPF and Visual Studio Code behave. - /// Suggest to keep <see cref="SetsView.IsCloseButtonOverlay"/> set to false. - /// <see cref="SetsView.SelectedSetWidth"/> is ignored. - /// In this scenario, set width behavior is effectively turned off. This can be useful when using custom styling or a custom panel for layout of <see cref="SetsViewItem"/> as well. - /// </summary> - Actual, - - /// <summary> - /// Each set header will use the minimal space set by <see cref="FrameworkElement.MinWidth"/> on the <see cref="SetsViewItem"/>. - /// Suggest to set the <see cref="SetsView.SelectedSetWidth"/> to show more content for the selected item. - /// </summary> - Compact, - - /// <summary> - /// Each set header will fill to fit the available space. If <see cref="SetsView.SelectedSetWidth"/> is set, that will be used as a Maximum Width. - /// This is similar to how Microsoft Edge behaves when used with the <see cref="SetsView.SelectedSetWidth"/>. - /// Suggest to set <see cref="SetsView.IsCloseButtonOverlay"/> to true. - /// Suggest to set <see cref="SetsView.SelectedSetWidth"/> to 200 and the SetsViewItemHeaderMinWidth Resource to 90. - /// </summary> - Equal, - } -} \ No newline at end of file diff --git a/src/Notepads.Controls/Themes/Generic.xaml b/src/Notepads.Controls/Themes/Generic.xaml deleted file mode 100644 index e5e06df08..000000000 --- a/src/Notepads.Controls/Themes/Generic.xaml +++ /dev/null @@ -1,8 +0,0 @@ -<ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:Notepads.Controls"> - <ResourceDictionary.MergedDictionaries> - <ResourceDictionary Source="ms-appx:///Notepads.Controls/SetsView/SetsView.xaml" /> - </ResourceDictionary.MergedDictionaries> -</ResourceDictionary> diff --git a/src/Notepads.sln b/src/Notepads.sln index fad9f03e9..723e20ed0 100644 --- a/src/Notepads.sln +++ b/src/Notepads.sln @@ -4,11 +4,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 VisualStudioVersion = 16.0.28803.352 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Notepads", "Notepads\Notepads.csproj", "{99274932-9E86-480C-8142-38525F80007D}" - ProjectSection(ProjectDependencies) = postProject - {7AA5E631-B663-420E-A08F-002CD81DF855} = {7AA5E631-B663-420E-A08F-002CD81DF855} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Notepads.Controls", "Notepads.Controls\Notepads.Controls.csproj", "{7AA5E631-B663-420E-A08F-002CD81DF855}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FE6A4F54-39DC-40E3-8BFB-5B1962DED402}" ProjectSection(SolutionItems) = preProject @@ -20,12 +15,12 @@ Global Debug|ARM64 = Debug|ARM64 Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 - Release|ARM64 = Release|ARM64 - Release|x64 = Release|x64 - Release|x86 = Release|x86 Production|ARM64 = Production|ARM64 Production|x64 = Production|x64 Production|x86 = Production|x86 + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {99274932-9E86-480C-8142-38525F80007D}.Debug|ARM64.ActiveCfg = Debug|ARM64 @@ -37,15 +32,6 @@ Global {99274932-9E86-480C-8142-38525F80007D}.Debug|x86.ActiveCfg = Debug|x86 {99274932-9E86-480C-8142-38525F80007D}.Debug|x86.Build.0 = Debug|x86 {99274932-9E86-480C-8142-38525F80007D}.Debug|x86.Deploy.0 = Debug|x86 - {99274932-9E86-480C-8142-38525F80007D}.Release|ARM64.ActiveCfg = Release|ARM64 - {99274932-9E86-480C-8142-38525F80007D}.Release|ARM64.Build.0 = Release|ARM64 - {99274932-9E86-480C-8142-38525F80007D}.Release|ARM64.Deploy.0 = Release|ARM64 - {99274932-9E86-480C-8142-38525F80007D}.Release|x64.ActiveCfg = Release|x64 - {99274932-9E86-480C-8142-38525F80007D}.Release|x64.Build.0 = Release|x64 - {99274932-9E86-480C-8142-38525F80007D}.Release|x64.Deploy.0 = Release|x64 - {99274932-9E86-480C-8142-38525F80007D}.Release|x86.ActiveCfg = Release|x86 - {99274932-9E86-480C-8142-38525F80007D}.Release|x86.Build.0 = Release|x86 - {99274932-9E86-480C-8142-38525F80007D}.Release|x86.Deploy.0 = Release|x86 {99274932-9E86-480C-8142-38525F80007D}.Production|ARM64.ActiveCfg = Production|ARM64 {99274932-9E86-480C-8142-38525F80007D}.Production|ARM64.Build.0 = Production|ARM64 {99274932-9E86-480C-8142-38525F80007D}.Production|ARM64.Deploy.0 = Production|ARM64 @@ -55,24 +41,15 @@ Global {99274932-9E86-480C-8142-38525F80007D}.Production|x86.ActiveCfg = Production|x86 {99274932-9E86-480C-8142-38525F80007D}.Production|x86.Build.0 = Production|x86 {99274932-9E86-480C-8142-38525F80007D}.Production|x86.Deploy.0 = Production|x86 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Debug|ARM64.Build.0 = Debug|ARM64 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Debug|x64.ActiveCfg = Debug|x64 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Debug|x64.Build.0 = Debug|x64 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Debug|x86.ActiveCfg = Debug|x86 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Debug|x86.Build.0 = Debug|x86 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Release|ARM64.ActiveCfg = Release|ARM64 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Release|ARM64.Build.0 = Release|ARM64 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Release|x64.ActiveCfg = Release|x64 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Release|x64.Build.0 = Release|x64 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Release|x86.ActiveCfg = Release|x86 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Release|x86.Build.0 = Release|x86 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Production|ARM64.ActiveCfg = Production|ARM64 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Production|ARM64.Build.0 = Production|ARM64 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Production|x64.ActiveCfg = Production|x64 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Production|x64.Build.0 = Production|x64 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Production|x86.ActiveCfg = Production|x86 - {7AA5E631-B663-420E-A08F-002CD81DF855}.Production|x86.Build.0 = Production|x86 + {99274932-9E86-480C-8142-38525F80007D}.Release|ARM64.ActiveCfg = Release|ARM64 + {99274932-9E86-480C-8142-38525F80007D}.Release|ARM64.Build.0 = Release|ARM64 + {99274932-9E86-480C-8142-38525F80007D}.Release|ARM64.Deploy.0 = Release|ARM64 + {99274932-9E86-480C-8142-38525F80007D}.Release|x64.ActiveCfg = Release|x64 + {99274932-9E86-480C-8142-38525F80007D}.Release|x64.Build.0 = Release|x64 + {99274932-9E86-480C-8142-38525F80007D}.Release|x64.Deploy.0 = Release|x64 + {99274932-9E86-480C-8142-38525F80007D}.Release|x86.ActiveCfg = Release|x86 + {99274932-9E86-480C-8142-38525F80007D}.Release|x86.Build.0 = Release|x86 + {99274932-9E86-480C-8142-38525F80007D}.Release|x86.Deploy.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Notepads/App.xaml b/src/Notepads/App.xaml index 525a2d131..773fe11a7 100644 --- a/src/Notepads/App.xaml +++ b/src/Notepads/App.xaml @@ -5,50 +5,18 @@ xmlns:muxc="using:Microsoft.UI.Xaml.Controls"> <Application.Resources> - <ResourceDictionary> - - <!--<ResourceDictionary.ThemeDictionaries> - <ResourceDictionary x:Key="Light"> - - </ResourceDictionary> - <ResourceDictionary x:Key="Dark"> - - </ResourceDictionary> - <ResourceDictionary x:Key="HighContrast"> - - </ResourceDictionary> - </ResourceDictionary.ThemeDictionaries>--> - - <ResourceDictionary.MergedDictionaries> - <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" /> - <ResourceDictionary Source="Notepads.Controls/Themes/Generic.xaml" /> - <ResourceDictionary Source="Controls/TextEditor/TextEditorCore.xaml" /> - <ResourceDictionary Source="Controls/FindAndReplace/FindAndReplacePlaceholder.xaml" /> + <muxc:XamlControlsResources> + <muxc:XamlControlsResources.MergedDictionaries> + <ResourceDictionary Source="Resource/Theme.xaml" /> + <ResourceDictionary Source="Resource/NotepadsTabViewStyle.xaml" /> + <ResourceDictionary Source="Resource/NotepadsSplitViewStyle.xaml" /> + <ResourceDictionary Source="Resource/NotepadsSettingsViewStyle.xaml" /> + <ResourceDictionary Source="Resource/NotepadsInteractiveGridStyle.xaml" /> + <ResourceDictionary Source="Resource/NotepadsInAppNotificationStyle.xaml" /> + <ResourceDictionary Source="Resource/NotepadsDialogStyle.xaml" /> <ResourceDictionary Source="Resource/DismissButtonStyle.xaml" /> <ResourceDictionary Source="Resource/TransparentTextBoxStyle.xaml" /> - <ResourceDictionary Source="Resource/CustomSplitViewStyle.xaml" /> - <ResourceDictionary Source="Resource/InAppNotificationNoDismissButton.xaml" /> - <ResourceDictionary Source="Resource/CustomSliderStyle.xaml" /> - <ResourceDictionary Source="Resource/CustomRadioButtonStyle.xaml" /> - <ResourceDictionary Source="Resource/CustomToggleSwitchStyle.xaml" /> - <ResourceDictionary Source="Resource/CustomNavigationViewStyle.xaml" /> - <ResourceDictionary Source="Resource/CustomAppBarButtonStyle.xaml" /> - <ResourceDictionary Source="Resource/CustomFlyoutItemStyle.xaml" /> - </ResourceDictionary.MergedDictionaries> - - <Style - x:Key="CompactSubtitleTextBlockStyle" - BasedOn="{StaticResource SubtitleTextBlockStyle}" - TargetType="TextBlock"> - <Setter Property="FontSize" Value="18" /> - </Style> - - <Style - x:Key="DescriptionTextBlockStyle" - BasedOn="{StaticResource CaptionTextBlockStyle}" - TargetType="TextBlock"> - <Setter Property="Foreground" Value="{ThemeResource SystemBaseMediumHighColor}" /> - </Style> - </ResourceDictionary> + </muxc:XamlControlsResources.MergedDictionaries> + </muxc:XamlControlsResources> </Application.Resources> </Application> \ No newline at end of file diff --git a/src/Notepads/Controls/Dialog/AppCloseSaveReminderDialog.cs b/src/Notepads/Controls/Dialog/AppCloseSaveReminderDialog.cs deleted file mode 100644 index 47f7745c0..000000000 --- a/src/Notepads/Controls/Dialog/AppCloseSaveReminderDialog.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace Notepads.Controls.Dialog -{ - using System; - using Windows.UI; - using Windows.UI.Xaml; - - public class AppCloseSaveReminderDialog : NotepadsDialog - { - public AppCloseSaveReminderDialog(Action saveAndExitAction, Action discardAndExitAction, Action cancelAction) - { - Title = ResourceLoader.GetString("AppCloseSaveReminderDialog_Title"); - HorizontalAlignment = HorizontalAlignment.Center; - Content = ResourceLoader.GetString("AppCloseSaveReminderDialog_Content"); - PrimaryButtonText = ResourceLoader.GetString("AppCloseSaveReminderDialog_PrimaryButtonText"); - SecondaryButtonText = ResourceLoader.GetString("AppCloseSaveReminderDialog_SecondaryButtonText"); - CloseButtonText = ResourceLoader.GetString("AppCloseSaveReminderDialog_CloseButtonText"); - PrimaryButtonStyle = GetButtonStyle(Color.FromArgb(255, 38, 114, 201)); - - PrimaryButtonClick += (dialog, eventArgs) => saveAndExitAction(); - SecondaryButtonClick += (dialog, eventArgs) => discardAndExitAction(); - CloseButtonClick += (dialog, eventArgs) => cancelAction(); - } - } -} \ No newline at end of file diff --git a/src/Notepads/Controls/Dialog/AppCloseSaveReminderDialog.xaml b/src/Notepads/Controls/Dialog/AppCloseSaveReminderDialog.xaml new file mode 100644 index 000000000..2cc8e8a84 --- /dev/null +++ b/src/Notepads/Controls/Dialog/AppCloseSaveReminderDialog.xaml @@ -0,0 +1,20 @@ +<ContentDialog + x:Class="Notepads.Controls.Dialog.AppCloseSaveReminderDialog" + 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:local="using:Notepads.Controls.Dialog" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + x:Uid="AppCloseSaveReminderDialog" + HorizontalAlignment="Center" + d:CloseButtonText="Cancel" + d:Content="There are unsaved changes." + d:PrimaryButtonText="Save All & Exit" + d:SecondaryButtonText="Discard & Exit" + d:Title="Do you want to save the changes?" + CloseButtonClick="ContentDialog_CloseButtonClick" + PrimaryButtonClick="ContentDialog_PrimaryButtonClick" + PrimaryButtonStyle="{StaticResource AccentButtonStyle}" + SecondaryButtonClick="ContentDialog_SecondaryButtonClick" + Style="{StaticResource NotepadsDialogStyle}" + mc:Ignorable="d" /> diff --git a/src/Notepads/Controls/Dialog/AppCloseSaveReminderDialog.xaml.cs b/src/Notepads/Controls/Dialog/AppCloseSaveReminderDialog.xaml.cs new file mode 100644 index 000000000..2f9d6ad41 --- /dev/null +++ b/src/Notepads/Controls/Dialog/AppCloseSaveReminderDialog.xaml.cs @@ -0,0 +1,38 @@ +namespace Notepads.Controls.Dialog +{ + using System; + using Windows.UI.Xaml.Controls; + + public sealed partial class AppCloseSaveReminderDialog : ContentDialog, INotepadsDialog + { + public bool IsAborted { get; set; } + + private readonly Action _saveAndExitAction; + private readonly Action _discardAndExitAction; + private readonly Action _cancelAction; + + public AppCloseSaveReminderDialog(Action saveAndExitAction, Action discardAndExitAction, Action cancelAction) + { + InitializeComponent(); + + _saveAndExitAction = saveAndExitAction; + _discardAndExitAction = discardAndExitAction; + _cancelAction = cancelAction; + } + + private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) + { + _saveAndExitAction?.Invoke(); + } + + private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) + { + _discardAndExitAction?.Invoke(); + } + + private void ContentDialog_CloseButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) + { + _cancelAction?.Invoke(); + } + } +} diff --git a/src/Notepads/Controls/Dialog/FileOpenErrorDialog.cs b/src/Notepads/Controls/Dialog/FileOpenErrorDialog.cs deleted file mode 100644 index 35f58da75..000000000 --- a/src/Notepads/Controls/Dialog/FileOpenErrorDialog.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Notepads.Controls.Dialog -{ - public class FileOpenErrorDialog : NotepadsDialog - { - public FileOpenErrorDialog(string filePath, string errorMsg) - { - Title = ResourceLoader.GetString("FileOpenErrorDialog_Title"); - Content = string.IsNullOrEmpty(filePath) ? errorMsg : string.Format(ResourceLoader.GetString("FileOpenErrorDialog_Content"), filePath, errorMsg); - PrimaryButtonText = ResourceLoader.GetString("FileOpenErrorDialog_PrimaryButtonText"); - } - } -} \ No newline at end of file diff --git a/src/Notepads/Controls/Dialog/FileOpenErrorDialog.xaml b/src/Notepads/Controls/Dialog/FileOpenErrorDialog.xaml new file mode 100644 index 000000000..2fa941033 --- /dev/null +++ b/src/Notepads/Controls/Dialog/FileOpenErrorDialog.xaml @@ -0,0 +1,13 @@ +<ContentDialog + x:Class="Notepads.Controls.Dialog.FileOpenErrorDialog" + 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:local="using:Notepads.Controls.Dialog" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + x:Uid="FileOpenErrorDialog" + d:Content="Sorry, file "C:\Test.txt" couldn't be opened: Error" + d:PrimaryButtonText="Ok" + d:Title="File Open Error" + Style="{StaticResource NotepadsDialogStyle}" + mc:Ignorable="d" /> diff --git a/src/Notepads/Controls/Dialog/FileOpenErrorDialog.xaml.cs b/src/Notepads/Controls/Dialog/FileOpenErrorDialog.xaml.cs new file mode 100644 index 000000000..d1064cd23 --- /dev/null +++ b/src/Notepads/Controls/Dialog/FileOpenErrorDialog.xaml.cs @@ -0,0 +1,19 @@ +namespace Notepads.Controls.Dialog +{ + using Windows.ApplicationModel.Resources; + using Windows.UI.Xaml.Controls; + + public sealed partial class FileOpenErrorDialog : ContentDialog, INotepadsDialog + { + public bool IsAborted { get; set; } + + public FileOpenErrorDialog(string filePath, string errorMsg) + { + InitializeComponent(); + + Content = string.IsNullOrEmpty(filePath) + ? errorMsg + : string.Format(ResourceLoader.GetForCurrentView().GetString("FileOpenErrorDialog_Content"), filePath, errorMsg); + } + } +} diff --git a/src/Notepads/Controls/Dialog/FileRenameDialog.xaml b/src/Notepads/Controls/Dialog/FileRenameDialog.xaml new file mode 100644 index 000000000..e2a5ee491 --- /dev/null +++ b/src/Notepads/Controls/Dialog/FileRenameDialog.xaml @@ -0,0 +1,37 @@ +<ContentDialog + x:Class="Notepads.Controls.Dialog.FileRenameDialog" + 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:local="using:Notepads.Controls.Dialog" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + x:Uid="FileRenameDialog" + d:CloseButtonText="Cancel" + d:PrimaryButtonText="Save" + d:Title="Rename" + IsPrimaryButtonEnabled="False" + PrimaryButtonClick="FileRenameDialog_PrimaryButtonClick" + PrimaryButtonStyle="{StaticResource AccentButtonStyle}" + Style="{StaticResource NotepadsDialogStyle}" + mc:Ignorable="d"> + + <Grid> + <StackPanel> + <TextBox + x:Name="FileNameBox" + Height="35" + d:Text="C:\Test.txt" + AcceptsReturn="False" + IsSpellCheckEnabled="False" + KeyDown="FileNameBox_KeyDown" + TextChanging="FileNameBox_TextChanging" /> + <TextBlock + x:Name="ErrorMessageBlock" + Margin="4,10,4,0" + d:Text="Empty file extension is not supported at this moment" + d:Visibility="Visible" + TextWrapping="Wrap" + Visibility="Collapsed" /> + </StackPanel> + </Grid> +</ContentDialog> diff --git a/src/Notepads/Controls/Dialog/FileRenameDialog.cs b/src/Notepads/Controls/Dialog/FileRenameDialog.xaml.cs similarity index 52% rename from src/Notepads/Controls/Dialog/FileRenameDialog.cs rename to src/Notepads/Controls/Dialog/FileRenameDialog.xaml.cs index c2d6b0034..68a701132 100644 --- a/src/Notepads/Controls/Dialog/FileRenameDialog.cs +++ b/src/Notepads/Controls/Dialog/FileRenameDialog.xaml.cs @@ -1,66 +1,38 @@ namespace Notepads.Controls.Dialog { + using Microsoft.AppCenter.Analytics; + using Notepads.Services; + using Notepads.Utilities; using System; using System.Collections.Generic; + using Windows.ApplicationModel.Resources; using Windows.System; - using Windows.UI; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Media; - using Notepads.Services; - using Notepads.Utilities; - using Microsoft.AppCenter.Analytics; + using Windows.UI.Xaml.Input; - public class FileRenameDialog : NotepadsDialog + public sealed partial class FileRenameDialog : ContentDialog, INotepadsDialog { - private readonly TextBox _fileNameTextBox; - - private readonly TextBlock _errorMessageTextBlock; - - private readonly Action<string> _confirmedAction; + public bool IsAborted { get; set; } + private readonly ResourceLoader _resourceLoader = ResourceLoader.GetForCurrentView(); private readonly string _originalFilename; - private readonly bool _fileExists; + private readonly Action<string> _confirmedAction; public FileRenameDialog(string filename, bool fileExists, Action<string> confirmedAction) { - _originalFilename = filename; - _fileExists = fileExists; - _confirmedAction = confirmedAction; + InitializeComponent(); - _fileNameTextBox = new TextBox - { - Text = filename, - IsSpellCheckEnabled = false, - AcceptsReturn = false, - SelectionStart = 0, - SelectionLength = filename.Contains(".") ? filename.LastIndexOf(".", StringComparison.Ordinal) : filename.Length, - Height = 35 - }; - - _errorMessageTextBlock = new TextBlock() - { - Visibility = Visibility.Collapsed, - Margin = new Thickness(4, 10, 4, 0), - FontSize = Math.Clamp(_fileNameTextBox.FontSize - 2, 1, Double.PositiveInfinity), - TextWrapping = TextWrapping.Wrap - }; - - var contentStack = new StackPanel(); - contentStack.Children.Add(_fileNameTextBox); - contentStack.Children.Add(_errorMessageTextBlock); + FileNameBox.Text = filename; + FileNameBox.SelectionStart = 0; + FileNameBox.SelectionLength = filename.Contains(".") ? filename.LastIndexOf(".", StringComparison.Ordinal) : filename.Length; - Title = ResourceLoader.GetString("FileRenameDialog_Title"); - Content = contentStack; - PrimaryButtonText = ResourceLoader.GetString("FileRenameDialog_PrimaryButtonText"); - CloseButtonText = ResourceLoader.GetString("FileRenameDialog_CloseButtonText"); - IsPrimaryButtonEnabled = false; + ErrorMessageBlock.FontSize = Math.Clamp(FileNameBox.FontSize - 2, 1, Double.PositiveInfinity); - _fileNameTextBox.TextChanging += OnTextChanging; - _fileNameTextBox.KeyDown += OnKeyDown; - - PrimaryButtonClick += (sender, args) => TryRename(); + _originalFilename = filename; + _fileExists = fileExists; + _confirmedAction = confirmedAction; Analytics.TrackEvent("FileRenameDialogOpened", new Dictionary<string, string>() { @@ -70,7 +42,7 @@ public FileRenameDialog(string filename, bool fileExists, Action<string> confirm private bool TryRename() { - var newFileName = _fileNameTextBox.Text; + var newFileName = FileNameBox.Text; if (string.Compare(_originalFilename, newFileName, StringComparison.OrdinalIgnoreCase) == 0) { @@ -91,18 +63,12 @@ private bool TryRename() return true; } - private void OnKeyDown(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e) + private void FileRenameDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { - if (e.Key == VirtualKey.Enter) - { - if (TryRename()) - { - Hide(); - } - } + TryRename(); } - private void OnTextChanging(TextBox sender, TextBoxTextChangingEventArgs args) + private void FileNameBox_TextChanging(TextBox sender, TextBoxTextChangingEventArgs args) { if (!args.IsContentChanging) return; @@ -125,24 +91,35 @@ private void OnTextChanging(TextBox sender, TextBoxTextChangingEventArgs args) if (!isFilenameValid) { - _errorMessageTextBlock.Foreground = new SolidColorBrush(Colors.Red); - _errorMessageTextBlock.Text = ResourceLoader.GetString($"InvalidFilenameError_{error}"); - _errorMessageTextBlock.Visibility = Visibility.Visible; + //ErrorMessageBlock.Foreground = new SolidColorBrush(Colors.Red); + ErrorMessageBlock.Text = _resourceLoader.GetString($"InvalidFilenameError_{error}"); + ErrorMessageBlock.Visibility = Visibility.Visible; } else if (!isExtensionSupported) { - _errorMessageTextBlock.Foreground = new SolidColorBrush(Colors.OrangeRed); - _errorMessageTextBlock.Text = string.IsNullOrEmpty(fileExtension) - ? string.Format(ResourceLoader.GetString("FileRenameError_EmptyFileExtension")) - : string.Format(ResourceLoader.GetString("FileRenameError_UnsupportedFileExtension"), fileExtension); - _errorMessageTextBlock.Visibility = Visibility.Visible; + //ErrorMessageBlock.Foreground = new SolidColorBrush(Colors.OrangeRed); + ErrorMessageBlock.Text = string.IsNullOrEmpty(fileExtension) + ? string.Format(_resourceLoader.GetString("FileRenameError_EmptyFileExtension")) + : string.Format(_resourceLoader.GetString("FileRenameError_UnsupportedFileExtension"), fileExtension); + ErrorMessageBlock.Visibility = Visibility.Visible; } else { - _errorMessageTextBlock.Visibility = Visibility.Collapsed; + ErrorMessageBlock.Visibility = Visibility.Collapsed; } IsPrimaryButtonEnabled = isFilenameValid && nameChanged && isExtensionSupported; } + + private void FileNameBox_KeyDown(object sender, KeyRoutedEventArgs e) + { + if (e.Key == VirtualKey.Enter) + { + if (TryRename()) + { + Hide(); + } + } + } } -} \ No newline at end of file +} diff --git a/src/Notepads/Controls/Dialog/FileSaveErrorDialog.cs b/src/Notepads/Controls/Dialog/FileSaveErrorDialog.cs deleted file mode 100644 index e772af232..000000000 --- a/src/Notepads/Controls/Dialog/FileSaveErrorDialog.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Notepads.Controls.Dialog -{ - public class FileSaveErrorDialog : NotepadsDialog - { - public FileSaveErrorDialog(string filePath, string errorMsg) - { - var content = string.IsNullOrEmpty(filePath) ? errorMsg : string.Format(ResourceLoader.GetString("FileSaveErrorDialog_Content"), filePath, errorMsg); - Title = ResourceLoader.GetString("FileSaveErrorDialog_Title"); - Content = content; - PrimaryButtonText = ResourceLoader.GetString("FileSaveErrorDialog_PrimaryButtonText"); - } - } -} \ No newline at end of file diff --git a/src/Notepads/Controls/Dialog/FileSaveErrorDialog.xaml b/src/Notepads/Controls/Dialog/FileSaveErrorDialog.xaml new file mode 100644 index 000000000..6e267ffa5 --- /dev/null +++ b/src/Notepads/Controls/Dialog/FileSaveErrorDialog.xaml @@ -0,0 +1,13 @@ +<ContentDialog + x:Class="Notepads.Controls.Dialog.FileSaveErrorDialog" + 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:local="using:Notepads.Controls.Dialog" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + x:Uid="FileSaveErrorDialog" + d:Content="Sorry, file "C:\Test.txt" couldn't be saved: Error" + d:PrimaryButtonText="Ok" + d:Title="File Save Error" + Style="{StaticResource NotepadsDialogStyle}" + mc:Ignorable="d" /> diff --git a/src/Notepads/Controls/Dialog/FileSaveErrorDialog.xaml.cs b/src/Notepads/Controls/Dialog/FileSaveErrorDialog.xaml.cs new file mode 100644 index 000000000..34483ecc9 --- /dev/null +++ b/src/Notepads/Controls/Dialog/FileSaveErrorDialog.xaml.cs @@ -0,0 +1,19 @@ +namespace Notepads.Controls.Dialog +{ + using Windows.ApplicationModel.Resources; + using Windows.UI.Xaml.Controls; + + public sealed partial class FileSaveErrorDialog : ContentDialog, INotepadsDialog + { + public bool IsAborted { get; set; } + + public FileSaveErrorDialog(string filePath, string errorMsg) + { + InitializeComponent(); + + Content = string.IsNullOrEmpty(filePath) + ? errorMsg + : string.Format(ResourceLoader.GetForCurrentView().GetString("FileSaveErrorDialog_Content"), filePath, errorMsg); + } + } +} diff --git a/src/Notepads/Controls/Dialog/INotepadsDialog.cs b/src/Notepads/Controls/Dialog/INotepadsDialog.cs new file mode 100644 index 000000000..40fc5987b --- /dev/null +++ b/src/Notepads/Controls/Dialog/INotepadsDialog.cs @@ -0,0 +1,14 @@ +namespace Notepads.Controls.Dialog +{ + using Windows.Foundation; + using Windows.UI.Xaml.Controls; + + public interface INotepadsDialog + { + bool IsAborted { get; set; } + object Title { get; set; } + + void Hide(); + IAsyncOperation<ContentDialogResult> ShowAsync(); + } +} diff --git a/src/Notepads/Controls/Dialog/NotepadsDialog.cs b/src/Notepads/Controls/Dialog/NotepadsDialog.cs deleted file mode 100644 index fa438e43e..000000000 --- a/src/Notepads/Controls/Dialog/NotepadsDialog.cs +++ /dev/null @@ -1,60 +0,0 @@ -namespace Notepads.Controls.Dialog -{ - using Windows.ApplicationModel.Resources; - using Windows.UI; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Media; - using Notepads.Services; - using Microsoft.Toolkit.Uwp.Helpers; - - public class NotepadsDialog : ContentDialog - { - public bool IsAborted = false; - - private readonly SolidColorBrush _darkModeBackgroundBrush = new SolidColorBrush("#101010".ToColor()); - private readonly SolidColorBrush _lightModeBackgroundBrush = new SolidColorBrush(Colors.White); - - public NotepadsDialog() - { - CornerRadius = (CornerRadius)Application.Current.Resources["OverlayCornerRadius"]; - PrimaryButtonStyle = GetButtonStyle(); - SecondaryButtonStyle = GetButtonStyle(); - CloseButtonStyle = GetButtonStyle(); - - RequestedTheme = ThemeSettingsService.ThemeMode; - Background = ThemeSettingsService.ThemeMode == ElementTheme.Dark - ? _darkModeBackgroundBrush - : _lightModeBackgroundBrush; - - ActualThemeChanged += NotepadsDialog_ActualThemeChanged; - } - - private void NotepadsDialog_ActualThemeChanged(FrameworkElement sender, object args) - { - Background = ActualTheme == ElementTheme.Dark - ? _darkModeBackgroundBrush - : _lightModeBackgroundBrush; - } - - internal readonly ResourceLoader ResourceLoader = ResourceLoader.GetForCurrentView(); - - internal static Style GetButtonStyle() - { - var buttonStyle = new Style(typeof(Button)); - buttonStyle.Setters.Add( - new Setter( - Control.CornerRadiusProperty, - (CornerRadius)Application.Current.Resources["ControlCornerRadius"])); - return buttonStyle; - } - - internal static Style GetButtonStyle(Color backgroundColor) - { - var buttonStyle = GetButtonStyle(); - buttonStyle.Setters.Add(new Setter(Control.BackgroundProperty, backgroundColor)); - buttonStyle.Setters.Add(new Setter(Control.ForegroundProperty, Colors.White)); - return buttonStyle; - } - } -} \ No newline at end of file diff --git a/src/Notepads/Controls/Dialog/RevertAllChangesConfirmationDialog.cs b/src/Notepads/Controls/Dialog/RevertAllChangesConfirmationDialog.cs deleted file mode 100644 index 949d5409c..000000000 --- a/src/Notepads/Controls/Dialog/RevertAllChangesConfirmationDialog.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Notepads.Controls.Dialog -{ - using System; - - public class RevertAllChangesConfirmationDialog : NotepadsDialog - { - public RevertAllChangesConfirmationDialog(string fileNameOrPath, Action confirmedAction) - { - Title = ResourceLoader.GetString("RevertAllChangesConfirmationDialog_Title"); - Content = string.Format(ResourceLoader.GetString("RevertAllChangesConfirmationDialog_Content"), fileNameOrPath); - PrimaryButtonText = ResourceLoader.GetString("RevertAllChangesConfirmationDialog_PrimaryButtonText"); - CloseButtonText = ResourceLoader.GetString("RevertAllChangesConfirmationDialog_CloseButtonText"); - - PrimaryButtonClick += (dialog, args) => { confirmedAction(); }; - } - } -} \ No newline at end of file diff --git a/src/Notepads/Controls/Dialog/RevertAllChangesConfirmationDialog.xaml b/src/Notepads/Controls/Dialog/RevertAllChangesConfirmationDialog.xaml new file mode 100644 index 000000000..48d5cd7fb --- /dev/null +++ b/src/Notepads/Controls/Dialog/RevertAllChangesConfirmationDialog.xaml @@ -0,0 +1,16 @@ +<ContentDialog + x:Class="Notepads.Controls.Dialog.RevertAllChangesConfirmationDialog" + 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:local="using:Notepads.Controls.Dialog" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + x:Uid="RevertAllChangesConfirmationDialog" + d:CloseButtonText="Cancel" + d:Content="All changes including text, line ending and encoding made to "C:\Test.txt" will be reverted!" + d:PrimaryButtonText="Yes" + d:Title="Are you sure to revert all changes?" + PrimaryButtonClick="RevertAllChangesConfirmationDialog_PrimaryButtonClick" + PrimaryButtonStyle="{StaticResource AccentButtonStyle}" + Style="{StaticResource NotepadsDialogStyle}" + mc:Ignorable="d" /> diff --git a/src/Notepads/Controls/Dialog/RevertAllChangesConfirmationDialog.xaml.cs b/src/Notepads/Controls/Dialog/RevertAllChangesConfirmationDialog.xaml.cs new file mode 100644 index 000000000..3af60af2d --- /dev/null +++ b/src/Notepads/Controls/Dialog/RevertAllChangesConfirmationDialog.xaml.cs @@ -0,0 +1,26 @@ +namespace Notepads.Controls.Dialog +{ + using System; + using Windows.ApplicationModel.Resources; + using Windows.UI.Xaml.Controls; + + public sealed partial class RevertAllChangesConfirmationDialog : ContentDialog, INotepadsDialog + { + public bool IsAborted { get; set; } + + private readonly Action _confirmedAction; + + public RevertAllChangesConfirmationDialog(string fileNameOrPath, Action confirmedAction) + { + InitializeComponent(); + + Content = string.Format(ResourceLoader.GetForCurrentView().GetString("RevertAllChangesConfirmationDialog_Content"), fileNameOrPath); + _confirmedAction = confirmedAction; + } + + private void RevertAllChangesConfirmationDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) + { + _confirmedAction?.Invoke(); + } + } +} diff --git a/src/Notepads/Controls/Dialog/SetCloseSaveReminderDialog.cs b/src/Notepads/Controls/Dialog/SetCloseSaveReminderDialog.cs deleted file mode 100644 index ff152444f..000000000 --- a/src/Notepads/Controls/Dialog/SetCloseSaveReminderDialog.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Notepads.Controls.Dialog -{ - using System; - - public class SetCloseSaveReminderDialog : NotepadsDialog - { - public SetCloseSaveReminderDialog(string fileNameOrPath, Action saveAction, Action skipSavingAction) - { - Title = ResourceLoader.GetString("SetCloseSaveReminderDialog_Title"); - Content = string.Format(ResourceLoader.GetString("SetCloseSaveReminderDialog_Content"), fileNameOrPath); - PrimaryButtonText = ResourceLoader.GetString("SetCloseSaveReminderDialog_PrimaryButtonText"); - SecondaryButtonText = ResourceLoader.GetString("SetCloseSaveReminderDialog_SecondaryButtonText"); - CloseButtonText = ResourceLoader.GetString("SetCloseSaveReminderDialog_CloseButtonText"); - - PrimaryButtonClick += (dialog, args) => { saveAction(); }; - SecondaryButtonClick += (dialog, args) => { skipSavingAction(); }; - } - } -} \ No newline at end of file diff --git a/src/Notepads/Controls/Dialog/SetCloseSaveReminderDialog.xaml b/src/Notepads/Controls/Dialog/SetCloseSaveReminderDialog.xaml new file mode 100644 index 000000000..d3939b3ef --- /dev/null +++ b/src/Notepads/Controls/Dialog/SetCloseSaveReminderDialog.xaml @@ -0,0 +1,18 @@ +<ContentDialog + x:Class="Notepads.Controls.Dialog.SetCloseSaveReminderDialog" + 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:local="using:Notepads.Controls.Dialog" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + x:Uid="SetCloseSaveReminderDialog" + d:CloseButtonText="Cancel" + d:Content="Save file "C:\Test.txt"?" + d:PrimaryButtonText="Save" + d:SecondaryButtonText="Don't Save" + d:Title="Save your changes?" + PrimaryButtonClick="SetCloseSaveReminderDialog_PrimaryButtonClick" + PrimaryButtonStyle="{StaticResource AccentButtonStyle}" + SecondaryButtonClick="SetCloseSaveReminderDialog_SecondaryButtonClick" + Style="{StaticResource NotepadsDialogStyle}" + mc:Ignorable="d" /> diff --git a/src/Notepads/Controls/Dialog/SetCloseSaveReminderDialog.xaml.cs b/src/Notepads/Controls/Dialog/SetCloseSaveReminderDialog.xaml.cs new file mode 100644 index 000000000..9bbc074a8 --- /dev/null +++ b/src/Notepads/Controls/Dialog/SetCloseSaveReminderDialog.xaml.cs @@ -0,0 +1,33 @@ +namespace Notepads.Controls.Dialog +{ + using System; + using Windows.ApplicationModel.Resources; + using Windows.UI.Xaml.Controls; + + public sealed partial class SetCloseSaveReminderDialog : ContentDialog, INotepadsDialog + { + public bool IsAborted { get; set; } + + private readonly Action _saveAction; + private readonly Action _skipSavingAction; + + public SetCloseSaveReminderDialog(string fileNameOrPath, Action saveAction, Action skipSavingAction) + { + InitializeComponent(); + + Content = string.Format(ResourceLoader.GetForCurrentView().GetString("SetCloseSaveReminderDialog_Content"), fileNameOrPath); + _saveAction = saveAction; + _skipSavingAction = skipSavingAction; + } + + private void SetCloseSaveReminderDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) + { + _saveAction?.Invoke(); + } + + private void SetCloseSaveReminderDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) + { + _skipSavingAction?.Invoke(); + } + } +} diff --git a/src/Notepads/Controls/DiffViewer/SideBySideDiffViewer.xaml b/src/Notepads/Controls/DiffViewer/SideBySideDiffViewer.xaml index b6509d9c3..5637bfd65 100644 --- a/src/Notepads/Controls/DiffViewer/SideBySideDiffViewer.xaml +++ b/src/Notepads/Controls/DiffViewer/SideBySideDiffViewer.xaml @@ -7,37 +7,6 @@ Background="{ThemeResource SystemControlForegroundTransparentBrush}" mc:Ignorable="d"> - <UserControl.Resources> - <ResourceDictionary> - <ResourceDictionary.ThemeDictionaries> - <ResourceDictionary x:Key="Light"> - <SolidColorBrush - x:Key="RightBoxBackgroundThemeBrush" - Opacity="0.25" - Color="White" /> - <SolidColorBrush - x:Key="HeaderBackgroundThemeBrush" - Opacity="0.35" - Color="LightGray" /> - </ResourceDictionary> - <ResourceDictionary x:Key="Dark"> - <SolidColorBrush - x:Key="RightBoxBackgroundThemeBrush" - Opacity="0.15" - Color="Black" /> - <SolidColorBrush - x:Key="HeaderBackgroundThemeBrush" - Opacity="0.2" - Color="Black" /> - </ResourceDictionary> - <ResourceDictionary x:Key="HighContrast"> - <SolidColorBrush x:Key="RightBoxBackgroundThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" /> - <SolidColorBrush x:Key="HeaderBackgroundThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" /> - </ResourceDictionary> - </ResourceDictionary.ThemeDictionaries> - </ResourceDictionary> - - </UserControl.Resources> <Grid x:Name="LayoutRoot"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> @@ -66,7 +35,7 @@ HorizontalAlignment="Left" VerticalAlignment="Center" Content="" - FontFamily="Segoe MDL2 Assets" + FontFamily="{ThemeResource SymbolThemeFontFamily}" FontSize="12" IsTabStop="False" Style="{StaticResource DismissButtonStyle}"> diff --git a/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml b/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml index cf158b669..ef5de7473 100644 --- a/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml +++ b/src/Notepads/Controls/FindAndReplace/FindAndReplaceControl.xaml @@ -25,8 +25,8 @@ x:Name="ToggleReplaceModeButtonGrid" Grid.Row="0" Grid.Column="0" - Height="36" - Padding="1,1,1,1"> + Height="44" + Padding="1,4,1,7"> <Button x:Name="ToggleReplaceModeButton" x:Uid="FindAndReplace_ToggleReplaceModeButton" @@ -35,7 +35,7 @@ Padding="0" Click="ToggleReplaceModeButton_OnClick" Content="" - FontFamily="Segoe MDL2 Assets" + FontFamily="{ThemeResource SymbolThemeFontFamily}" FontSize="12" IsTabStop="False" Style="{StaticResource DismissButtonStyle}" /> @@ -45,13 +45,13 @@ x:Name="FindBarPlaceHolder" Grid.Row="0" Grid.Column="1" - Height="36" - Padding="1,1,1,1"> + Height="44" + Padding="1,4,1,7"> <findAndReplace:FindAndReplaceTextBox x:Name="FindBar" x:Uid="FindAndReplace_FindBar" - Padding="10,3,32,6" + Padding="10,5,32,6" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="0" @@ -63,6 +63,7 @@ LostFocus="FindBar_LostFocus" RelativePanel.AlignLeftWithPanel="True" RelativePanel.AlignRightWithPanel="True" + Style="{StaticResource TransparentTextBoxStyle}" TextAlignment="Left" TextChanged="FindBar_OnTextChanged" /> @@ -72,7 +73,7 @@ RelativePanel.AlignRightWithPanel="True"> <Border x:Name="OptionButtonSelectionIndicator" - Margin="9" + Margin="11,0,11,5" VerticalAlignment="Bottom" BorderBrush="{StaticResource SystemControlBackgroundAccentBrush}" BorderThickness="1" @@ -80,9 +81,9 @@ <Button x:Name="OptionButton" x:Uid="FindAndReplace_SearchOptionButton" - Width="36" + Width="40" Content="" - FontFamily="Segoe MDL2 Assets" + FontFamily="{ThemeResource SymbolThemeFontFamily}" FontSize="16" IsTabStop="False" Style="{StaticResource DismissButtonStyle}"> @@ -122,8 +123,8 @@ x:Name="ReplaceBarPlaceHolder" Grid.Row="1" Grid.Column="1" - Height="36" - Padding="1,1,1,1"> + Height="42" + Padding="1,1,1,9"> <findAndReplace:FindAndReplaceTextBox x:Name="ReplaceBar" @@ -137,6 +138,7 @@ IsSpellCheckEnabled="False" KeyDown="ReplaceBar_OnKeyDown" LostFocus="ReplaceBar_LostFocus" + Style="{StaticResource TransparentTextBoxStyle}" TextAlignment="Left" TextChanged="ReplaceBar_OnTextChanged" /> </Grid> @@ -144,8 +146,8 @@ <Grid Grid.Row="0" Grid.Column="2" - Height="36" - Padding="1,1,1,1"> + Height="44" + Padding="1,4,1,7"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> @@ -156,10 +158,10 @@ x:Name="SearchBackwardButton" x:Uid="FindAndReplace_SearchBackwardButton" Grid.Column="0" - Width="36" + Width="40" Click="SearchBackwardButton_OnClick" Content="" - FontFamily="Segoe MDL2 Assets" + FontFamily="{ThemeResource SymbolThemeFontFamily}" FontSize="16" IsEnabled="False" IsTabStop="False" @@ -173,10 +175,10 @@ x:Name="SearchForwardButton" x:Uid="FindAndReplace_SearchForwardButton" Grid.Column="1" - Width="36" + Width="40" Click="SearchForwardButton_OnClick" Content="" - FontFamily="Segoe MDL2 Assets" + FontFamily="{ThemeResource SymbolThemeFontFamily}" FontSize="16" IsEnabled="False" IsTabStop="False" @@ -190,10 +192,10 @@ x:Name="DismissButton" x:Uid="FindAndReplace_DismissButton" Grid.Column="2" - Width="36" + Width="40" Click="DismissButton_OnClick" Content="" - FontFamily="Segoe MDL2 Assets" + FontFamily="{ThemeResource SymbolThemeFontFamily}" FontSize="16" IsTabStop="False" Style="{StaticResource DismissButtonStyle}" /> @@ -202,8 +204,8 @@ <Grid Grid.Row="1" Grid.Column="2" - Height="36" - Padding="1,1,1,1"> + Height="44" + Padding="1,1,1,7"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> @@ -214,10 +216,10 @@ x:Name="ReplaceButton" x:Uid="FindAndReplace_ReplaceButton" Grid.Column="0" - Width="36" + Width="40" Click="ReplaceButton_OnClick" Content="" - FontFamily="Segoe MDL2 Assets" + FontFamily="{ThemeResource SymbolThemeFontFamily}" FontSize="16" IsEnabled="False" IsTabStop="False" @@ -231,10 +233,10 @@ x:Name="ReplaceAllButton" x:Uid="FindAndReplace_ReplaceAllButton" Grid.Column="1" - Width="36" + Width="40" Click="ReplaceAllButton_OnClick" Content="" - FontFamily="Segoe MDL2 Assets" + FontFamily="{ThemeResource SymbolThemeFontFamily}" FontSize="16" IsEnabled="False" IsTabStop="False" diff --git a/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml b/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml deleted file mode 100644 index 54d01c75e..000000000 --- a/src/Notepads/Controls/FindAndReplace/FindAndReplacePlaceHolder.xaml +++ /dev/null @@ -1,104 +0,0 @@ -<ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls"> - <Style x:Key="FindAndReplacePlaceholder" TargetType="wctc:InAppNotification"> - <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeMediumBrush}" /> - <Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseLowBrush}" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate> - <Grid> - <Grid - x:Name="RootGrid" - Height="{TemplateBinding Height}" - MaxWidth="{TemplateBinding MaxWidth}" - Margin="{TemplateBinding Margin}" - RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}" - Visibility="{TemplateBinding Visibility}"> - <Grid.RenderTransform> - <CompositeTransform /> - </Grid.RenderTransform> - - <wctc:DropShadowPanel - HorizontalContentAlignment="Stretch" - VerticalContentAlignment="Stretch" - BlurRadius="10" - IsMasked="True" - OffsetX="0" - OffsetY="0" - ShadowOpacity="0.25"> - <Grid - Padding="{TemplateBinding Padding}" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="{ThemeResource OverlayCornerRadius}"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - - <ContentPresenter - x:Name="PART_Presenter" - HorizontalAlignment="{TemplateBinding HorizontalAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - HorizontalContentAlignment="Stretch" - VerticalContentAlignment="Center" - TextWrapping="WrapWholeWords" /> - </Grid> - </wctc:DropShadowPanel> - </Grid> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="State"> - <VisualState x:Name="Collapsed"> - <Storyboard> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> - <EasingDoubleKeyFrame KeyTime="0" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> - <EasingDoubleKeyFrame KeyTime="0" Value="20" /> - <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.Opacity)"> - <EasingDoubleKeyFrame KeyTime="0" Value="1" /> - <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" /> - </DoubleAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.Visibility)"> - <DiscreteObjectKeyFrame KeyTime="0"> - <DiscreteObjectKeyFrame.Value> - <Visibility>Visible</Visibility> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - <DiscreteObjectKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}"> - <DiscreteObjectKeyFrame.Value> - <Visibility>Collapsed</Visibility> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="Visible"> - <Storyboard> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> - <EasingDoubleKeyFrame KeyTime="0" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> - <EasingDoubleKeyFrame KeyTime="0" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> - <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="20" /> - </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.Opacity)"> - <EasingDoubleKeyFrame KeyTime="0" Value="0" /> - <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="1" /> - </DoubleAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> -</ResourceDictionary> \ No newline at end of file diff --git a/src/Notepads/Controls/GoTo/GoToControl.xaml b/src/Notepads/Controls/GoTo/GoToControl.xaml index 8d3f4aa4d..715807987 100644 --- a/src/Notepads/Controls/GoTo/GoToControl.xaml +++ b/src/Notepads/Controls/GoTo/GoToControl.xaml @@ -4,14 +4,14 @@ 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" - Height="36" + d:DesignHeight="36" d:DesignWidth="250" mc:Ignorable="d"> <Grid x:Name="GoToRootGrid" - Height="36" - Padding="1,1,1,1" + Height="44" + Padding="1,4,1,7" KeyDown="GoToRootGrid_KeyDown"> <Grid.ColumnDefinitions> @@ -43,6 +43,7 @@ IsSpellCheckEnabled="False" KeyDown="GoToBar_OnKeyDown" LostFocus="GoToBar_LostFocus" + Style="{StaticResource TransparentTextBoxStyle}" TextAlignment="Left" TextChanged="GoToBar_OnTextChanged" /> </Grid> @@ -51,10 +52,10 @@ x:Name="SearchButton" x:Uid="GoTo_SearchButton" Grid.Column="2" - Width="36" + Width="40" Click="SearchButton_OnClick" Content="" - FontFamily="Segoe MDL2 Assets" + FontFamily="{ThemeResource SymbolThemeFontFamily}" FontSize="16" IsTabStop="False" Style="{StaticResource DismissButtonStyle}" @@ -64,10 +65,10 @@ x:Name="DismissButton" x:Uid="FindAndReplace_DismissButton" Grid.Column="3" - Width="36" + Width="40" Click="DismissButton_OnClick" Content="" - FontFamily="Segoe MDL2 Assets" + FontFamily="{ThemeResource SymbolThemeFontFamily}" FontSize="16" IsTabStop="False" Style="{StaticResource DismissButtonStyle}" /> diff --git a/src/Notepads/Controls/TextEditor/TextEditor.xaml b/src/Notepads/Controls/TextEditor/TextEditor.xaml index b2128b5d8..84a67e0a8 100644 --- a/src/Notepads/Controls/TextEditor/TextEditor.xaml +++ b/src/Notepads/Controls/TextEditor/TextEditor.xaml @@ -13,73 +13,7 @@ mc:Ignorable="d"> <UserControl.Resources> - <ResourceDictionary> - <ResourceDictionary.ThemeDictionaries> - <ResourceDictionary x:Key="Light"> - <SolidColorBrush - x:Key="SplitViewBackgroundThemeBrush" - Opacity="0.4" - Color="White" /> - <SolidColorBrush - x:Key="GridSplitterBackgroundThemeBrush" - Opacity="0.5" - Color="LightGray" /> - </ResourceDictionary> - <ResourceDictionary x:Key="Dark"> - <SolidColorBrush - x:Key="SplitViewBackgroundThemeBrush" - Opacity="0.25" - Color="Black" /> - <SolidColorBrush - x:Key="GridSplitterBackgroundThemeBrush" - Opacity="0.3" - Color="Black" /> - </ResourceDictionary> - <ResourceDictionary x:Key="HighContrast"> - <SolidColorBrush x:Key="SplitViewBackgroundThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" /> - <SolidColorBrush x:Key="GridSplitterBackgroundThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" /> - </ResourceDictionary> - </ResourceDictionary.ThemeDictionaries> - - <Style x:Key="CustomGridSplitterStyle" TargetType="wctc:GridSplitter"> - <Setter Property="IsTabStop" Value="True" /> - <Setter Property="UseSystemFocusVisuals" Value="True" /> - <Setter Property="HorizontalAlignment" Value="Stretch" /> - <Setter Property="VerticalAlignment" Value="Stretch" /> - <Setter Property="IsFocusEngagementEnabled" Value="True" /> - <Setter Property="MinWidth" Value="2" /> - <Setter Property="MinHeight" Value="2" /> - <Setter Property="Background" Value="Transparent" /> - <Setter Property="GripperForeground" Value="Transparent" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="wctc:GridSplitter"> - <Grid x:Name="RootGrid" Background="Transparent"> - <ContentPresenter - HorizontalContentAlignment="Stretch" - VerticalContentAlignment="Stretch" - Content="{TemplateBinding Element}" /> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="GridSplitterStates"> - <VisualState x:Name="Normal" /> - <VisualState x:Name="PointerOver"> - <VisualState.Setters> - <Setter Target="RootGrid.Background" Value="{ThemeResource GridSplitterBackgroundThemeBrush}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="Pressed"> - <VisualState.Setters> - <Setter Target="RootGrid.Background" Value="{ThemeResource GridSplitterBackgroundThemeBrush}" /> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - </ResourceDictionary> + <ResourceDictionary Source="TextEditorCore.xaml" /> </UserControl.Resources> <Grid> @@ -184,7 +118,7 @@ GripperCursor="Default" ResizeBehavior="BasedOnAlignment" ResizeDirection="Auto" - Style="{StaticResource CustomGridSplitterStyle}"> + Style="{StaticResource NotepadsGridSplitterStyle}"> <wctc:GridSplitter.RenderTransform> <TranslateTransform X="0" /> </wctc:GridSplitter.RenderTransform> diff --git a/src/Notepads/Controls/TextEditor/TextEditorCore.xaml b/src/Notepads/Controls/TextEditor/TextEditorCore.xaml index 3789096a3..d1230ce58 100644 --- a/src/Notepads/Controls/TextEditor/TextEditorCore.xaml +++ b/src/Notepads/Controls/TextEditor/TextEditorCore.xaml @@ -1,14 +1,23 @@ -<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> +<ResourceDictionary + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls"> <ResourceDictionary.ThemeDictionaries> <ResourceDictionary x:Key="Light"> <SolidColorBrush x:Key="TextEditorForeground" Color="Black" /> + <StaticResource x:Key="FloatingControlBackground" ResourceKey="InAppNotificationBackgroundBrush" /> + <StaticResource x:Key="FloatingControlBorderBrush" ResourceKey="InAppNotificationBorderBrush" /> </ResourceDictionary> <ResourceDictionary x:Key="Dark"> <SolidColorBrush x:Key="TextEditorForeground" Color="#F0F0F0" /> + <StaticResource x:Key="FloatingControlBackground" ResourceKey="InAppNotificationBackgroundBrush" /> + <StaticResource x:Key="FloatingControlBorderBrush" ResourceKey="InAppNotificationBorderBrush" /> </ResourceDictionary> <ResourceDictionary x:Key="HighContrast"> <SolidColorBrush x:Key="TextEditorForeground" Color="{ThemeResource TextControlForeground}" /> + <StaticResource x:Key="FloatingControlBackground" ResourceKey="InAppNotificationBackgroundBrush" /> + <StaticResource x:Key="FloatingControlBorderBrush" ResourceKey="InAppNotificationBorderBrush" /> </ResourceDictionary> </ResourceDictionary.ThemeDictionaries> @@ -136,4 +145,146 @@ </Setter> </Style> + <Style x:Key="NotepadsGridSplitterStyle" TargetType="wctc:GridSplitter"> + <Setter Property="IsTabStop" Value="True" /> + <Setter Property="UseSystemFocusVisuals" Value="True" /> + <Setter Property="HorizontalAlignment" Value="Stretch" /> + <Setter Property="VerticalAlignment" Value="Stretch" /> + <Setter Property="IsFocusEngagementEnabled" Value="True" /> + <Setter Property="MinWidth" Value="2" /> + <Setter Property="MinHeight" Value="2" /> + <Setter Property="Background" Value="Transparent" /> + <Setter Property="GripperForeground" Value="Transparent" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="wctc:GridSplitter"> + <Grid x:Name="RootGrid" Background="Transparent"> + <ContentPresenter + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch" + Content="{TemplateBinding Element}" /> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="GridSplitterStates"> + <VisualState x:Name="Normal" /> + <VisualState x:Name="PointerOver"> + <VisualState.Setters> + <Setter Target="RootGrid.Background" Value="{ThemeResource GridSplitterBackgroundThemeBrush}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="Pressed"> + <VisualState.Setters> + <Setter Target="RootGrid.Background" Value="{ThemeResource GridSplitterBackgroundThemeBrush}" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="FindAndReplacePlaceholder" TargetType="wctc:InAppNotification"> + <Setter Property="Background" Value="{ThemeResource FloatingControlBackground}" /> + <Setter Property="Foreground" Value="{ThemeResource TextFillColorPrimary}" /> + <Setter Property="BorderBrush" Value="{ThemeResource FloatingControlBorderBrush}" /> + <Setter Property="BorderThickness" Value="2" /> + <Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate> + <Grid> + <Grid + x:Name="RootGrid" + Height="{TemplateBinding Height}" + MaxWidth="{TemplateBinding MaxWidth}" + Margin="{TemplateBinding Margin}" + RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}" + Visibility="{TemplateBinding Visibility}"> + <Grid.RenderTransform> + <CompositeTransform /> + </Grid.RenderTransform> + + <wctc:DropShadowPanel + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch" + BlurRadius="10" + IsMasked="True" + OffsetX="0" + OffsetY="0" + ShadowOpacity="0.25"> + <Grid + Padding="{TemplateBinding Padding}" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{TemplateBinding CornerRadius}"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + + <ContentPresenter + x:Name="PART_Presenter" + HorizontalAlignment="{TemplateBinding HorizontalAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Center" + TextWrapping="WrapWholeWords" /> + </Grid> + </wctc:DropShadowPanel> + </Grid> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="State"> + <VisualState x:Name="Collapsed"> + <Storyboard> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> + <EasingDoubleKeyFrame KeyTime="0" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> + <EasingDoubleKeyFrame KeyTime="0" Value="20" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.Opacity)"> + <EasingDoubleKeyFrame KeyTime="0" Value="1" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" /> + </DoubleAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.Visibility)"> + <DiscreteObjectKeyFrame KeyTime="0"> + <DiscreteObjectKeyFrame.Value> + <Visibility>Visible</Visibility> + </DiscreteObjectKeyFrame.Value> + </DiscreteObjectKeyFrame> + <DiscreteObjectKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}"> + <DiscreteObjectKeyFrame.Value> + <Visibility>Collapsed</Visibility> + </DiscreteObjectKeyFrame.Value> + </DiscreteObjectKeyFrame> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + <VisualState x:Name="Visible"> + <Storyboard> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> + <EasingDoubleKeyFrame KeyTime="0" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> + <EasingDoubleKeyFrame KeyTime="0" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="20" /> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="(UIElement.Opacity)"> + <EasingDoubleKeyFrame KeyTime="0" Value="0" /> + <EasingDoubleKeyFrame wctc:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="1" /> + </DoubleAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + </ResourceDictionary> \ No newline at end of file diff --git a/src/Notepads/Core/NotepadsCore.cs b/src/Notepads/Core/NotepadsCore.cs index 00a81bd3f..95b2422e7 100644 --- a/src/Notepads/Core/NotepadsCore.cs +++ b/src/Notepads/Core/NotepadsCore.cs @@ -24,6 +24,7 @@ using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Microsoft.AppCenter.Analytics; + using Microsoft.UI.Xaml.Controls; public class NotepadsCore : INotepadsCore { @@ -44,7 +45,7 @@ public class NotepadsCore : INotepadsCore public event KeyEventHandler TextEditorKeyDown; - public SetsView Sets; + public TabView Sets; private readonly INotepadsExtensionProvider _extensionProvider; @@ -56,6 +57,12 @@ public class NotepadsCore : INotepadsCore private readonly CoreDispatcher _dispatcher; + private readonly Microsoft.UI.Xaml.Controls.FontIconSource _modifierIcon = new Microsoft.UI.Xaml.Controls.FontIconSource() + { + Glyph = "\uF127", + FontSize = 1.5 + }; + private const string SetDragAndDropActionStatus = "SetDragAndDropActionStatus"; private const string NotepadsTextEditorMetaData = "NotepadsTextEditorMetaData"; private const string NotepadsTextEditorGuid = "NotepadsTextEditorGuid"; @@ -64,20 +71,20 @@ public class NotepadsCore : INotepadsCore private const string NotepadsTextEditorPendingContent = "NotepadsTextEditorPendingContent"; private const string NotepadsTextEditorEditingFilePath = "NotepadsTextEditorEditingFilePath"; - public NotepadsCore(SetsView sets, + public NotepadsCore(TabView sets, INotepadsExtensionProvider extensionProvider, CoreDispatcher dispatcher) { Sets = sets; Sets.SelectionChanged += SetsView_OnSelectionChanged; - Sets.Items.VectorChanged += SetsView_OnItemsChanged; - Sets.SetClosing += SetsView_OnSetClosing; - Sets.SetTapped += (sender, args) => { FocusOnTextEditor(args.Item as ITextEditor); }; - Sets.SetDraggedOutside += Sets_SetDraggedOutside; + Sets.TabItemsChanged += SetsView_OnItemsChanged; + Sets.TabCloseRequested += SetsView_OnSetClosing; + //Sets.SetTapped += (sender, args) => { FocusOnTextEditor(args.Item as ITextEditor); }; + Sets.TabDroppedOutside += Sets_SetDraggedOutside; Sets.DragOver += Sets_DragOver; Sets.Drop += Sets_Drop; - Sets.DragItemsStarting += Sets_DragItemsStarting; - Sets.DragItemsCompleted += Sets_DragItemsCompleted; + Sets.TabDragStarting += Sets_DragItemsStarting; + Sets.TabDragCompleted += Sets_DragItemsCompleted; _dispatcher = dispatcher; _extensionProvider = extensionProvider; @@ -89,11 +96,11 @@ private async void ThemeSettingsService_OnAccentColorChanged(object sender, Colo { await _dispatcher.CallOnUIThreadAsync(() => { - if (Sets.Items == null) return; - foreach (SetsViewItem item in Sets.Items) + if (Sets.TabItems == null) return; + foreach (TabViewItem item in Sets.TabItems) { - item.Icon.Foreground = new SolidColorBrush(color); - item.SelectionIndicatorForeground = new SolidColorBrush(color); + //item.IconSource.Foreground = new SolidColorBrush(color); + //item.SelectionIndicatorForeground = new SolidColorBrush(color); } }); } @@ -113,7 +120,7 @@ public void OpenNewTextEditor(string fileNamePlaceholder) public void OpenTextEditor(ITextEditor textEditor, int atIndex = -1) { - SetsViewItem textEditorSetsViewItem = CreateTextEditorSetsViewItem(textEditor); + TabViewItem textEditorSetsViewItem = CreateTextEditorSetsViewItem(textEditor); // Notepads should replace current "Untitled.txt" with open file if it is empty and it is the only tab that has been created. // If index != -1, it means set was created after a drag and drop, we should skip this logic @@ -122,25 +129,25 @@ public void OpenTextEditor(ITextEditor textEditor, int atIndex = -1) var selectedEditor = GetAllTextEditors().First(); if (selectedEditor.EditingFile == null && !selectedEditor.IsModified) { - Sets.Items?.Clear(); + Sets.TabItems?.Clear(); } } if (atIndex == -1) { - Sets.Items?.Add(textEditorSetsViewItem); + Sets.TabItems?.Add(textEditorSetsViewItem); } else { - Sets.Items?.Insert(atIndex, textEditorSetsViewItem); + Sets.TabItems?.Insert(atIndex, textEditorSetsViewItem); } - if (GetNumberOfOpenedTextEditors() > 1) + if (GetNumberOfOpenedTextEditors() > 0) { Sets.SelectedItem = textEditorSetsViewItem; if (atIndex == -1) { - Sets.ScrollToLastSet(); + //Sets.ScrollToLastSet(); } } } @@ -152,7 +159,7 @@ public void OpenTextEditors(ITextEditor[] editors, Guid? selectedEditorId = null foreach (var textEditor in editors) { var editorSetsViewItem = CreateTextEditorSetsViewItem(textEditor); - Sets.Items?.Add(editorSetsViewItem); + Sets.TabItems?.Add(editorSetsViewItem); if (selectedEditorId.HasValue && textEditor.Id == selectedEditorId.Value) { Sets.SelectedItem = editorSetsViewItem; @@ -163,7 +170,7 @@ public void OpenTextEditors(ITextEditor[] editors, Guid? selectedEditorId = null if (selectedEditorId == null || !selectedEditorFound) { Sets.SelectedIndex = editors.Length - 1; - Sets.ScrollToLastSet(); + //Sets.ScrollToLastSet(); } } @@ -220,8 +227,8 @@ public void DeleteTextEditor(ITextEditor textEditor) var item = GetTextEditorSetsViewItem(textEditor); if (item == null) return; item.IsEnabled = false; - item.PrepareForClosing(); - Sets.Items?.Remove(item); + //item.PrepareForClosing(); + Sets.TabItems?.Remove(item); if (item.ContextFlyout is TabContextFlyout tabContextFlyout) { @@ -246,7 +253,7 @@ public void DeleteTextEditor(ITextEditor textEditor) public int GetNumberOfOpenedTextEditors() { - return Sets.Items?.Count ?? 0; + return Sets.TabItems?.Count ?? 0; } public bool TryGetSharingContent(ITextEditor textEditor, out string title, out string content) @@ -258,8 +265,8 @@ public bool TryGetSharingContent(ITextEditor textEditor, out string title, out s public bool HaveUnsavedTextEditor() { - if (Sets.Items == null || Sets.Items.Count == 0) return false; - foreach (SetsViewItem setsItem in Sets.Items) + if (Sets.TabItems == null || Sets.TabItems.Count == 0) return false; + foreach (TabViewItem setsItem in Sets.TabItems) { if (!(setsItem.Content is ITextEditor textEditor)) continue; if (!textEditor.IsModified) continue; @@ -270,8 +277,8 @@ public bool HaveUnsavedTextEditor() public bool HaveNonemptyTextEditor() { - if (Sets.Items == null || Sets.Items.Count <= 1) return false; - foreach (SetsViewItem setsItem in Sets.Items) + if (Sets.TabItems == null || Sets.TabItems.Count <= 1) return false; + foreach (TabViewItem setsItem in Sets.TabItems) { if (!(setsItem.Content is ITextEditor textEditor)) continue; if (string.IsNullOrEmpty(textEditor.GetText())) continue; @@ -287,10 +294,10 @@ public void ChangeLineEnding(ITextEditor textEditor, LineEnding lineEnding) public void SwitchTo(bool next) { - if (Sets.Items == null) return; - if (Sets.Items.Count < 2) return; + if (Sets.TabItems == null) return; + if (Sets.TabItems.Count < 2) return; - var setsCount = Sets.Items.Count; + var setsCount = Sets.TabItems.Count; var selected = Sets.SelectedIndex; if (next && setsCount > 1) @@ -319,7 +326,7 @@ public void SwitchTo(bool next) public void SwitchTo(int index) { - if (Sets.Items == null || index < 0 || index >= Sets.Items.Count) return; + if (Sets.TabItems == null || index < 0 || index >= Sets.TabItems.Count) return; Sets.SelectedIndex = index; } @@ -329,7 +336,7 @@ public void SwitchTo(ITextEditor textEditor) if (Sets.SelectedItem != item) { Sets.SelectedItem = item; - Sets.ScrollIntoView(item); + //Sets.ScrollIntoView(item); } } @@ -337,7 +344,7 @@ public ITextEditor GetSelectedTextEditor() { if (ThreadUtility.IsOnUIThread()) { - if ((!((Sets.SelectedItem as SetsViewItem)?.Content is ITextEditor textEditor))) return null; + if ((!((Sets.SelectedItem as TabViewItem)?.Content is ITextEditor textEditor))) return null; return textEditor; } return _selectedTextEditor; @@ -353,9 +360,9 @@ public ITextEditor GetTextEditor(string editingFilePath) public ITextEditor[] GetAllTextEditors() { if (!ThreadUtility.IsOnUIThread()) return _allTextEditors; - if (Sets.Items == null) return Array.Empty<ITextEditor>(); + if (Sets.TabItems == null) return Array.Empty<ITextEditor>(); var editors = new List<ITextEditor>(); - foreach (SetsViewItem item in Sets.Items) + foreach (TabViewItem item in Sets.TabItems) { if (item.Content is ITextEditor textEditor) { @@ -378,7 +385,8 @@ public void FocusOnTextEditor(ITextEditor textEditor) public void CloseTextEditor(ITextEditor textEditor) { var item = GetTextEditorSetsViewItem(textEditor); - item?.Close(); + Sets.TabItems.Remove(item); + //item?.Close(); } public ITextEditor GetTextEditor(StorageFile file) @@ -389,31 +397,31 @@ public ITextEditor GetTextEditor(StorageFile file) public double GetTabScrollViewerHorizontalOffset() { - return Sets.ScrollViewerHorizontalOffset; + return 50;// Sets.ScrollViewerHorizontalOffset; } public void SetTabScrollViewerHorizontalOffset(double offset) { - Sets.ScrollTo(offset); + //Sets.ScrollTo(offset); } - private SetsViewItem CreateTextEditorSetsViewItem(ITextEditor textEditor) + private TabViewItem CreateTextEditorSetsViewItem(ITextEditor textEditor) { - var modifierIcon = new FontIcon() + var modifierIcon = new Microsoft.UI.Xaml.Controls.FontIconSource() { Glyph = "\uF127", FontSize = 1.5, - Width = 3, - Height = 3, - Foreground = new SolidColorBrush(ThemeSettingsService.AppAccentColor), + //Width = 3, + //Height = 3, + //Foreground = new SolidColorBrush(ThemeSettingsService.AppAccentColor), }; - var textEditorSetsViewItem = new SetsViewItem + var textEditorSetsViewItem = new TabViewItem { Header = textEditor.EditingFileName ?? textEditor.FileNamePlaceholder, Content = textEditor, - SelectionIndicatorForeground = new SolidColorBrush(ThemeSettingsService.AppAccentColor), - Icon = modifierIcon + //SelectionIndicatorForeground = new SolidColorBrush(ThemeSettingsService.AppAccentColor), + //IconSource = null }; if (textEditorSetsViewItem.Content == null || textEditorSetsViewItem.Content is Page) @@ -421,16 +429,17 @@ private SetsViewItem CreateTextEditorSetsViewItem(ITextEditor textEditor) throw new Exception("Content should not be null and type should not be Page (SetsView does not work well with Page controls)"); } - textEditorSetsViewItem.Icon.Visibility = textEditor.IsModified ? Visibility.Visible : Visibility.Collapsed; + textEditorSetsViewItem.IconSource = textEditor.IsModified ? _modifierIcon : null; + //textEditorSetsViewItem.Icon.Visibility = textEditor.IsModified ? Visibility.Visible : Visibility.Collapsed; textEditorSetsViewItem.ContextFlyout = new TabContextFlyout(this, textEditor); return textEditorSetsViewItem; } - private SetsViewItem GetTextEditorSetsViewItem(StorageFile file) + private TabViewItem GetTextEditorSetsViewItem(StorageFile file) { - if (Sets.Items == null) return null; - foreach (SetsViewItem setsItem in Sets.Items) + if (Sets.TabItems == null) return null; + foreach (TabViewItem setsItem in Sets.TabItems) { if (!(setsItem.Content is ITextEditor textEditor)) continue; if (textEditor.EditingFilePath != null && string.Equals(textEditor.EditingFilePath, file.Path, StringComparison.OrdinalIgnoreCase)) @@ -441,10 +450,10 @@ private SetsViewItem GetTextEditorSetsViewItem(StorageFile file) return null; } - private SetsViewItem GetTextEditorSetsViewItem(ITextEditor textEditor) + private TabViewItem GetTextEditorSetsViewItem(ITextEditor textEditor) { - if (Sets.Items == null) return null; - foreach (SetsViewItem setsItem in Sets.Items) + if (Sets.TabItems == null) return null; + foreach (TabViewItem setsItem in Sets.TabItems) { if (setsItem.Content is ITextEditor editor) { @@ -460,7 +469,8 @@ private void MarkTextEditorSetNotSaved(ITextEditor textEditor) var item = GetTextEditorSetsViewItem(textEditor); if (item != null) { - item.Icon.Visibility = Visibility.Visible; + item.IconSource = _modifierIcon; + //item.Icon.Visibility = Visibility.Visible; } } @@ -474,7 +484,8 @@ private void MarkTextEditorSetSaved(ITextEditor textEditor) { item.Header = textEditor.EditingFileName; } - item.Icon.Visibility = Visibility.Collapsed; + item.IconSource = null; + //item.Icon.Visibility = Visibility.Collapsed; } } @@ -488,13 +499,13 @@ private void SetsView_OnItemsChanged(object sender, IVectorChangedEventArgs e) _allTextEditors = GetAllTextEditors(); } - private void SetsView_OnSetClosing(object sender, SetClosingEventArgs e) + private void SetsView_OnSetClosing(object sender, TabViewTabCloseRequestedEventArgs e) { - if (!(e.Set.Content is ITextEditor textEditor)) return; + if (!(e.Tab.Content is ITextEditor textEditor)) return; if (TextEditorClosing != null) { - e.Cancel = true; + //e.Cancel = true; TextEditorClosing.Invoke(this, textEditor); } } @@ -636,11 +647,10 @@ private async void Sets_DragOver(object sender, DragEventArgs args) deferral.Complete(); } - private void Sets_DragItemsStarting(object sender, DragItemsStartingEventArgs args) + private void Sets_DragItemsStarting(object sender, TabViewTabDragStartingEventArgs args) { // In Initial Window we need to serialize our tab data. - var item = args.Items.FirstOrDefault(); - if (!(item is ITextEditor editor)) return; + if (!(args.Tab.Content is ITextEditor editor)) return; try { @@ -679,7 +689,7 @@ private void Sets_DragItemsStarting(object sender, DragItemsStartingEventArgs ar private async void Sets_Drop(object sender, DragEventArgs args) { - if (!(sender is SetsView sets)) + if (!(sender is TabView sets)) { return; } @@ -757,9 +767,9 @@ private async void Sets_Drop(object sender, DragEventArgs args) var index = -1; // Determine which items in the list our pointer is in between. - for (int i = 0; i < sets.Items?.Count; i++) + for (int i = 0; i < sets.TabItems?.Count; i++) { - var item = sets.ContainerFromIndex(i) as SetsViewItem; + var item = sets.ContainerFromIndex(i) as TabViewItem; if (args.GetPosition(item).X - item?.ActualWidth < 0) { @@ -768,7 +778,7 @@ private async void Sets_Drop(object sender, DragEventArgs args) } } - var atIndex = index == -1 ? sets.Items.Count : index; + var atIndex = index == -1 ? sets.TabItems.Count : index; var textFile = new TextFile(lastSavedText, EncodingUtility.GetEncodingByName(metaData.LastSavedEncoding), @@ -799,11 +809,11 @@ private async void Sets_Drop(object sender, DragEventArgs args) } } - private void Sets_DragItemsCompleted(ListViewBase sender, DragItemsCompletedEventArgs args) + private void Sets_DragItemsCompleted(TabView sender, TabViewTabDragCompletedEventArgs args) { if (ApplicationSettingsStore.Read(SetDragAndDropActionStatus) is string setDragAndDropActionStatus && setDragAndDropActionStatus == "Handled") { - if (args.Items.FirstOrDefault() is ITextEditor editor) + if (args.Tab.Content is ITextEditor editor) { TextEditorMovedToAnotherAppInstance?.Invoke(this, editor); } @@ -812,9 +822,9 @@ private void Sets_DragItemsCompleted(ListViewBase sender, DragItemsCompletedEven ApplicationSettingsStore.Remove(SetDragAndDropActionStatus); } - private async void Sets_SetDraggedOutside(object sender, SetDraggedOutsideEventArgs e) + private async void Sets_SetDraggedOutside(object sender, TabViewTabDroppedOutsideEventArgs e) { - if (Sets.Items?.Count > 1 && e.Set?.Content is ITextEditor textEditor) + if (Sets.TabItems?.Count > 1 && e.Tab?.Content is ITextEditor textEditor) { // Only allow untitled empty document to be dragged outside for now if (!textEditor.IsModified && textEditor.EditingFile == null) diff --git a/src/Notepads/Notepads.csproj b/src/Notepads/Notepads.csproj index 535db1499..8b5f8cbc9 100644 --- a/src/Notepads/Notepads.csproj +++ b/src/Notepads/Notepads.csproj @@ -147,12 +147,25 @@ <Compile Include="Commands\MouseCommandHandler.cs" /> <Compile Include="Commands\KeyboardCommand.cs" /> <Compile Include="Commands\KeyboardCommandHandler.cs" /> - <Compile Include="Controls\Dialog\AppCloseSaveReminderDialog.cs" /> - <Compile Include="Controls\Dialog\FileRenameDialog.cs" /> - <Compile Include="Controls\Dialog\FileOpenErrorDialog.cs" /> - <Compile Include="Controls\Dialog\FileSaveErrorDialog.cs" /> - <Compile Include="Controls\Dialog\RevertAllChangesConfirmationDialog.cs" /> - <Compile Include="Controls\Dialog\SetCloseSaveReminderDialog.cs" /> + <Compile Include="Controls\Dialog\AppCloseSaveReminderDialog.xaml.cs"> + <DependentUpon>AppCloseSaveReminderDialog.xaml</DependentUpon> + </Compile> + <Compile Include="Controls\Dialog\FileOpenErrorDialog.xaml.cs"> + <DependentUpon>FileOpenErrorDialog.xaml</DependentUpon> + </Compile> + <Compile Include="Controls\Dialog\FileRenameDialog.xaml.cs"> + <DependentUpon>FileRenameDialog.xaml</DependentUpon> + </Compile> + <Compile Include="Controls\Dialog\FileSaveErrorDialog.xaml.cs"> + <DependentUpon>FileSaveErrorDialog.xaml</DependentUpon> + </Compile> + <Compile Include="Controls\Dialog\INotepadsDialog.cs" /> + <Compile Include="Controls\Dialog\RevertAllChangesConfirmationDialog.xaml.cs"> + <DependentUpon>RevertAllChangesConfirmationDialog.xaml</DependentUpon> + </Compile> + <Compile Include="Controls\Dialog\SetCloseSaveReminderDialog.xaml.cs"> + <DependentUpon>SetCloseSaveReminderDialog.xaml</DependentUpon> + </Compile> <Compile Include="Controls\FindAndReplace\FindAndReplaceControl.xaml.cs"> <DependentUpon>FindAndReplaceControl.xaml</DependentUpon> </Compile> @@ -175,6 +188,7 @@ <Compile Include="Controls\TextEditor\TextEditorCore.MoveText.cs" /> <Compile Include="Extensions\DispatcherExtensions.cs" /> <Compile Include="Extensions\ScrollViewerExtensions.cs" /> + <Compile Include="Utilities\BehaviorUtility.cs" /> <Compile Include="Utilities\FutureAccessListUtility.cs" /> <Compile Include="Utilities\LanguageUtility.cs" /> <Compile Include="Views\Settings\AboutPage.xaml.cs"> @@ -257,7 +271,6 @@ <Compile Include="Utilities\LineEndingUtility.cs" /> <Compile Include="Services\AppSettingsService.cs" /> <Compile Include="Services\ThemeSettingsService.cs" /> - <Compile Include="Controls\Dialog\NotepadsDialog.cs" /> <Compile Include="Utilities\SearchEngineUtility.cs" /> <Compile Include="Utilities\SessionUtility.cs" /> <Compile Include="Models\TextFile.cs" /> @@ -302,6 +315,34 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </ApplicationDefinition> + <Page Include="Controls\Dialog\AppCloseSaveReminderDialog.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Controls\Dialog\FileOpenErrorDialog.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Controls\Dialog\FileRenameDialog.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Controls\Dialog\FileSaveErrorDialog.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Resource\NotepadsDialogStyle.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Controls\Dialog\RevertAllChangesConfirmationDialog.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Controls\Dialog\SetCloseSaveReminderDialog.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Controls\FindAndReplace\FindAndReplaceControl.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -318,7 +359,15 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> - <Page Include="Resource\CustomFlyoutItemStyle.xaml"> + <Page Include="Resource\NotepadsInteractiveGridStyle.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Resource\NotepadsTabViewStyle.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Resource\Theme.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> @@ -366,35 +415,15 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> - <Page Include="Controls\FindAndReplace\FindAndReplacePlaceholder.xaml"> - <Generator>MSBuild:Compile</Generator> + <Page Include="Resource\NotepadsSettingsViewStyle.xaml"> <SubType>Designer</SubType> - </Page> - <Page Include="Resource\CustomAppBarButtonStyle.xaml"> <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> </Page> - <Page Include="Resource\CustomNavigationViewStyle.xaml"> + <Page Include="Resource\NotepadsInAppNotificationStyle.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> - <Page Include="Resource\CustomRadioButtonStyle.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:Compile</Generator> - </Page> - <Page Include="Resource\CustomSliderStyle.xaml"> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - <Page Include="Resource\CustomToggleSwitchStyle.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:Compile</Generator> - </Page> - <Page Include="Resource\InAppNotificationNoDismissButton.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:Compile</Generator> - </Page> - <Page Include="Resource\CustomSplitViewStyle.xaml"> + <Page Include="Resource\NotepadsSplitViewStyle.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> @@ -412,19 +441,19 @@ <Version>1.7.0</Version> </PackageReference> <PackageReference Include="Microsoft.AppCenter.Analytics"> - <Version>4.2.0</Version> + <Version>4.3.0</Version> </PackageReference> <PackageReference Include="Microsoft.AppCenter.Crashes"> - <Version>4.2.0</Version> + <Version>4.3.0</Version> </PackageReference> <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> <Version>6.2.12</Version> </PackageReference> <PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls"> - <Version>7.0.1</Version> + <Version>7.0.2</Version> </PackageReference> <PackageReference Include="Microsoft.UI.Xaml"> - <Version>2.5.0</Version> + <Version>2.6.1</Version> </PackageReference> <PackageReference Include="Microsoft.Win32.Registry"> <Version>5.0.0</Version> @@ -440,17 +469,88 @@ </PackageReference> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\Notepads.Controls\Notepads.Controls.csproj"> - <Project>{7aa5e631-b663-420e-a08f-002cd81df855}</Project> - <Name>Notepads.Controls</Name> - </ProjectReference> - </ItemGroup> - <ItemGroup> - <PRIResource Include="Strings\**\*.resw" /> + <PRIResource Include="Strings\ar-YE\Manifest.resw" /> + <PRIResource Include="Strings\ar-YE\Resources.resw" /> + <PRIResource Include="Strings\ar-YE\Settings.resw" /> + <PRIResource Include="Strings\bg-BG\Manifest.resw" /> + <PRIResource Include="Strings\bg-BG\Resources.resw" /> + <PRIResource Include="Strings\bg-BG\Settings.resw" /> + <PRIResource Include="Strings\cs-CZ\Manifest.resw" /> + <PRIResource Include="Strings\cs-CZ\Resources.resw" /> + <PRIResource Include="Strings\cs-CZ\Settings.resw" /> + <PRIResource Include="Strings\de-CH\Manifest.resw" /> + <PRIResource Include="Strings\de-CH\Resources.resw" /> + <PRIResource Include="Strings\de-CH\Settings.resw" /> + <PRIResource Include="Strings\de-DE\Manifest.resw" /> + <PRIResource Include="Strings\de-DE\Resources.resw" /> + <PRIResource Include="Strings\de-DE\Settings.resw" /> + <PRIResource Include="Strings\en-US\Manifest.resw" /> + <PRIResource Include="Strings\en-US\Resources.resw"> + <SubType>Designer</SubType> + </PRIResource> + <PRIResource Include="Strings\en-US\Settings.resw" /> + <PRIResource Include="Strings\es-ES\Manifest.resw" /> + <PRIResource Include="Strings\es-ES\Resources.resw" /> + <PRIResource Include="Strings\es-ES\Settings.resw" /> + <PRIResource Include="Strings\fi-FI\Manifest.resw" /> + <PRIResource Include="Strings\fi-FI\Resources.resw" /> + <PRIResource Include="Strings\fi-FI\Settings.resw" /> + <PRIResource Include="Strings\fr-FR\Manifest.resw" /> + <PRIResource Include="Strings\fr-FR\Resources.resw" /> + <PRIResource Include="Strings\fr-FR\Settings.resw" /> + <PRIResource Include="Strings\hi-IN\Manifest.resw" /> + <PRIResource Include="Strings\hi-IN\Resources.resw" /> + <PRIResource Include="Strings\hi-IN\Settings.resw" /> + <PRIResource Include="Strings\hr-HR\Manifest.resw" /> + <PRIResource Include="Strings\hr-HR\Resources.resw" /> + <PRIResource Include="Strings\hr-HR\Settings.resw" /> + <PRIResource Include="Strings\hu-HU\Manifest.resw" /> + <PRIResource Include="Strings\hu-HU\Resources.resw" /> + <PRIResource Include="Strings\hu-HU\Settings.resw" /> + <PRIResource Include="Strings\it-IT\Manifest.resw" /> + <PRIResource Include="Strings\it-IT\Resources.resw" /> + <PRIResource Include="Strings\it-IT\Settings.resw" /> + <PRIResource Include="Strings\ja-JP\Manifest.resw" /> + <PRIResource Include="Strings\ja-JP\Resources.resw" /> + <PRIResource Include="Strings\ja-JP\Settings.resw" /> + <PRIResource Include="Strings\ka-GE\Manifest.resw" /> + <PRIResource Include="Strings\ka-GE\Resources.resw" /> + <PRIResource Include="Strings\ka-GE\Settings.resw" /> + <PRIResource Include="Strings\ko-KR\Manifest.resw" /> + <PRIResource Include="Strings\ko-KR\Resources.resw" /> + <PRIResource Include="Strings\ko-KR\Settings.resw" /> + <PRIResource Include="Strings\or-IN\Manifest.resw" /> + <PRIResource Include="Strings\or-IN\Resources.resw" /> + <PRIResource Include="Strings\or-IN\Settings.resw" /> + <PRIResource Include="Strings\pl-PL\Manifest.resw" /> + <PRIResource Include="Strings\pl-PL\Resources.resw" /> + <PRIResource Include="Strings\pl-PL\Settings.resw" /> + <PRIResource Include="Strings\pt-BR\Manifest.resw" /> + <PRIResource Include="Strings\pt-BR\Resources.resw" /> + <PRIResource Include="Strings\pt-BR\Settings.resw" /> + <PRIResource Include="Strings\pt-PT\Manifest.resw" /> + <PRIResource Include="Strings\pt-PT\Resources.resw" /> + <PRIResource Include="Strings\pt-PT\Settings.resw" /> + <PRIResource Include="Strings\ru-RU\Manifest.resw" /> + <PRIResource Include="Strings\ru-RU\Resources.resw" /> + <PRIResource Include="Strings\ru-RU\Settings.resw" /> + <PRIResource Include="Strings\tr-TR\Manifest.resw" /> + <PRIResource Include="Strings\tr-TR\Resources.resw" /> + <PRIResource Include="Strings\tr-TR\Settings.resw" /> + <PRIResource Include="Strings\uk-UA\Manifest.resw" /> + <PRIResource Include="Strings\uk-UA\Resources.resw" /> + <PRIResource Include="Strings\uk-UA\Settings.resw" /> + <PRIResource Include="Strings\zh-CN\Manifest.resw" /> + <PRIResource Include="Strings\zh-CN\Resources.resw" /> + <PRIResource Include="Strings\zh-CN\Settings.resw" /> + <PRIResource Include="Strings\zh-TW\Manifest.resw" /> + <PRIResource Include="Strings\zh-TW\Resources.resw" /> + <PRIResource Include="Strings\zh-TW\Settings.resw" /> </ItemGroup> <ItemGroup> <None Include="Package.targets" /> </ItemGroup> + <ItemGroup /> <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' "> <VisualStudioVersion>14.0</VisualStudioVersion> </PropertyGroup> diff --git a/src/Notepads/Resource/CustomAppBarButtonStyle.xaml b/src/Notepads/Resource/CustomAppBarButtonStyle.xaml deleted file mode 100644 index dfef6abe7..000000000 --- a/src/Notepads/Resource/CustomAppBarButtonStyle.xaml +++ /dev/null @@ -1,339 +0,0 @@ -<ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:Notepads"> - - <Style x:Key="CustomAppBarButtonLabelToRightStyle" TargetType="AppBarButton"> - <Setter Property="Background" Value="{ThemeResource AppBarButtonBackground}" /> - <Setter Property="Foreground" Value="{ThemeResource AppBarButtonForeground}" /> - <Setter Property="BorderBrush" Value="{ThemeResource AppBarButtonBorderBrush}" /> - <Setter Property="HorizontalAlignment" Value="Left" /> - <Setter Property="VerticalAlignment" Value="Top" /> - <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> - <Setter Property="FontWeight" Value="Normal" /> - <Setter Property="Width" Value="Auto" /> - <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> - <Setter Property="AllowFocusOnInteraction" Value="False" /> - <Setter Property="KeyboardAcceleratorPlacementMode" Value="Hidden" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="AppBarButton"> - <Grid - x:Name="Root" - MinWidth="{TemplateBinding MinWidth}" - MaxWidth="{TemplateBinding MaxWidth}" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="{TemplateBinding CornerRadius}"> - <Grid.Resources> - <Style x:Name="LabelOnRightStyle" TargetType="AppBarButton"> - <Setter Property="Width" Value="NaN" /> - </Style> - </Grid.Resources> - - <Rectangle - x:Name="AppBarButtonInnerBorder" - Stroke="{TemplateBinding BorderBrush}" - StrokeThickness="1" /> - <Grid x:Name="ContentRoot" MinHeight="{ThemeResource AppBarThemeCompactHeight}"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - - <Viewbox - x:Name="ContentViewbox" - Margin="{ThemeResource AppBarButtonContentViewboxMargin}" - HorizontalAlignment="Left" - AutomationProperties.AccessibilityView="Raw"> - <ContentPresenter - x:Name="Content" - Content="{TemplateBinding Icon}" - Foreground="{TemplateBinding Foreground}" /> - </Viewbox> - <TextBlock - x:Name="TextLabel" - Grid.Column="1" - Margin="{StaticResource AppBarButtonTextLabelOnRightMargin}" - HorizontalAlignment="Left" - VerticalAlignment="Center" - AutomationProperties.AccessibilityView="Raw" - FontFamily="{TemplateBinding FontFamily}" - FontSize="12" - Foreground="{TemplateBinding Foreground}" - Text="{TemplateBinding Label}" - TextAlignment="Center" - TextWrapping="Wrap" /> - <TextBlock - x:Name="OverflowTextLabel" - Margin="12,0,12,0" - Padding="{ThemeResource AppBarButtonOverflowTextLabelPadding}" - HorizontalAlignment="Stretch" - VerticalAlignment="Center" - AutomationProperties.AccessibilityView="Raw" - FontFamily="{TemplateBinding FontFamily}" - FontSize="{ThemeResource ControlContentThemeFontSize}" - Foreground="{TemplateBinding Foreground}" - Text="{TemplateBinding Label}" - TextAlignment="Left" - TextTrimming="Clip" - TextWrapping="NoWrap" - Visibility="Collapsed" /> - <TextBlock - x:Name="KeyboardAcceleratorTextLabel" - Grid.Column="2" - MinWidth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KeyboardAcceleratorTextMinWidth}" - Margin="0,0,10,5" - HorizontalAlignment="Right" - VerticalAlignment="Center" - AutomationProperties.AccessibilityView="Raw" - Foreground="{ThemeResource AppBarButtonKeyboardAcceleratorTextForeground}" - Style="{ThemeResource CaptionTextBlockStyle}" - Text="{TemplateBinding KeyboardAcceleratorTextOverride}" - Visibility="Visible" /> - <FontIcon - x:Name="SubItemChevron" - Grid.Column="2" - Margin="12,0,12,0" - AutomationProperties.AccessibilityView="Raw" - FontFamily="{ThemeResource SymbolThemeFontFamily}" - FontSize="12" - Foreground="{ThemeResource MenuFlyoutSubItemChevron}" - Glyph="" - MirroredWhenRightToLeft="True" - Visibility="Collapsed" /> - </Grid> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="ApplicationViewStates"> - <VisualState x:Name="FullSize" /> - <VisualState x:Name="Compact"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="LabelOnRight"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentViewbox" Storyboard.TargetProperty="Margin"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarButtonContentViewboxMargin}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="MinHeight"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarThemeCompactHeight}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="(Grid.Row)"> - <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="(Grid.Column)"> - <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="TextAlignment"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Left" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Margin"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarButtonTextLabelOnRightMargin}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="LabelCollapsed"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="MinHeight"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarThemeCompactHeight}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="Overflow"> - <VisualState.Setters> - <Setter Target="ContentRoot.MinHeight" Value="0" /> - <Setter Target="ContentViewbox.Visibility" Value="Collapsed" /> - <Setter Target="TextLabel.Visibility" Value="Collapsed" /> - <Setter Target="OverflowTextLabel.Visibility" Value="Visible" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="OverflowWithToggleButtons"> - <VisualState.Setters> - <Setter Target="ContentRoot.MinHeight" Value="0" /> - <Setter Target="ContentViewbox.Visibility" Value="Collapsed" /> - <Setter Target="TextLabel.Visibility" Value="Collapsed" /> - <Setter Target="OverflowTextLabel.Visibility" Value="Visible" /> - <Setter Target="OverflowTextLabel.Margin" Value="38,0,12,0" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="OverflowWithMenuIcons"> - <VisualState.Setters> - <Setter Target="ContentRoot.MinHeight" Value="0" /> - <Setter Target="ContentViewbox.HorizontalAlignment" Value="Left" /> - <Setter Target="ContentViewbox.VerticalAlignment" Value="Center" /> - <Setter Target="ContentViewbox.Width" Value="16" /> - <Setter Target="ContentViewbox.Height" Value="16" /> - <Setter Target="ContentViewbox.Margin" Value="12,0,12,0" /> - <Setter Target="TextLabel.Visibility" Value="Collapsed" /> - <Setter Target="OverflowTextLabel.Visibility" Value="Visible" /> - <Setter Target="OverflowTextLabel.Margin" Value="38,0,12,0" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="OverflowWithToggleButtonsAndMenuIcons"> - <VisualState.Setters> - <Setter Target="ContentRoot.MinHeight" Value="0" /> - <Setter Target="ContentViewbox.HorizontalAlignment" Value="Left" /> - <Setter Target="ContentViewbox.VerticalAlignment" Value="Center" /> - <Setter Target="ContentViewbox.Width" Value="16" /> - <Setter Target="ContentViewbox.Height" Value="16" /> - <Setter Target="ContentViewbox.Margin" Value="38,0,12,0" /> - <Setter Target="TextLabel.Visibility" Value="Collapsed" /> - <Setter Target="OverflowTextLabel.Visibility" Value="Visible" /> - <Setter Target="OverflowTextLabel.Margin" Value="76,0,12,0" /> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal"> - <Storyboard> - <PointerUpThemeAnimation Storyboard.TargetName="OverflowTextLabel" /> - </Storyboard> - </VisualState> - <VisualState x:Name="PointerOver"> - <VisualState.Setters> - <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundPointerOver}" /> - <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushPointerOver}" /> - <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushPointerOver}" /> - <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> - <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> - <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPointerOver}" /> - </VisualState.Setters> - - <Storyboard> - <PointerUpThemeAnimation Storyboard.TargetName="OverflowTextLabel" /> - </Storyboard> - </VisualState> - <VisualState x:Name="Pressed"> - <VisualState.Setters> - <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundPressed}" /> - <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushPressed}" /> - <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushPressed}" /> - <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> - <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> - <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPressed}" /> - </VisualState.Setters> - - <Storyboard> - <PointerDownThemeAnimation Storyboard.TargetName="OverflowTextLabel" /> - </Storyboard> - </VisualState> - <VisualState x:Name="Disabled"> - <VisualState.Setters> - <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundDisabled}" /> - <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushDisabled}" /> - <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushDisabled}" /> - <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundDisabled}" /> - <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundDisabled}" /> - <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundDisabled}" /> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundDisabled}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="OverflowNormal"> - - <Storyboard> - <PointerUpThemeAnimation Storyboard.TargetName="ContentRoot" /> - </Storyboard> - </VisualState> - <VisualState x:Name="OverflowPointerOver"> - <VisualState.Setters> - <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundPointerOver}" /> - <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushPointerOver}" /> - <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushPointerOver}" /> - <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> - <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> - <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPointerOver}" /> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPointerOver}" /> - <Setter Target="SubItemChevron.Foreground" Value="{ThemeResource AppBarButtonSubItemChevronForegroundPointerOver}" /> - </VisualState.Setters> - - <Storyboard> - <PointerUpThemeAnimation Storyboard.TargetName="ContentRoot" /> - </Storyboard> - </VisualState> - <VisualState x:Name="OverflowPressed"> - <VisualState.Setters> - <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundPressed}" /> - <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushPressed}" /> - <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushPressed}" /> - <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> - <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> - <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundPressed}" /> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundPressed}" /> - <Setter Target="SubItemChevron.Foreground" Value="{ThemeResource AppBarButtonSubItemChevronForegroundPressed}" /> - </VisualState.Setters> - - <Storyboard> - <PointerDownThemeAnimation Storyboard.TargetName="ContentRoot" /> - </Storyboard> - </VisualState> - <VisualState x:Name="OverflowSubMenuOpened"> - <VisualState.Setters> - <Setter Target="Root.Background" Value="{ThemeResource AppBarButtonBackgroundSubMenuOpened}" /> - <Setter Target="Root.BorderBrush" Value="{ThemeResource AppBarButtonBorderBrushSubMenuOpened}" /> - <Setter Target="AppBarButtonInnerBorder.Stroke" Value="{ThemeResource AppBarButtonBorderBrushSubMenuOpened}" /> - <Setter Target="Content.Foreground" Value="{ThemeResource AppBarButtonForegroundSubMenuOpened}" /> - <Setter Target="TextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundSubMenuOpened}" /> - <Setter Target="OverflowTextLabel.Foreground" Value="{ThemeResource AppBarButtonForegroundSubMenuOpened}" /> - <Setter Target="KeyboardAcceleratorTextLabel.Foreground" Value="{ThemeResource AppBarButtonKeyboardAcceleratorTextForegroundSubMenuOpened}" /> - <Setter Target="SubItemChevron.Foreground" Value="{ThemeResource AppBarButtonSubItemChevronForegroundSubMenuOpened}" /> - </VisualState.Setters> - - <Storyboard> - <PointerUpThemeAnimation Storyboard.TargetName="ContentRoot" /> - </Storyboard> - </VisualState> - </VisualStateGroup> - - <VisualStateGroup x:Name="InputModeStates"> - <VisualState x:Name="InputModeDefault" /> - <VisualState x:Name="TouchInputMode"> - <VisualState.Setters> - <Setter Target="OverflowTextLabel.Padding" Value="{ThemeResource AppBarButtonOverflowTextTouchMargin}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="GameControllerInputMode"> - <VisualState.Setters> - <Setter Target="OverflowTextLabel.Padding" Value="{ThemeResource AppBarButtonOverflowTextTouchMargin}" /> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - - <VisualStateGroup x:Name="KeyboardAcceleratorTextVisibility"> - <VisualState x:Name="KeyboardAcceleratorTextCollapsed" /> - <VisualState x:Name="KeyboardAcceleratorTextVisible"> - <VisualState.Setters> - <Setter Target="KeyboardAcceleratorTextLabel.Visibility" Value="Visible" /> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - - <VisualStateGroup x:Name="FlyoutStates"> - <VisualState x:Name="NoFlyout" /> - <VisualState x:Name="HasFlyout"> - <VisualState.Setters> - <Setter Target="SubItemChevron.Visibility" Value="Visible" /> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> -</ResourceDictionary> diff --git a/src/Notepads/Resource/CustomFlyoutItemStyle.xaml b/src/Notepads/Resource/CustomFlyoutItemStyle.xaml deleted file mode 100644 index 531b65dfc..000000000 --- a/src/Notepads/Resource/CustomFlyoutItemStyle.xaml +++ /dev/null @@ -1,425 +0,0 @@ -<ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:Notepads" - xmlns:media="using:Microsoft.UI.Xaml.Media"> - <Style BasedOn="{StaticResource CustomMenuFlyoutItemStyle}" TargetType="MenuFlyoutItem" /> - <Style BasedOn="{StaticResource CustomMenuFlyoutSubItemStyle}" TargetType="MenuFlyoutSubItem" /> - <Style BasedOn="{StaticResource CustomComboBoxItemStyle}" TargetType="ComboBoxItem" /> - - <Style x:Key="CustomMenuFlyoutItemStyle" TargetType="MenuFlyoutItem"> - <Setter Property="Background" Value="{ThemeResource MenuFlyoutItemRevealBackground}" /> - <Setter Property="BorderBrush" Value="{ThemeResource MenuFlyoutItemRevealBorderBrush}" /> - <Setter Property="BorderThickness" Value="{ThemeResource MenuFlyoutItemRevealBorderThickness}" /> - <Setter Property="Foreground" Value="{ThemeResource MenuFlyoutItemForeground}" /> - <Setter Property="Padding" Value="{ThemeResource MenuFlyoutItemThemePadding}" /> - <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> - <Setter Property="HorizontalContentAlignment" Value="Stretch" /> - <Setter Property="VerticalContentAlignment" Value="Center" /> - <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> - <Setter Property="KeyboardAcceleratorPlacementMode" Value="Hidden" /> - <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="MenuFlyoutItem"> - <Grid - x:Name="LayoutRoot" - Padding="{TemplateBinding Padding}" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="{TemplateBinding CornerRadius}"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> - - <Viewbox - x:Name="IconRoot" - Width="16" - Height="16" - HorizontalAlignment="Left" - VerticalAlignment="Center" - Visibility="Collapsed"> - <ContentPresenter x:Name="IconContent" Content="{TemplateBinding Icon}" /> - </Viewbox> - <TextBlock - x:Name="TextBlock" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - Foreground="{TemplateBinding Foreground}" - Text="{TemplateBinding Text}" - TextTrimming="Clip" /> - <TextBlock - x:Name="KeyboardAcceleratorTextBlock" - Grid.Column="1" - MinWidth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KeyboardAcceleratorTextMinWidth}" - Margin="24,0,0,0" - HorizontalAlignment="Right" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - AutomationProperties.AccessibilityView="Raw" - Foreground="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForeground}" - Style="{ThemeResource CaptionTextBlockStyle}" - Text="{TemplateBinding KeyboardAcceleratorTextOverride}" - Visibility="Collapsed" /> - - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal"> - <Storyboard> - <PointerUpThemeAnimation Storyboard.TargetName="LayoutRoot" /> - </Storyboard> - </VisualState> - <VisualState x:Name="PointerOver"> - <VisualState.Setters> - <Setter Target="LayoutRoot.(media:RevealBrush.State)" Value="PointerOver" /> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuFlyoutItemRevealBackgroundPointerOver}" /> - <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource MenuFlyoutItemRevealBorderBrushPointerOver}" /> - <Setter Target="IconContent.Foreground" Value="{ThemeResource MenuFlyoutItemForegroundPointerOver}" /> - <Setter Target="TextBlock.Foreground" Value="{ThemeResource MenuFlyoutItemForegroundPointerOver}" /> - <Setter Target="KeyboardAcceleratorTextBlock.Foreground" Value="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForegroundPointerOver}" /> - </VisualState.Setters> - <Storyboard> - <PointerUpThemeAnimation Storyboard.TargetName="LayoutRoot" /> - </Storyboard> - </VisualState> - <VisualState x:Name="Pressed"> - <VisualState.Setters> - <Setter Target="LayoutRoot.(media:RevealBrush.State)" Value="Pressed" /> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuFlyoutItemRevealBackgroundPressed}" /> - <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource MenuFlyoutItemRevealBorderBrushPressed}" /> - <Setter Target="IconContent.Foreground" Value="{ThemeResource MenuFlyoutItemForegroundPressed}" /> - <Setter Target="TextBlock.Foreground" Value="{ThemeResource MenuFlyoutItemForegroundPressed}" /> - <Setter Target="KeyboardAcceleratorTextBlock.Foreground" Value="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForegroundPressed}" /> - </VisualState.Setters> - <Storyboard> - <PointerDownThemeAnimation Storyboard.TargetName="LayoutRoot" /> - </Storyboard> - </VisualState> - <VisualState x:Name="Disabled"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuFlyoutItemRevealBackgroundDisabled}" /> - <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource MenuFlyoutItemRevealBorderBrushDisabled}" /> - <Setter Target="IconContent.Foreground" Value="{ThemeResource MenuFlyoutItemForegroundDisabled}" /> - <Setter Target="TextBlock.Foreground" Value="{ThemeResource MenuFlyoutItemForegroundDisabled}" /> - <Setter Target="KeyboardAcceleratorTextBlock.Foreground" Value="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForegroundDisabled}" /> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - - <VisualStateGroup x:Name="CheckPlaceholderStates"> - <VisualState x:Name="NoPlaceholder" /> - <VisualState x:Name="CheckPlaceholder"> - <VisualState.Setters> - <Setter Target="TextBlock.Margin" Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="IconPlaceholder"> - <VisualState.Setters> - <Setter Target="TextBlock.Margin" Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> - <Setter Target="IconRoot.Visibility" Value="Visible" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="CheckAndIconPlaceholder"> - <VisualState.Setters> - <Setter Target="TextBlock.Margin" Value="{ThemeResource MenuFlyoutItemDoublePlaceholderThemeThickness}" /> - <Setter Target="IconRoot.Margin" Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> - <Setter Target="IconRoot.Visibility" Value="Visible" /> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="PaddingSizeStates"> - <VisualState x:Name="DefaultPadding" /> - <VisualState x:Name="NarrowPadding"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Padding"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource MenuFlyoutItemThemePaddingNarrow}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="KeyboardAcceleratorTextVisibility"> - <VisualState x:Name="KeyboardAcceleratorTextCollapsed" /> - <VisualState x:Name="KeyboardAcceleratorTextVisible"> - <VisualState.Setters> - <Setter Target="KeyboardAcceleratorTextBlock.Visibility" Value="Visible" /> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - - <Style x:Key="CustomMenuFlyoutSubItemStyle" TargetType="MenuFlyoutSubItem"> - <Setter Property="Background" Value="{ThemeResource MenuFlyoutSubItemRevealBackground}" /> - <Setter Property="BorderBrush" Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrush}" /> - <Setter Property="BorderThickness" Value="{ThemeResource MenuFlyoutSubItemRevealBorderThickness}" /> - <Setter Property="Foreground" Value="{ThemeResource MenuFlyoutSubItemForeground}" /> - <Setter Property="Padding" Value="{ThemeResource MenuFlyoutItemThemePadding}" /> - <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> - <Setter Property="HorizontalContentAlignment" Value="Stretch" /> - <Setter Property="VerticalContentAlignment" Value="Center" /> - <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> - <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="MenuFlyoutSubItem"> - <Grid - x:Name="LayoutRoot" - Padding="{TemplateBinding Padding}" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="{TemplateBinding CornerRadius}"> - <Grid> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> - - <Viewbox - x:Name="IconRoot" - Grid.Column="0" - Width="16" - Height="16" - HorizontalAlignment="Left" - VerticalAlignment="Center" - Visibility="Collapsed"> - <ContentPresenter x:Name="IconContent" Content="{TemplateBinding Icon}" /> - </Viewbox> - <TextBlock - x:Name="TextBlock" - Grid.Column="0" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - Foreground="{TemplateBinding Foreground}" - Text="{TemplateBinding Text}" - TextTrimming="Clip" /> - <FontIcon - x:Name="SubItemChevron" - Grid.Column="1" - Margin="{ThemeResource MenuFlyoutItemChevronMargin}" - AutomationProperties.AccessibilityView="Raw" - FontFamily="{ThemeResource SymbolThemeFontFamily}" - FontSize="12" - Foreground="{ThemeResource MenuFlyoutSubItemChevron}" - Glyph="" - MirroredWhenRightToLeft="True" /> - </Grid> - - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal" /> - <VisualState x:Name="PointerOver"> - <VisualState.Setters> - <Setter Target="LayoutRoot.(media:RevealBrush.State)" Value="PointerOver" /> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuFlyoutSubItemRevealBackgroundPointerOver}" /> - <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrushPointerOver}" /> - <Setter Target="IconContent.Foreground" Value="{ThemeResource MenuFlyoutSubItemForegroundPointerOver}" /> - <Setter Target="TextBlock.Foreground" Value="{ThemeResource MenuFlyoutSubItemForegroundPointerOver}" /> - <Setter Target="SubItemChevron.Foreground" Value="{ThemeResource MenuFlyoutSubItemChevronPointerOver}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="Pressed"> - <VisualState.Setters> - <Setter Target="LayoutRoot.(media:RevealBrush.State)" Value="Pressed" /> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuFlyoutSubItemRevealBackgroundPressed}" /> - <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrushPressed}" /> - <Setter Target="IconContent.Foreground" Value="{ThemeResource MenuFlyoutSubItemForegroundPressed}" /> - <Setter Target="TextBlock.Foreground" Value="{ThemeResource MenuFlyoutSubItemForegroundPressed}" /> - <Setter Target="SubItemChevron.Foreground" Value="{ThemeResource MenuFlyoutSubItemChevronPressed}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="SubMenuOpened"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuFlyoutSubItemRevealBackgroundSubMenuOpened}" /> - <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrushSubMenuOpened}" /> - <Setter Target="IconContent.Foreground" Value="{ThemeResource MenuFlyoutSubItemForegroundSubMenuOpened}" /> - <Setter Target="TextBlock.Foreground" Value="{ThemeResource MenuFlyoutSubItemForegroundSubMenuOpened}" /> - <Setter Target="SubItemChevron.Foreground" Value="{ThemeResource MenuFlyoutSubItemChevronSubMenuOpened}" /> - </VisualState.Setters> - </VisualState> - - <VisualState x:Name="Disabled"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuFlyoutSubItemRevealBackgroundDisabled}" /> - <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource MenuFlyoutSubItemRevealBorderBrushDisabled}" /> - <Setter Target="IconContent.Foreground" Value="{ThemeResource MenuFlyoutSubItemForegroundDisabled}" /> - <Setter Target="TextBlock.Foreground" Value="{ThemeResource MenuFlyoutSubItemForegroundDisabled}" /> - <Setter Target="SubItemChevron.Foreground" Value="{ThemeResource MenuFlyoutSubItemChevronDisabled}" /> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - - <VisualStateGroup x:Name="CheckPlaceholderStates"> - <VisualState x:Name="NoPlaceholder" /> - <VisualState x:Name="CheckPlaceholder"> - <VisualState.Setters> - <Setter Target="TextBlock.Margin" Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="IconPlaceholder"> - <VisualState.Setters> - <Setter Target="TextBlock.Margin" Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> - <Setter Target="IconRoot.Visibility" Value="Visible" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="CheckAndIconPlaceholder"> - <VisualState.Setters> - <Setter Target="TextBlock.Margin" Value="{ThemeResource MenuFlyoutItemDoublePlaceholderThemeThickness}" /> - <Setter Target="IconRoot.Margin" Value="{ThemeResource MenuFlyoutItemPlaceholderThemeThickness}" /> - <Setter Target="IconRoot.Visibility" Value="Visible" /> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="PaddingSizeStates"> - <VisualState x:Name="DefaultPadding" /> - <VisualState x:Name="NarrowPadding"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Padding"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource MenuFlyoutItemThemePaddingNarrow}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - - <Style x:Key="CustomComboBoxItemStyle" TargetType="ComboBoxItem"> - <Setter Property="Foreground" Value="{ThemeResource ComboBoxItemForeground}" /> - <Setter Property="Background" Value="{ThemeResource ComboBoxItemRevealBackground}" /> - <Setter Property="BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrush}" /> - <Setter Property="BorderThickness" Value="{ThemeResource ComboBoxItemRevealBorderThemeThickness}" /> - <Setter Property="TabNavigation" Value="Local" /> - <Setter Property="Padding" Value="{ThemeResource ComboBoxItemRevealThemePadding}" /> - <Setter Property="HorizontalContentAlignment" Value="Stretch" /> - <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> - <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="ComboBoxItem"> - <Grid - x:Name="LayoutRoot" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - Control.IsTemplateFocusTarget="True" - CornerRadius="{TemplateBinding CornerRadius}"> - <ContentPresenter - x:Name="ContentPresenter" - Margin="{TemplateBinding Padding}" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - Content="{TemplateBinding Content}" - ContentTemplate="{TemplateBinding ContentTemplate}" - ContentTransitions="{TemplateBinding ContentTransitions}" - Foreground="{TemplateBinding Foreground}" /> - - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal"> - <Storyboard> - <PointerUpThemeAnimation Storyboard.TargetName="LayoutRoot" /> - </Storyboard> - </VisualState> - <VisualState x:Name="PointerOver"> - <VisualState.Setters> - <Setter Target="LayoutRoot.(media:RevealBrush.State)" Value="PointerOver" /> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource ComboBoxItemRevealBackgroundPointerOver}" /> - <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrushPointerOver}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundPointerOver}" /> - </VisualState.Setters> - <Storyboard> - <PointerUpThemeAnimation Storyboard.TargetName="LayoutRoot" /> - </Storyboard> - </VisualState> - <VisualState x:Name="Disabled"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource ComboBoxItemRevealBackgroundDisabled}" /> - <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrushDisabled}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundDisabled}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="Pressed"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource ComboBoxItemRevealBackgroundPressed}" /> - <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrushPressed}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundPressed}" /> - <Setter Target="LayoutRoot.(media:RevealBrush.State)" Value="Pressed" /> - </VisualState.Setters> - <Storyboard> - <PointerDownThemeAnimation Storyboard.TargetName="LayoutRoot" /> - </Storyboard> - </VisualState> - <VisualState x:Name="Selected"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource ComboBoxItemRevealBackgroundSelected}" /> - <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrushSelected}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundSelected}" /> - </VisualState.Setters> - <Storyboard> - <PointerUpThemeAnimation Storyboard.TargetName="LayoutRoot" /> - </Storyboard> - </VisualState> - <VisualState x:Name="SelectedUnfocused"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource ComboBoxItemRevealBackgroundSelectedUnfocused}" /> - <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrushSelectedUnfocused}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundSelectedUnfocused}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="SelectedDisabled"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource ComboBoxItemRevealBackgroundSelectedDisabled}" /> - <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrushSelectedDisabled}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundSelectedDisabled}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="SelectedPointerOver"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource ComboBoxItemRevealBackgroundSelectedPointerOver}" /> - <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrushSelectedPointerOver}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundSelectedPointerOver}" /> - <Setter Target="LayoutRoot.(media:RevealBrush.State)" Value="PointerOver" /> - </VisualState.Setters> - <Storyboard> - <PointerUpThemeAnimation Storyboard.TargetName="LayoutRoot" /> - </Storyboard> - </VisualState> - <VisualState x:Name="SelectedPressed"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource ComboBoxItemRevealBackgroundSelectedPressed}" /> - <Setter Target="LayoutRoot.BorderBrush" Value="{ThemeResource ComboBoxItemRevealBorderBrushSelectedPressed}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundSelectedPressed}" /> - <Setter Target="LayoutRoot.(media:RevealBrush.State)" Value="Pressed" /> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - - <VisualStateGroup x:Name="InputModeStates"> - <VisualState x:Name="InputModeDefault" /> - <VisualState x:Name="TouchInputMode"> - <VisualState.Setters> - <Setter Target="ContentPresenter.Margin" Value="{ThemeResource ComboBoxItemRevealThemeTouchPadding}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="GameControllerInputMode"> - <VisualState.Setters> - <Setter Target="ContentPresenter.Margin" Value="{ThemeResource ComboBoxItemRevealThemeGameControllerPadding}" /> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> -</ResourceDictionary> \ No newline at end of file diff --git a/src/Notepads/Resource/CustomNavigationViewStyle.xaml b/src/Notepads/Resource/CustomNavigationViewStyle.xaml deleted file mode 100644 index ebf03062b..000000000 --- a/src/Notepads/Resource/CustomNavigationViewStyle.xaml +++ /dev/null @@ -1,261 +0,0 @@ -<ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:Notepads" - xmlns:muxc="using:Microsoft.UI.Xaml.Controls" - xmlns:muxcp="using:Microsoft.UI.Xaml.Controls.Primitives"> - - <Style x:Key="PaneToggleButtonStyle" TargetType="Button"> - <Setter Property="FontSize" Value="16" /> - <Setter Property="FontFamily" Value="{StaticResource SymbolThemeFontFamily}" /> - <Setter Property="MinHeight" Value="{StaticResource PaneToggleButtonHeight}" /> - <Setter Property="MinWidth" Value="{StaticResource PaneToggleButtonWidth}" /> - <Setter Property="Padding" Value="0" /> - <Setter Property="HorizontalAlignment" Value="Center" /> - <Setter Property="VerticalAlignment" Value="Top" /> - <Setter Property="HorizontalContentAlignment" Value="Center" /> - <Setter Property="VerticalContentAlignment" Value="Center" /> - <Setter Property="Background" Value="{ThemeResource NavigationViewItemBackground}" /> - <Setter Property="Foreground" Value="{ThemeResource NavigationViewItemForeground}" /> - <Setter Property="BorderThickness" Value="{ThemeResource NavigationViewToggleBorderThickness}" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="Button"> - <Grid - x:Name="LayoutRoot" - Height="{TemplateBinding MinHeight}" - MinWidth="{TemplateBinding MinWidth}" - Margin="{TemplateBinding Padding}" - HorizontalAlignment="Stretch" - Background="{TemplateBinding Background}" - CornerRadius="{ThemeResource ControlCornerRadius}"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - <Grid.RowDefinitions> - <RowDefinition Height="{ThemeResource PaneToggleButtonHeight}" /> - </Grid.RowDefinitions> - - <Border Width="{TemplateBinding MinWidth}"> - <Viewbox - x:Name="IconHost" - Width="16" - Height="16" - HorizontalAlignment="Center" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - AutomationProperties.AccessibilityView="Raw"> - <TextBlock - x:Name="Icon" - AutomationProperties.AccessibilityView="Raw" - FontSize="{TemplateBinding FontSize}" - Text="" /> - </Viewbox> - </Border> - <ContentPresenter - x:Name="ContentPresenter" - Grid.Column="1" - VerticalContentAlignment="Center" - Content="{TemplateBinding Content}" - FontSize="{TemplateBinding FontSize}" /> - <Border - x:Name="RevealBorder" - Grid.ColumnSpan="2" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" /> - - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal" /> - <VisualState x:Name="PointerOver"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource NavigationViewButtonBackgroundPointerOver}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource NavigationViewButtonForegroundPointerOver}" /> - <Setter Target="Icon.Foreground" Value="{ThemeResource NavigationViewButtonForegroundPointerOver}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="Pressed"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource NavigationViewButtonBackgroundPressed}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource NavigationViewButtonForegroundPressed}" /> - <Setter Target="Icon.Foreground" Value="{ThemeResource NavigationViewButtonForegroundPressed}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="Disabled"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource NavigationViewButtonBackgroundDisabled}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource NavigationViewButtonForegroundDisabled}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="Checked"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource ToggleButtonBackgroundChecked}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ToggleButtonForegroundChecked}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="CheckedPointerOver"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource ToggleButtonBackgroundCheckedPointerOver}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ToggleButtonForegroundCheckedPointerOver}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="CheckedPressed"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource ToggleButtonBackgroundCheckedPressed}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ToggleButtonForegroundCheckedPressed}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="CheckedDisabled"> - <VisualState.Setters> - <Setter Target="LayoutRoot.Background" Value="{ThemeResource ToggleButtonBackgroundCheckedDisabled}" /> - <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ToggleButtonForegroundCheckedDisabled}" /> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - - <Style BasedOn="{StaticResource CustomNavigationViewItemStyle}" TargetType="muxc:NavigationViewItem" /> - - <Style x:Key="CustomNavigationViewItemStyle" TargetType="muxc:NavigationViewItem"> - <Setter Property="Foreground" Value="{ThemeResource NavigationViewItemForeground}" /> - <Setter Property="Background" Value="{ThemeResource NavigationViewItemBackground}" /> - <Setter Property="BorderBrush" Value="{ThemeResource NavigationViewItemBorderBrush}" /> - <Setter Property="BorderThickness" Value="{StaticResource NavigationViewItemBorderThickness}" /> - <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> - <Setter Property="FontWeight" Value="Normal" /> - <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> - <Setter Property="Margin" Value="{ThemeResource NavigationViewItemMargin}" /> - <Setter Property="UseSystemFocusVisuals" Value="True" /> - <Setter Property="HorizontalContentAlignment" Value="Stretch" /> - <Setter Property="TabNavigation" Value="Once" /> - <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="muxc:NavigationViewItem"> - <Grid x:Name="NVIRootGrid" CornerRadius="{TemplateBinding CornerRadius}"> - <Grid.RowDefinitions> - <RowDefinition Height="*" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - - <muxcp:NavigationViewItemPresenter - x:Name="NavigationViewItemPresenter" - Margin="{TemplateBinding Margin}" - Padding="{TemplateBinding Padding}" - HorizontalAlignment="{TemplateBinding HorizontalAlignment}" - VerticalAlignment="{TemplateBinding VerticalAlignment}" - HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - Content="{TemplateBinding Content}" - ContentTemplate="{TemplateBinding ContentTemplate}" - ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" - ContentTransitions="{TemplateBinding ContentTransitions}" - Control.IsTemplateFocusTarget="True" - CornerRadius="{TemplateBinding CornerRadius}" - Foreground="{TemplateBinding Foreground}" - Icon="{TemplateBinding Icon}" - IsTabStop="false" - UseSystemFocusVisuals="{TemplateBinding UseSystemFocusVisuals}" /> - <muxc:ItemsRepeater - x:Name="NavigationViewItemMenuItemsHost" - Grid.Row="1" - Visibility="Collapsed"> - <muxc:ItemsRepeater.Layout> - <muxc:StackLayout Orientation="Vertical" /> - </muxc:ItemsRepeater.Layout> - </muxc:ItemsRepeater> - <FlyoutBase.AttachedFlyout> - <Flyout x:Name="ChildrenFlyout" Placement="RightEdgeAlignedTop"> - <Flyout.FlyoutPresenterStyle> - <Style TargetType="FlyoutPresenter"> - <Setter Property="Padding" Value="{ThemeResource NavigationViewItemChildrenMenuFlyoutPadding}" /> - <!-- Set negative top margin to make the flyout align exactly with the button --> - <Setter Property="Margin" Value="0,-4,0,0" /> - <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto" /> - <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" /> - <Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto" /> - <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> - <Setter Property="ScrollViewer.ZoomMode" Value="Disabled" /> - <Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="FlyoutPresenter"> - <ScrollViewer - x:Name="ScrollViewer" - AutomationProperties.AccessibilityView="Raw" - HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" - HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" - VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" - VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" - ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"> - <ContentPresenter - x:Name="ContentPresenter" - Padding="{TemplateBinding Padding}" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - Content="{TemplateBinding Content}" - ContentTemplate="{TemplateBinding ContentTemplate}" - ContentTransitions="{TemplateBinding ContentTransitions}" - CornerRadius="{TemplateBinding CornerRadius}" /> - </ScrollViewer> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - </Flyout.FlyoutPresenterStyle> - <Grid x:Name="FlyoutRootGrid"> - <Grid x:Name="FlyoutContentGrid" /> - </Grid> - </Flyout> - </FlyoutBase.AttachedFlyout> - - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="ItemOnNavigationViewListPositionStates"> - <VisualState x:Name="OnLeftNavigation"> - <VisualState.Setters> - <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnLeftPane}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="OnLeftNavigationReveal"> - <VisualState.Setters> - <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnLeftPaneWithRevealFocus}" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="OnTopNavigationPrimary"> - <VisualState.Setters> - <Setter Target="NavigationViewItemPresenter.Margin" Value="{ThemeResource TopNavigationViewItemMargin}" /> - <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPane}" /> - <Setter Target="ChildrenFlyout.Placement" Value="BottomEdgeAlignedLeft" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="OnTopNavigationPrimaryReveal"> - <VisualState.Setters> - <Setter Target="NavigationViewItemPresenter.Margin" Value="{ThemeResource TopNavigationViewItemMargin}" /> - <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPaneWithRevealFocus}" /> - <Setter Target="ChildrenFlyout.Placement" Value="BottomEdgeAlignedLeft" /> - </VisualState.Setters> - </VisualState> - <VisualState x:Name="OnTopNavigationOverflow"> - <VisualState.Setters> - <Setter Target="NavigationViewItemPresenter.Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPaneOverflow}" /> - </VisualState.Setters> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> -</ResourceDictionary> diff --git a/src/Notepads/Resource/CustomRadioButtonStyle.xaml b/src/Notepads/Resource/CustomRadioButtonStyle.xaml deleted file mode 100644 index 745dd7427..000000000 --- a/src/Notepads/Resource/CustomRadioButtonStyle.xaml +++ /dev/null @@ -1,200 +0,0 @@ -<ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:Notepads"> - <Style BasedOn="{StaticResource CustomRadioButtonStyle}" TargetType="RadioButton" /> - - <Style x:Key="CustomRadioButtonStyle" TargetType="RadioButton"> - <Setter Property="Background" Value="{ThemeResource RadioButtonBackground}" /> - <Setter Property="Foreground" Value="{ThemeResource RadioButtonForeground}" /> - <Setter Property="BorderBrush" Value="{ThemeResource RadioButtonBorderBrush}" /> - <Setter Property="Padding" Value="8,6,0,0" /> - <Setter Property="HorizontalAlignment" Value="Left" /> - <Setter Property="VerticalAlignment" Value="Center" /> - <Setter Property="HorizontalContentAlignment" Value="Left" /> - <Setter Property="VerticalContentAlignment" Value="Top" /> - <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> - <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> - <Setter Property="MinWidth" Value="120" /> - <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> - <Setter Property="FocusVisualMargin" Value="-7,-3,-7,-3" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="RadioButton"> - <Grid - x:Name="RootGrid" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="{TemplateBinding CornerRadius}"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="20" /> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - - <Grid Height="32" VerticalAlignment="Top"> - <Ellipse - x:Name="OuterEllipse" - Width="20" - Height="20" - Fill="{StaticResource RadioButtonOuterEllipseFill}" - Stroke="{ThemeResource RadioButtonOuterEllipseStroke}" - StrokeThickness="{ThemeResource RadioButtonBorderThemeThickness}" - UseLayoutRounding="False" /> - <Ellipse - x:Name="CheckOuterEllipse" - Width="20" - Height="20" - Fill="{ThemeResource RadioButtonOuterEllipseCheckedFill}" - Opacity="0" - Stroke="{ThemeResource RadioButtonOuterEllipseCheckedStroke}" - StrokeThickness="{ThemeResource RadioButtonBorderThemeThickness}" - UseLayoutRounding="False" /> - <Ellipse - x:Name="CheckGlyph" - Width="8" - Height="8" - Fill="{ThemeResource RadioButtonCheckGlyphFill}" - Opacity="0" - Stroke="{ThemeResource RadioButtonCheckGlyphStroke}" - UseLayoutRounding="False" /> - </Grid> - <ContentPresenter - x:Name="ContentPresenter" - Grid.Column="1" - Margin="{TemplateBinding Padding}" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - AutomationProperties.AccessibilityView="Raw" - Content="{TemplateBinding Content}" - ContentTemplate="{TemplateBinding ContentTemplate}" - ContentTransitions="{TemplateBinding ContentTransitions}" - Foreground="{TemplateBinding Foreground}" - TextWrapping="Wrap" /> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal" /> - <VisualState x:Name="PointerOver"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonForegroundPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBackgroundPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBorderBrushPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterEllipse" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseStrokePointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterEllipse" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseFillPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckOuterEllipse" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseCheckedStrokePointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckOuterEllipse" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseCheckedFillPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphFillPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphStrokePointerOver}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="Pressed"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonForegroundPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBackgroundPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBorderBrushPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterEllipse" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseStrokePressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterEllipse" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseFillPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckOuterEllipse" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseCheckedStrokePressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckOuterEllipse" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseCheckedFillPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphFillPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphStrokePressed}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="Disabled"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonForegroundDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBackgroundDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonBorderBrushDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterEllipse" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseStrokeDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterEllipse" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseFillDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckOuterEllipse" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseCheckedStrokeDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckOuterEllipse" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonOuterEllipseCheckedFillDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphFillDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource RadioButtonCheckGlyphStrokeDisabled}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="CheckStates"> - <VisualState x:Name="Checked"> - <Storyboard> - <DoubleAnimation - Storyboard.TargetName="CheckGlyph" - Storyboard.TargetProperty="Opacity" - To="1" - Duration="0" /> - <DoubleAnimation - Storyboard.TargetName="OuterEllipse" - Storyboard.TargetProperty="Opacity" - To="0" - Duration="0" /> - <DoubleAnimation - Storyboard.TargetName="CheckOuterEllipse" - Storyboard.TargetProperty="Opacity" - To="1" - Duration="0" /> - </Storyboard> - </VisualState> - <VisualState x:Name="Unchecked" /> - <VisualState x:Name="Indeterminate" /> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> -</ResourceDictionary> diff --git a/src/Notepads/Resource/CustomSliderStyle.xaml b/src/Notepads/Resource/CustomSliderStyle.xaml deleted file mode 100644 index 335d8ca53..000000000 --- a/src/Notepads/Resource/CustomSliderStyle.xaml +++ /dev/null @@ -1,315 +0,0 @@ -<ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:Notepads"> - <Style BasedOn="{StaticResource CustomSliderStyle}" TargetType="Slider" /> - - <Style x:Key="CustomSliderStyle" TargetType="Slider"> - <Setter Property="Background" Value="{ThemeResource SliderTrackFill}" /> - <Setter Property="BorderThickness" Value="{ThemeResource SliderBorderThemeThickness}" /> - <Setter Property="Foreground" Value="{ThemeResource SliderTrackValueFill}" /> - <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> - <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> - <Setter Property="ManipulationMode" Value="None" /> - <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> - <Setter Property="FocusVisualMargin" Value="-7,0,-7,0" /> - <Setter Property="IsFocusEngagementEnabled" Value="True" /> - <!--<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />--> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="Slider"> - <Grid Margin="{TemplateBinding Padding}"> - <Grid.Resources> - <Style x:Key="SliderThumbStyle" TargetType="Thumb"> - <Setter Property="BorderThickness" Value="0" /> - <Setter Property="Background" Value="{ThemeResource SliderThumbBackground}" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="Thumb"> - <Border - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="{ThemeResource SliderThumbCornerRadius}" /> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - </Grid.Resources> - - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="*" /> - </Grid.RowDefinitions> - - <ContentPresenter - x:Name="HeaderContentPresenter" - Grid.Row="0" - Margin="{ThemeResource SliderTopHeaderMargin}" - x:DeferLoadStrategy="Lazy" - Content="{TemplateBinding Header}" - ContentTemplate="{TemplateBinding HeaderTemplate}" - FontWeight="{ThemeResource SliderHeaderThemeFontWeight}" - Foreground="{ThemeResource SliderHeaderForeground}" - TextWrapping="Wrap" - Visibility="Collapsed" /> - <Grid - x:Name="SliderContainer" - Grid.Row="1" - Background="{ThemeResource SliderContainerBackground}" - Control.IsTemplateFocusTarget="True"> - <Grid x:Name="HorizontalTemplate" MinHeight="{ThemeResource SliderHorizontalHeight}"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - <Grid.RowDefinitions> - <RowDefinition Height="{ThemeResource SliderPreContentMargin}" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="{ThemeResource SliderPostContentMargin}" /> - </Grid.RowDefinitions> - - <Rectangle - x:Name="HorizontalTrackRect" - Grid.Row="1" - Grid.ColumnSpan="3" - Height="{ThemeResource SliderTrackThemeHeight}" - Fill="{TemplateBinding Background}" - RadiusX="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter}}" - RadiusY="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter}}" /> - <Rectangle - x:Name="HorizontalDecreaseRect" - Grid.Row="1" - Fill="{TemplateBinding Foreground}" - RadiusX="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter}}" - RadiusY="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter}}" /> - <TickBar - x:Name="TopTickBar" - Grid.ColumnSpan="3" - Height="{ThemeResource SliderOutsideTickBarThemeHeight}" - Margin="0,0,0,4" - VerticalAlignment="Bottom" - Fill="{ThemeResource SliderTickBarFill}" - Visibility="Collapsed" /> - <TickBar - x:Name="HorizontalInlineTickBar" - Grid.Row="1" - Grid.ColumnSpan="3" - Height="{ThemeResource SliderTrackThemeHeight}" - Fill="{ThemeResource SliderInlineTickBarFill}" - Visibility="Collapsed" /> - <TickBar - x:Name="BottomTickBar" - Grid.Row="2" - Grid.ColumnSpan="3" - Height="{ThemeResource SliderOutsideTickBarThemeHeight}" - Margin="0,4,0,0" - VerticalAlignment="Top" - Fill="{ThemeResource SliderTickBarFill}" - Visibility="Collapsed" /> - <Thumb - x:Name="HorizontalThumb" - Grid.Row="0" - Grid.RowSpan="3" - Grid.Column="1" - Width="{ThemeResource SliderHorizontalThumbWidth}" - Height="{ThemeResource SliderHorizontalThumbHeight}" - AutomationProperties.AccessibilityView="Raw" - DataContext="{TemplateBinding Value}" - FocusVisualMargin="-14,-6,-14,-6" - Style="{StaticResource SliderThumbStyle}" /> - </Grid> - <Grid - x:Name="VerticalTemplate" - MinWidth="{ThemeResource SliderVerticalWidth}" - Visibility="Collapsed"> - <Grid.RowDefinitions> - <RowDefinition Height="*" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="{ThemeResource SliderPreContentMargin}" /> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="{ThemeResource SliderPostContentMargin}" /> - </Grid.ColumnDefinitions> - - <Rectangle - x:Name="VerticalTrackRect" - Grid.RowSpan="3" - Grid.Column="1" - Width="{ThemeResource SliderTrackThemeHeight}" - Fill="{TemplateBinding Background}" - RadiusX="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter}}" - RadiusY="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter}}" /> - <Rectangle - x:Name="VerticalDecreaseRect" - Grid.Row="2" - Grid.Column="1" - Fill="{TemplateBinding Foreground}" - RadiusX="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter}}" - RadiusY="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter}}" /> - <TickBar - x:Name="LeftTickBar" - Grid.RowSpan="3" - Width="{ThemeResource SliderOutsideTickBarThemeHeight}" - Margin="0,0,4,0" - HorizontalAlignment="Right" - Fill="{ThemeResource SliderTickBarFill}" - Visibility="Collapsed" /> - <TickBar - x:Name="VerticalInlineTickBar" - Grid.RowSpan="3" - Grid.Column="1" - Width="{ThemeResource SliderTrackThemeHeight}" - Fill="{ThemeResource SliderInlineTickBarFill}" - Visibility="Collapsed" /> - <TickBar - x:Name="RightTickBar" - Grid.RowSpan="3" - Grid.Column="2" - Width="{ThemeResource SliderOutsideTickBarThemeHeight}" - Margin="4,0,0,0" - HorizontalAlignment="Left" - Fill="{ThemeResource SliderTickBarFill}" - Visibility="Collapsed" /> - <Thumb - x:Name="VerticalThumb" - Grid.Row="1" - Grid.Column="0" - Grid.ColumnSpan="3" - Width="{ThemeResource SliderVerticalThumbWidth}" - Height="{ThemeResource SliderVerticalThumbHeight}" - AutomationProperties.AccessibilityView="Raw" - DataContext="{TemplateBinding Value}" - FocusVisualMargin="-6,-14,-6,-14" - Style="{StaticResource SliderThumbStyle}" /> - </Grid> - </Grid> - - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal" /> - <VisualState x:Name="Pressed"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderContainerBackgroundPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillPressed}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="Disabled"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderHeaderForegroundDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TopTickBar" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTickBarFillDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BottomTickBar" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTickBarFillDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LeftTickBar" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTickBarFillDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RightTickBar" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTickBarFillDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderContainerBackgroundDisabled}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="PointerOver"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderContainerBackgroundPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - - <VisualStateGroup x:Name="FocusEngagementStates"> - <VisualState x:Name="FocusDisengaged" /> - <VisualState x:Name="FocusEngagedHorizontal"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> - <DiscreteObjectKeyFrame KeyTime="0" Value="False" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> - <DiscreteObjectKeyFrame KeyTime="0" Value="True" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="FocusEngagedVertical"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> - <DiscreteObjectKeyFrame KeyTime="0" Value="False" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)"> - <DiscreteObjectKeyFrame KeyTime="0" Value="True" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> -</ResourceDictionary> diff --git a/src/Notepads/Resource/CustomToggleSwitchStyle.xaml b/src/Notepads/Resource/CustomToggleSwitchStyle.xaml deleted file mode 100644 index c3d5ce571..000000000 --- a/src/Notepads/Resource/CustomToggleSwitchStyle.xaml +++ /dev/null @@ -1,388 +0,0 @@ -<ResourceDictionary - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:Notepads"> - <Style BasedOn="{StaticResource CustomToggleSwitchStyle}" TargetType="ToggleSwitch" /> - - <Style x:Key="CustomToggleSwitchStyle" TargetType="ToggleSwitch"> - <Setter Property="Foreground" Value="{ThemeResource ToggleSwitchContentForeground}" /> - <Setter Property="HorizontalAlignment" Value="Left" /> - <Setter Property="VerticalAlignment" Value="Center" /> - <Setter Property="HorizontalContentAlignment" Value="Left" /> - <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> - <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> - <Setter Property="ManipulationMode" Value="System,TranslateX" /> - <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> - <Setter Property="FocusVisualMargin" Value="-7,-3,-7,-3" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="ToggleSwitch"> - <Grid - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="{TemplateBinding CornerRadius}"> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="*" /> - </Grid.RowDefinitions> - - <ContentPresenter - x:Name="HeaderContentPresenter" - Grid.Row="0" - Margin="{ThemeResource ToggleSwitchTopHeaderMargin}" - VerticalAlignment="Top" - x:DeferLoadStrategy="Lazy" - AutomationProperties.AccessibilityView="Raw" - Content="{TemplateBinding Header}" - ContentTemplate="{TemplateBinding HeaderTemplate}" - Foreground="{ThemeResource ToggleSwitchHeaderForeground}" - IsHitTestVisible="False" - TextWrapping="Wrap" - Visibility="Collapsed" /> - <Grid - Grid.Row="1" - MinWidth="{StaticResource ToggleSwitchThemeMinWidth}" - HorizontalAlignment="Left" - VerticalAlignment="Top"> - <Grid.RowDefinitions> - <RowDefinition Height="{ThemeResource ToggleSwitchPreContentMargin}" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="{ThemeResource ToggleSwitchPostContentMargin}" /> - </Grid.RowDefinitions> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="12" MaxWidth="12" /> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> - - <Grid - x:Name="SwitchAreaGrid" - Grid.RowSpan="3" - Grid.ColumnSpan="3" - Margin="0,5" - Background="{ThemeResource ToggleSwitchContainerBackground}" - Control.IsTemplateFocusTarget="True" /> - <ContentPresenter - x:Name="OffContentPresenter" - Grid.RowSpan="3" - Grid.Column="2" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - AutomationProperties.AccessibilityView="Raw" - Content="{TemplateBinding OffContent}" - ContentTemplate="{TemplateBinding OffContentTemplate}" - Foreground="{TemplateBinding Foreground}" - IsHitTestVisible="False" - Opacity="0" /> - <ContentPresenter - x:Name="OnContentPresenter" - Grid.RowSpan="3" - Grid.Column="2" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - AutomationProperties.AccessibilityView="Raw" - Content="{TemplateBinding OnContent}" - ContentTemplate="{TemplateBinding OnContentTemplate}" - Foreground="{TemplateBinding Foreground}" - IsHitTestVisible="False" - Opacity="0" /> - <Rectangle - x:Name="OuterBorder" - Grid.Row="1" - Width="40" - Height="20" - Fill="{ThemeResource ToggleSwitchFillOff}" - RadiusX="10" - RadiusY="10" - Stroke="{ThemeResource ToggleSwitchStrokeOff}" - StrokeThickness="{ThemeResource ToggleSwitchOuterBorderStrokeThickness}" /> - <Rectangle - x:Name="SwitchKnobBounds" - Grid.Row="1" - Width="40" - Height="20" - Fill="{ThemeResource ToggleSwitchFillOn}" - Opacity="0" - RadiusX="10" - RadiusY="10" - Stroke="{ThemeResource ToggleSwitchStrokeOn}" - StrokeThickness="{ThemeResource ToggleSwitchOnStrokeThickness}" /> - <Grid - x:Name="SwitchKnob" - Grid.Row="1" - Width="20" - Height="20" - HorizontalAlignment="Left"> - <Ellipse - x:Name="SwitchKnobOn" - Width="10" - Height="10" - Fill="{ThemeResource ToggleSwitchKnobFillOn}" - Opacity="0" /> - <Ellipse - x:Name="SwitchKnobOff" - Width="10" - Height="10" - Fill="{ThemeResource ToggleSwitchKnobFillOff}" /> - <Grid.RenderTransform> - <TranslateTransform x:Name="KnobTranslateTransform" /> - </Grid.RenderTransform> - </Grid> - <Thumb - x:Name="SwitchThumb" - Grid.RowSpan="3" - Grid.ColumnSpan="3" - AutomationProperties.AccessibilityView="Raw"> - <Thumb.Template> - <ControlTemplate TargetType="Thumb"> - <Rectangle Fill="Transparent" /> - </ControlTemplate> - </Thumb.Template> - </Thumb> - </Grid> - - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal" /> - <VisualState x:Name="PointerOver"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOffPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOffPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOffPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOnPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOnPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOnPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContainerBackgroundPointerOver}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="Pressed"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOffPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOffPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOnPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOnPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOffPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOnPressed}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContainerBackgroundPressed}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="Disabled"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchHeaderForegroundDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OffContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContentForegroundDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OnContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContentForegroundDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOffDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOffDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOnDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Stroke"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOnDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOffDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Fill"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchKnobFillOnDisabled}" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContainerBackgroundDisabled}" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - - <VisualStateGroup x:Name="ToggleStates"> - <VisualStateGroup.Transitions> - <VisualTransition - x:Name="DraggingToOnTransition" - GeneratedDuration="0" - From="Dragging" - To="On"> - <Storyboard> - <RepositionThemeAnimation FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobCurrentToOnOffset}" TargetName="SwitchKnob" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualTransition> - <VisualTransition - x:Name="OnToDraggingTransition" - GeneratedDuration="0" - From="On" - To="Dragging"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualTransition> - <VisualTransition - x:Name="DraggingToOffTransition" - GeneratedDuration="0" - From="Dragging" - To="Off"> - <Storyboard> - <RepositionThemeAnimation FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobCurrentToOffOffset}" TargetName="SwitchKnob" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualTransition> - <VisualTransition - x:Name="OnToOffTransition" - GeneratedDuration="0" - From="On" - To="Off"> - <Storyboard> - <RepositionThemeAnimation FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobOnToOffOffset}" TargetName="SwitchKnob" /> - </Storyboard> - </VisualTransition> - <VisualTransition - x:Name="OffToOnTransition" - GeneratedDuration="0" - From="Off" - To="On"> - <Storyboard> - <RepositionThemeAnimation FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobOffToOnOffset}" TargetName="SwitchKnob" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualTransition> - </VisualStateGroup.Transitions> - <VisualState x:Name="Dragging" /> - <VisualState x:Name="Off" /> - <VisualState x:Name="On"> - <Storyboard> - <DoubleAnimation - Storyboard.TargetName="KnobTranslateTransform" - Storyboard.TargetProperty="X" - To="20" - Duration="0" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="1" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff" Storyboard.TargetProperty="Opacity"> - <DiscreteObjectKeyFrame KeyTime="0" Value="0" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - - <VisualStateGroup x:Name="ContentStates"> - <VisualState x:Name="OffContent"> - <Storyboard> - <DoubleAnimation - Storyboard.TargetName="OffContentPresenter" - Storyboard.TargetProperty="Opacity" - To="1" - Duration="0" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OffContentPresenter" Storyboard.TargetProperty="IsHitTestVisible"> - <DiscreteObjectKeyFrame KeyTime="0"> - <DiscreteObjectKeyFrame.Value> - <x:Boolean>True</x:Boolean> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="OnContent"> - <Storyboard> - <DoubleAnimation - Storyboard.TargetName="OnContentPresenter" - Storyboard.TargetProperty="Opacity" - To="1" - Duration="0" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OnContentPresenter" Storyboard.TargetProperty="IsHitTestVisible"> - <DiscreteObjectKeyFrame KeyTime="0"> - <DiscreteObjectKeyFrame.Value> - <x:Boolean>True</x:Boolean> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> -</ResourceDictionary> \ No newline at end of file diff --git a/src/Notepads/Resource/DismissButtonStyle.xaml b/src/Notepads/Resource/DismissButtonStyle.xaml index 3679f5abc..0984afb04 100644 --- a/src/Notepads/Resource/DismissButtonStyle.xaml +++ b/src/Notepads/Resource/DismissButtonStyle.xaml @@ -1,71 +1,163 @@ <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:Notepads"> + xmlns:local="using:Notepads" + xmlns:muxc="using:Microsoft.UI.Xaml.Controls"> - <Style x:Key="DismissButtonStyle" TargetType="ButtonBase"> - <Setter Property="Background" Value="{ThemeResource HyperlinkButtonBackground}" /> - <Setter Property="Foreground" Value="{ThemeResource ApplicationForegroundThemeBrush}" /> - <Setter Property="Width" Value="40" /> - <Setter Property="Height" Value="40" /> - <Setter Property="UseSystemFocusVisuals" Value="True" /> - <Setter Property="HighContrastAdjustment" Value="None" /> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="Theme.xaml" /> + </ResourceDictionary.MergedDictionaries> + + <ResourceDictionary.ThemeDictionaries> + <ResourceDictionary x:Key="Light"> + <Thickness x:Key="DismissButtonBorderThemeThickness">0</Thickness> + + <StaticResource x:Key="DismissButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="DismissButtonBackgroundPointerOver" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="DismissButtonBackgroundPressed" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="DismissButtonBackgroundDisabled" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="DismissButtonForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="DismissButtonForegroundPointerOver" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="DismissButtonForegroundPressed" ResourceKey="TextFillColorTertiaryBrush" /> + <StaticResource x:Key="DismissButtonForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" /> + <StaticResource x:Key="DismissButtonBorderBrush" ResourceKey="ControlElevationBorderBrush" /> + <StaticResource x:Key="DismissButtonBorderBrushPointerOver" ResourceKey="ControlElevationBorderBrush" /> + <StaticResource x:Key="DismissButtonBorderBrushPressed" ResourceKey="ControlStrokeColorDefaultBrush" /> + <StaticResource x:Key="DismissButtonBorderBrushDisabled" ResourceKey="ControlStrokeColorDefaultBrush" /> + </ResourceDictionary> + + <ResourceDictionary x:Key="Dark"> + <Thickness x:Key="DismissButtonBorderThemeThickness">0</Thickness> + + <StaticResource x:Key="DismissButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="DismissButtonBackgroundPointerOver" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="DismissButtonBackgroundPressed" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="DismissButtonBackgroundDisabled" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="DismissButtonForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="DismissButtonForegroundPointerOver" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="DismissButtonForegroundPressed" ResourceKey="TextFillColorTertiaryBrush" /> + <StaticResource x:Key="DismissButtonForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" /> + <StaticResource x:Key="DismissButtonBorderBrush" ResourceKey="ControlElevationBorderBrush" /> + <StaticResource x:Key="DismissButtonBorderBrushPointerOver" ResourceKey="ControlElevationBorderBrush" /> + <StaticResource x:Key="DismissButtonBorderBrushPressed" ResourceKey="ControlStrokeColorDefaultBrush" /> + <StaticResource x:Key="DismissButtonBorderBrushDisabled" ResourceKey="ControlStrokeColorDefaultBrush" /> + </ResourceDictionary> + + <ResourceDictionary x:Key="HighContrast"> + <Thickness x:Key="DismissButtonBorderThemeThickness">1</Thickness> + + <StaticResource x:Key="DismissButtonBackground" ResourceKey="SystemControlBackgroundBaseLowBrush" /> + <StaticResource x:Key="DismissButtonBackgroundPointerOver" ResourceKey="SystemColorHighlightTextColorBrush" /> + <StaticResource x:Key="DismissButtonBackgroundPressed" ResourceKey="SystemColorHighlightTextColorBrush" /> + <StaticResource x:Key="DismissButtonBackgroundDisabled" ResourceKey="SystemControlBackgroundBaseLowBrush" /> + <StaticResource x:Key="DismissButtonForeground" ResourceKey="SystemColorButtonTextColorBrush" /> + <StaticResource x:Key="DismissButtonForegroundPointerOver" ResourceKey="SystemControlHighlightBaseHighBrush" /> + <StaticResource x:Key="DismissButtonForegroundPressed" ResourceKey="SystemControlHighlightBaseHighBrush" /> + <StaticResource x:Key="DismissButtonForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" /> + <StaticResource x:Key="DismissButtonBorderBrush" ResourceKey="SystemControlForegroundTransparentBrush" /> + <StaticResource x:Key="DismissButtonBorderBrushPointerOver" ResourceKey="SystemColorHighlightColorBrush" /> + <StaticResource x:Key="DismissButtonBorderBrushPressed" ResourceKey="SystemColorHighlightTextColorBrush" /> + <StaticResource x:Key="DismissButtonBorderBrushDisabled" ResourceKey="SystemControlDisabledTransparentBrush" /> + </ResourceDictionary> + </ResourceDictionary.ThemeDictionaries> + + <Thickness x:Key="ButtonPadding">11,5,11,6</Thickness> + + <Style x:Key="DismissButtonStyle" TargetType="Button"> + <Setter Property="Background" Value="{ThemeResource DismissButtonBackground}" /> + <Setter Property="BackgroundSizing" Value="InnerBorderEdge" /> + <Setter Property="Foreground" Value="{ThemeResource DismissButtonForeground}" /> + <Setter Property="BorderBrush" Value="{ThemeResource DismissButtonBorderBrush}" /> + <Setter Property="BorderThickness" Value="{ThemeResource DismissButtonBorderThemeThickness}" /> + <Setter Property="Padding" Value="{StaticResource ButtonPadding}" /> + <Setter Property="HorizontalAlignment" Value="Left" /> + <Setter Property="VerticalAlignment" Value="Center" /> + <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> + <Setter Property="FontWeight" Value="Normal" /> + <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> + <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> + <Setter Property="FocusVisualMargin" Value="-3" /> + <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> <Setter Property="Template"> <Setter.Value> - <ControlTemplate TargetType="ButtonBase"> - <Grid - x:Name="RootGrid" - Margin="{TemplateBinding Padding}" - Background="{TemplateBinding Background}"> - <Border - x:Name="TextBorder" - BorderBrush="Transparent" - BorderThickness="2"> - <ContentPresenter - x:Name="Text" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - Content="{TemplateBinding Content}" /> - </Border> + <ControlTemplate TargetType="Button"> + <ContentPresenter + x:Name="ContentPresenter" + Padding="{TemplateBinding Padding}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + muxc:AnimatedIcon.State="Normal" + AutomationProperties.AccessibilityView="Raw" + Background="{TemplateBinding Background}" + BackgroundSizing="{TemplateBinding BackgroundSizing}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Content="{TemplateBinding Content}" + ContentTemplate="{TemplateBinding ContentTemplate}" + ContentTransitions="{TemplateBinding ContentTransitions}" + CornerRadius="{TemplateBinding CornerRadius}"> + <ContentPresenter.BackgroundTransition> + <BrushTransition Duration="0:0:0.083" /> + </ContentPresenter.BackgroundTransition> + <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal" /> + <VisualState x:Name="PointerOver"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemListMediumColor}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource DismissButtonBackgroundPointerOver}" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource DismissButtonBorderBrushPointerOver}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource DismissButtonForegroundPointerOver}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> + <VisualState.Setters> + <Setter Target="ContentPresenter.(muxc:AnimatedIcon.State)" Value="PointerOver" /> + </VisualState.Setters> </VisualState> + <VisualState x:Name="Pressed"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemListMediumColor}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource DismissButtonBackgroundPressed}" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource DismissButtonBorderBrushPressed}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource DismissButtonForegroundPressed}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> + <VisualState.Setters> + <Setter Target="ContentPresenter.(muxc:AnimatedIcon.State)" Value="Pressed" /> + </VisualState.Setters> </VisualState> + <VisualState x:Name="Disabled"> <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource HyperlinkButtonForegroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource DismissButtonBackgroundDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource HyperlinkButtonBackgroundDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource DismissButtonBorderBrushDisabled}" /> </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource HyperlinkButtonBorderBrushDisabled}" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource DismissButtonForegroundDisabled}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> + <VisualState.Setters> + <!-- DisabledVisual Should be handled by the control, not the animated icon. --> + <Setter Target="ContentPresenter.(muxc:AnimatedIcon.State)" Value="Normal" /> + </VisualState.Setters> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> - </Grid> + </ContentPresenter> </ControlTemplate> </Setter.Value> </Setter> diff --git a/src/Notepads/Resource/NotepadsDialogStyle.xaml b/src/Notepads/Resource/NotepadsDialogStyle.xaml new file mode 100644 index 000000000..90599dfe4 --- /dev/null +++ b/src/Notepads/Resource/NotepadsDialogStyle.xaml @@ -0,0 +1,354 @@ +<ResourceDictionary + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:muxc="using:Microsoft.UI.Xaml.Controls"> + + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="Theme.xaml" /> + </ResourceDictionary.MergedDictionaries> + + <ResourceDictionary.ThemeDictionaries> + <ResourceDictionary x:Key="Light"> + <StaticResource x:Key="ContentDialogForeground" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="ContentDialogBackground" ResourceKey="SolidBackgroundFillColorBaseBrush" /> + <StaticResource x:Key="ContentDialogSmokeFill" ResourceKey="SmokeFillColorDefaultBrush" /> + <StaticResource x:Key="ContentDialogTopOverlay" ResourceKey="LayerFillColorAltBrush" /> + <StaticResource x:Key="ContentDialogBorderBrush" ResourceKey="SurfaceStrokeColorDefaultBrush" /> + <StaticResource x:Key="ContentDialogSeparatorBorderBrush" ResourceKey="CardStrokeColorDefaultBrush" /> + <Thickness x:Key="ContentDialogBorderWidth">1</Thickness> + + <x:Double x:Key="ContentDialogMinWidth">320</x:Double> + <x:Double x:Key="ContentDialogMaxWidth">548</x:Double> + <x:Double x:Key="ContentDialogMinHeight">184</x:Double> + <x:Double x:Key="ContentDialogMaxHeight">756</x:Double> + </ResourceDictionary> + <ResourceDictionary x:Key="Dark"> + <StaticResource x:Key="ContentDialogForeground" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="ContentDialogBackground" ResourceKey="SolidBackgroundFillColorBaseBrush" /> + <StaticResource x:Key="ContentDialogSmokeFill" ResourceKey="SmokeFillColorDefaultBrush" /> + <StaticResource x:Key="ContentDialogTopOverlay" ResourceKey="LayerFillColorAltBrush" /> + <StaticResource x:Key="ContentDialogBorderBrush" ResourceKey="SurfaceStrokeColorDefaultBrush" /> + <StaticResource x:Key="ContentDialogSeparatorBorderBrush" ResourceKey="CardStrokeColorDefaultBrush" /> + <Thickness x:Key="ContentDialogBorderWidth">1</Thickness> + + <x:Double x:Key="ContentDialogMinWidth">320</x:Double> + <x:Double x:Key="ContentDialogMaxWidth">548</x:Double> + <x:Double x:Key="ContentDialogMinHeight">184</x:Double> + <x:Double x:Key="ContentDialogMaxHeight">756</x:Double> + </ResourceDictionary> + <ResourceDictionary x:Key="HighContrast"> + <StaticResource x:Key="ContentDialogForeground" ResourceKey="SystemColorWindowTextColorBrush" /> + <StaticResource x:Key="ContentDialogBackground" ResourceKey="SystemColorWindowColorBrush" /> + <StaticResource x:Key="ContentDialogSmokeFill" ResourceKey="SystemColorWindowColorBrush" /> + <StaticResource x:Key="ContentDialogTopOverlay" ResourceKey="SystemControlTransparentBrush" /> + <StaticResource x:Key="ContentDialogBorderBrush" ResourceKey="SystemColorWindowTextColorBrush" /> + <StaticResource x:Key="ContentDialogSeparatorBorderBrush" ResourceKey="SystemColorWindowTextColorBrush" /> + <Thickness x:Key="ContentDialogBorderWidth">2</Thickness> + + <x:Double x:Key="ContentDialogMinWidth">320</x:Double> + <x:Double x:Key="ContentDialogMaxWidth">548</x:Double> + <x:Double x:Key="ContentDialogMinHeight">184</x:Double> + <x:Double x:Key="ContentDialogMaxHeight">756</x:Double> + </ResourceDictionary> + </ResourceDictionary.ThemeDictionaries> + + <GridLength x:Key="ContentDialogButtonSpacing">8</GridLength> + <Thickness x:Key="ContentDialogTitleMargin">0,0,0,12</Thickness> + <Thickness x:Key="ContentDialogPadding">24</Thickness> + <Thickness x:Key="ContentDialogSeparatorThickness">0,0,0,1</Thickness> + + <Style BasedOn="{StaticResource NotepadsDialogStyle}" TargetType="ContentDialog" /> + + <Style x:Key="NotepadsDialogStyle" TargetType="ContentDialog"> + <Setter Property="Foreground" Value="{ThemeResource ContentDialogForeground}" /> + <Setter Property="Background" Value="{ThemeResource ContentDialogBackground}" /> + <Setter Property="BorderThickness" Value="{ThemeResource ContentDialogBorderWidth}" /> + <Setter Property="BorderBrush" Value="{ThemeResource ContentDialogBorderBrush}" /> + <Setter Property="IsTabStop" Value="False" /> + <Setter Property="PrimaryButtonStyle" Value="{ThemeResource DefaultButtonStyle}" /> + <Setter Property="SecondaryButtonStyle" Value="{ThemeResource DefaultButtonStyle}" /> + <Setter Property="CloseButtonStyle" Value="{ThemeResource DefaultButtonStyle}" /> + <Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="ContentDialog"> + <Border x:Name="Container"> + <Grid x:Name="LayoutRoot"> + <Rectangle x:Name="SmokeLayerBackground" Fill="{ThemeResource ContentDialogSmokeFill}" /> + <Border + x:Name="BackgroundElement" + MinWidth="{ThemeResource ContentDialogMinWidth}" + MinHeight="{ThemeResource ContentDialogMinHeight}" + MaxWidth="{ThemeResource ContentDialogMaxWidth}" + MaxHeight="{ThemeResource ContentDialogMaxHeight}" + HorizontalAlignment="Center" + VerticalAlignment="Center" + Background="{TemplateBinding Background}" + BackgroundSizing="InnerBorderEdge" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{TemplateBinding CornerRadius}" + FlowDirection="{TemplateBinding FlowDirection}" + RenderTransformOrigin="0.5,0.5"> + <Border.RenderTransform> + <ScaleTransform x:Name="ScaleTransform" /> + </Border.RenderTransform> + <Grid x:Name="DialogSpace" CornerRadius="{ThemeResource OverlayCornerRadius}"> + <Grid.RowDefinitions> + <RowDefinition Height="*" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <ScrollViewer + x:Name="ContentScrollViewer" + HorizontalScrollBarVisibility="Disabled" + IsTabStop="False" + VerticalScrollBarVisibility="Disabled" + ZoomMode="Disabled"> + <Grid + Padding="{StaticResource ContentDialogPadding}" + Background="{ThemeResource ContentDialogTopOverlay}" + BorderBrush="{ThemeResource ContentDialogSeparatorBorderBrush}" + BorderThickness="{StaticResource ContentDialogSeparatorThickness}"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="*" /> + </Grid.RowDefinitions> + <ContentControl + x:Name="Title" + Margin="{StaticResource ContentDialogTitleMargin}" + HorizontalAlignment="Left" + VerticalAlignment="Top" + Content="{TemplateBinding Title}" + ContentTemplate="{TemplateBinding TitleTemplate}" + FontFamily="XamlAutoFontFamily" + FontSize="20" + FontWeight="SemiBold" + Foreground="{TemplateBinding Foreground}" + IsTabStop="False"> + <ContentControl.Template> + <ControlTemplate TargetType="ContentControl"> + <ContentPresenter + Margin="{TemplateBinding Padding}" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + Content="{TemplateBinding Content}" + ContentTemplate="{TemplateBinding ContentTemplate}" + ContentTransitions="{TemplateBinding ContentTransitions}" + MaxLines="2" + TextWrapping="Wrap" /> + </ControlTemplate> + </ContentControl.Template> + </ContentControl> + <ContentPresenter + x:Name="Content" + Grid.Row="1" + Content="{TemplateBinding Content}" + ContentTemplate="{TemplateBinding ContentTemplate}" + FontFamily="{StaticResource ContentControlThemeFontFamily}" + FontSize="{StaticResource ControlContentThemeFontSize}" + Foreground="{TemplateBinding Foreground}" + TextWrapping="Wrap" /> + </Grid> + </ScrollViewer> + <Grid + x:Name="CommandSpace" + Grid.Row="1" + Padding="{StaticResource ContentDialogPadding}" + HorizontalAlignment="Stretch" + VerticalAlignment="Bottom" + Background="{TemplateBinding Background}" + XYFocusKeyboardNavigation="Enabled"> + <Grid.ColumnDefinitions> + <ColumnDefinition x:Name="PrimaryColumn" Width="*" /> + <ColumnDefinition x:Name="FirstSpacer" Width="0" /> + <ColumnDefinition x:Name="SecondaryColumn" Width="0" /> + <ColumnDefinition x:Name="SecondSpacer" Width="{StaticResource ContentDialogButtonSpacing}" /> + <ColumnDefinition x:Name="CloseColumn" Width="*" /> + </Grid.ColumnDefinitions> + <Button + x:Name="PrimaryButton" + HorizontalAlignment="Stretch" + Content="{TemplateBinding PrimaryButtonText}" + ElementSoundMode="FocusOnly" + IsEnabled="{TemplateBinding IsPrimaryButtonEnabled}" + Style="{TemplateBinding PrimaryButtonStyle}" /> + <Button + x:Name="SecondaryButton" + HorizontalAlignment="Stretch" + Content="{TemplateBinding SecondaryButtonText}" + ElementSoundMode="FocusOnly" + IsEnabled="{TemplateBinding IsSecondaryButtonEnabled}" + Style="{TemplateBinding SecondaryButtonStyle}" /> + <Button + x:Name="CloseButton" + Grid.Column="4" + HorizontalAlignment="Stretch" + Content="{TemplateBinding CloseButtonText}" + ElementSoundMode="FocusOnly" + Style="{TemplateBinding CloseButtonStyle}" /> + </Grid> + </Grid> + </Border> + </Grid> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="DialogShowingStates"> + <VisualStateGroup.Transitions> + <VisualTransition To="DialogHidden"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="IsHitTestVisible"> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="False" /> + </ObjectAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ScaleTransform" Storyboard.TargetProperty="ScaleX"> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="1.0" /> + <SplineDoubleKeyFrame + KeySpline="{StaticResource ControlFastOutSlowInKeySpline}" + KeyTime="{StaticResource ControlFastAnimationDuration}" + Value="1.05" /> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ScaleTransform" Storyboard.TargetProperty="ScaleY"> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="1.0" /> + <SplineDoubleKeyFrame + KeySpline="{StaticResource ControlFastOutSlowInKeySpline}" + KeyTime="{StaticResource ControlFastAnimationDuration}" + Value="1.05" /> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Opacity"> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="1.0" /> + <LinearDoubleKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}" Value="0.0" /> + </DoubleAnimationUsingKeyFrames> + </Storyboard> + </VisualTransition> + <VisualTransition To="DialogShowing"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> + </ObjectAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ScaleTransform" Storyboard.TargetProperty="ScaleX"> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="1.05" /> + <SplineDoubleKeyFrame + KeySpline="{StaticResource ControlFastOutSlowInKeySpline}" + KeyTime="{StaticResource ControlNormalAnimationDuration}" + Value="1.0" /> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ScaleTransform" Storyboard.TargetProperty="ScaleY"> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="1.05" /> + <SplineDoubleKeyFrame + KeySpline="{StaticResource ControlFastOutSlowInKeySpline}" + KeyTime="{StaticResource ControlNormalAnimationDuration}" + Value="1.0" /> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Opacity"> + <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.0" /> + <LinearDoubleKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}" Value="1.0" /> + </DoubleAnimationUsingKeyFrames> + </Storyboard> + </VisualTransition> + </VisualStateGroup.Transitions> + <VisualState x:Name="DialogHidden" /> + <VisualState x:Name="DialogShowing"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Visibility" Value="Visible" /> + <Setter Target="BackgroundElement.TabFocusNavigation" Value="Cycle" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="DialogShowingWithoutSmokeLayer"> + <VisualState.Setters> + <Setter Target="LayoutRoot.Visibility" Value="Visible" /> + <Setter Target="LayoutRoot.Background" Value="{x:Null}" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + <VisualStateGroup x:Name="DialogSizingStates"> + <VisualState x:Name="DefaultDialogSizing" /> + <VisualState x:Name="FullDialogSizing"> + <VisualState.Setters> + <Setter Target="BackgroundElement.VerticalAlignment" Value="Stretch" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + <VisualStateGroup x:Name="ButtonsVisibilityStates"> + <VisualState x:Name="AllVisible"> + <VisualState.Setters> + <Setter Target="FirstSpacer.Width" Value="{StaticResource ContentDialogButtonSpacing}" /> + <Setter Target="SecondaryColumn.Width" Value="*" /> + <Setter Target="SecondaryButton.(Grid.Column)" Value="2" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="NoneVisible"> + <VisualState.Setters> + <Setter Target="CommandSpace.Visibility" Value="Collapsed" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="PrimaryVisible"> + <VisualState.Setters> + <Setter Target="PrimaryButton.(Grid.Column)" Value="4" /> + <Setter Target="SecondaryButton.Visibility" Value="Collapsed" /> + <Setter Target="CloseButton.Visibility" Value="Collapsed" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="SecondaryVisible"> + <VisualState.Setters> + <Setter Target="SecondaryButton.(Grid.Column)" Value="4" /> + <Setter Target="PrimaryButton.Visibility" Value="Collapsed" /> + <Setter Target="CloseButton.Visibility" Value="Collapsed" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="CloseVisible"> + <VisualState.Setters> + <Setter Target="PrimaryButton.Visibility" Value="Collapsed" /> + <Setter Target="SecondaryButton.Visibility" Value="Collapsed" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="PrimaryAndSecondaryVisible"> + <VisualState.Setters> + <Setter Target="SecondaryButton.(Grid.Column)" Value="4" /> + <Setter Target="CloseButton.Visibility" Value="Collapsed" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="PrimaryAndCloseVisible"> + <VisualState.Setters> + <Setter Target="SecondaryButton.Visibility" Value="Collapsed" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="SecondaryAndCloseVisible"> + <VisualState.Setters> + <Setter Target="PrimaryButton.Visibility" Value="Collapsed" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + <VisualStateGroup x:Name="DefaultButtonStates"> + <VisualState x:Name="NoDefaultButton" /> + <VisualState x:Name="PrimaryAsDefaultButton"> + <VisualState.Setters> + <Setter Target="PrimaryButton.Style" Value="{StaticResource AccentButtonStyle}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="SecondaryAsDefaultButton"> + <VisualState.Setters> + <Setter Target="SecondaryButton.Style" Value="{StaticResource AccentButtonStyle}" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="CloseAsDefaultButton"> + <VisualState.Setters> + <Setter Target="CloseButton.Style" Value="{StaticResource AccentButtonStyle}" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + <VisualStateGroup x:Name="DialogBorderStates"> + <VisualState x:Name="NoBorder" /> + <VisualState x:Name="AccentColorBorder"> + <VisualState.Setters> + <Setter Target="BackgroundElement.BorderBrush" Value="{ThemeResource SystemControlForegroundAccentBrush}" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> +</ResourceDictionary> \ No newline at end of file diff --git a/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml b/src/Notepads/Resource/NotepadsInAppNotificationStyle.xaml similarity index 83% rename from src/Notepads/Resource/InAppNotificationNoDismissButton.xaml rename to src/Notepads/Resource/NotepadsInAppNotificationStyle.xaml index 16fc593cb..174b292cb 100644 --- a/src/Notepads/Resource/InAppNotificationNoDismissButton.xaml +++ b/src/Notepads/Resource/NotepadsInAppNotificationStyle.xaml @@ -3,9 +3,29 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls"> - <Style x:Key="InAppNotificationNoDismissButton" TargetType="wctc:InAppNotification"> - <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeMediumBrush}" /> - <Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseLowBrush}" /> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="Theme.xaml" /> + </ResourceDictionary.MergedDictionaries> + + <Style x:Key="NotepadsInAppNotificationStyle" TargetType="wctc:InAppNotification"> + <Setter Property="HorizontalAlignment" Value="Stretch" /> + <Setter Property="VerticalAlignment" Value="Bottom" /> + <Setter Property="VerticalOffset" Value="100" /> + <Setter Property="HorizontalOffset" Value="0" /> + <Setter Property="RenderTransformOrigin" Value="0.5,1" /> + <Setter Property="Margin" Value="24,12" /> + <Setter Property="Padding" Value="24,12" /> + <Setter Property="MaxWidth" Value="960" /> + <Setter Property="MinWidth" Value="132" /> + <Setter Property="MinHeight" Value="55" /> + <Setter Property="Background" Value="{ThemeResource InAppNotificationBackgroundBrush}" /> + <Setter Property="Foreground" Value="{ThemeResource TextFillColorPrimary}" /> + <Setter Property="BorderBrush" Value="{ThemeResource InAppNotificationBorderBrush}" /> + <Setter Property="BorderThickness" Value="2" /> + <Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" /> + <Setter Property="FontSize" Value="16" /> + <Setter Property="AnimationDuration" Value="0:0:0.100" /> + <Setter Property="Visibility" Value="Collapsed" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate> @@ -23,7 +43,8 @@ <wctc:DropShadowPanel HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" - BlurRadius="8" + BlurRadius="20" + CornerRadius="{TemplateBinding CornerRadius}" OffsetX="0.3" OffsetY="0.3" ShadowOpacity="0.3"> @@ -32,7 +53,7 @@ Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="{ThemeResource OverlayCornerRadius}"> + CornerRadius="{TemplateBinding CornerRadius}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> diff --git a/src/Notepads/Resource/NotepadsInteractiveGridStyle.xaml b/src/Notepads/Resource/NotepadsInteractiveGridStyle.xaml new file mode 100644 index 000000000..56c249106 --- /dev/null +++ b/src/Notepads/Resource/NotepadsInteractiveGridStyle.xaml @@ -0,0 +1,102 @@ +<ResourceDictionary + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:Core="using:Microsoft.Xaml.Interactions.Core" + xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" + xmlns:utility="using:Notepads.Utilities" + xmlns:wctui="using:Microsoft.Toolkit.Uwp.UI"> + + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="Theme.xaml" /> + </ResourceDictionary.MergedDictionaries> + + <ResourceDictionary.ThemeDictionaries> + <ResourceDictionary x:Key="Light"> + <StaticResource x:Key="InteractiveGridBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="InteractiveGridBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" /> + <StaticResource x:Key="InteractiveGridBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" /> + <StaticResource x:Key="InteractiveGridBackgroundDisabled" ResourceKey="SubtleFillColorTransparentBrush" /> + </ResourceDictionary> + + <ResourceDictionary x:Key="Dark"> + <StaticResource x:Key="InteractiveGridBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="InteractiveGridBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" /> + <StaticResource x:Key="InteractiveGridBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" /> + <StaticResource x:Key="InteractiveGridBackgroundDisabled" ResourceKey="SubtleFillColorTransparentBrush" /> + </ResourceDictionary> + + <ResourceDictionary x:Key="HighContrast"> + <StaticResource x:Key="InteractiveGridBackground" ResourceKey="SystemControlBackgroundBaseLowBrush" /> + <StaticResource x:Key="InteractiveGridBackgroundPressed" ResourceKey="SystemControlHighlightChromeHighBrush" /> + <StaticResource x:Key="InteractiveGridBackgroundPointerOver" ResourceKey="SystemControlHighlightChromeHighBrush" /> + <StaticResource x:Key="InteractiveGridBackgroundDisabled" ResourceKey="SystemControlBackgroundBaseLowBrush" /> + </ResourceDictionary> + </ResourceDictionary.ThemeDictionaries> + + <Style x:Key="NotepadsInteractiveGridStyle" TargetType="Grid"> + <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> + <Setter Property="wctui:FrameworkElementExtensions.Cursor" Value="Hand" /> + <Setter Property="utility:BehaviorUtility.AttachedBehaviors"> + <Setter.Value> + <DataTemplate> + <Interactivity:BehaviorCollection> + <Core:EventTriggerBehavior EventName="PointerEntered"> + <Core:ChangePropertyAction PropertyName="Background" Value="{ThemeResource InteractiveGridBackgroundPointerOver}" /> + </Core:EventTriggerBehavior> + + <Core:EventTriggerBehavior EventName="PointerPressed"> + <Core:ChangePropertyAction PropertyName="Background" Value="{ThemeResource InteractiveGridBackgroundPressed}" /> + </Core:EventTriggerBehavior> + + <Core:EventTriggerBehavior EventName="PointerExited"> + <Core:ChangePropertyAction PropertyName="Background" Value="{ThemeResource InteractiveGridBackground}" /> + </Core:EventTriggerBehavior> + </Interactivity:BehaviorCollection> + </DataTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="NotepadsInteractiveLargeGridStyle" TargetType="Grid"> + <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> + <Setter Property="wctui:FrameworkElementExtensions.Cursor" Value="Hand" /> + <Setter Property="utility:BehaviorUtility.AttachedBehaviors"> + <Setter.Value> + <DataTemplate> + <Interactivity:BehaviorCollection> + <Core:EventTriggerBehavior EventName="PointerEntered"> + <Core:ChangePropertyAction PropertyName="Opacity" Value="0.7" /> + </Core:EventTriggerBehavior> + + <Core:EventTriggerBehavior EventName="PointerPressed"> + <Core:ChangePropertyAction PropertyName="Opacity" Value="0.5" /> + </Core:EventTriggerBehavior> + + <Core:EventTriggerBehavior EventName="PointerExited"> + <Core:ChangePropertyAction PropertyName="Opacity" Value="1" /> + </Core:EventTriggerBehavior> + </Interactivity:BehaviorCollection> + </DataTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="StatusBarTextBlockStyle" TargetType="TextBlock"> + <Setter Property="Height" Value="25" /> + <Setter Property="Padding" Value="8,4,8,4" /> + <Setter Property="HorizontalAlignment" Value="Left" /> + <Setter Property="FontSize" Value="11" /> + <Setter Property="FontWeight" Value="Normal" /> + <Setter Property="Opacity" Value="1.0" /> + <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseMediumHighBrush}" /> + </Style> + + <Style x:Key="StatusBarFlyoutStyle" TargetType="MenuFlyoutPresenter"> + <Setter Property="BorderThickness" Value="0" /> + </Style> + + <Style x:Key="MainMenuFlyoutStyle" TargetType="MenuFlyoutPresenter"> + <Setter Property="BorderThickness" Value="0" /> + <Setter Property="MaxWidth" Value="1200" /> + </Style> +</ResourceDictionary> diff --git a/src/Notepads/Resource/NotepadsSettingsViewStyle.xaml b/src/Notepads/Resource/NotepadsSettingsViewStyle.xaml new file mode 100644 index 000000000..a758b094e --- /dev/null +++ b/src/Notepads/Resource/NotepadsSettingsViewStyle.xaml @@ -0,0 +1,718 @@ +<ResourceDictionary + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="using:Notepads" + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" + xmlns:muxcp="using:Microsoft.UI.Xaml.Controls.Primitives"> + + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="Theme.xaml" /> + </ResourceDictionary.MergedDictionaries> + + <Style + x:Key="CompactSubtitleTextBlockStyle" + BasedOn="{StaticResource SubtitleTextBlockStyle}" + TargetType="TextBlock"> + <Setter Property="FontSize" Value="18" /> + </Style> + + <Style + x:Key="DescriptionTextBlockStyle" + BasedOn="{StaticResource CaptionTextBlockStyle}" + TargetType="TextBlock"> + <Setter Property="Foreground" Value="{ThemeResource SystemBaseMediumHighColor}" /> + </Style> + + <Style BasedOn="{StaticResource NotepadsSettingsViewStyle}" TargetType="muxc:NavigationView" /> + + <Style x:Key="NotepadsSettingsViewStyle" TargetType="muxc:NavigationView"> + <Setter Property="PaneToggleButtonStyle" Value="{StaticResource PaneToggleButtonStyle}" /> + <Setter Property="IsTabStop" Value="False" /> + <Setter Property="CompactPaneLength" Value="{ThemeResource NavigationViewCompactPaneLength}" /> + <Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="muxc:NavigationView"> + <Grid x:Name="RootGrid"> + <!-- Button grid --> + <Grid + x:Name="PaneToggleButtonGrid" + HorizontalAlignment="Left" + VerticalAlignment="Top" + Canvas.ZIndex="100"> + + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + + <Grid x:Name="TogglePaneTopPadding" Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPadding}" /> + + <Grid + x:Name="ButtonHolderGrid" + Grid.Row="1" + Margin="{ThemeResource NavigationViewButtonHolderGridMargin}"> + <Button + x:Name="NavigationViewBackButton" + Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.SmallerPaneToggleButtonWidth}" + VerticalAlignment="Top" + IsEnabled="{TemplateBinding IsBackEnabled}" + Style="{StaticResource NavigationBackButtonNormalStyle}" + Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.BackButtonVisibility}"> + <ToolTipService.ToolTip> + <ToolTip x:Name="NavigationViewBackButtonToolTip" /> + </ToolTipService.ToolTip> + </Button> + <Button + x:Name="NavigationViewCloseButton" + VerticalAlignment="Top" + Style="{StaticResource NavigationBackButtonNormalStyle}"> + <ToolTipService.ToolTip> + <ToolTip x:Name="NavigationViewCloseButtonToolTip" /> + </ToolTipService.ToolTip> + </Button> + <Button + x:Name="TogglePaneButton" + MinWidth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.SmallerPaneToggleButtonWidth}" + HorizontalAlignment="Center" + VerticalAlignment="Top" + AutomationProperties.LandmarkType="Navigation" + FocusVisualMargin="0" + Style="{TemplateBinding PaneToggleButtonStyle}" + Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneToggleButtonVisibility}"> + <TextBlock + x:Name="PaneTitleTextBlock" + Grid.Column="0" + Margin="0,-2,0,0" + HorizontalAlignment="Left" + VerticalAlignment="Center" + Style="{StaticResource NavigationViewItemHeaderTextStyle}" + Text="{TemplateBinding PaneTitle}" /> + </Button> + + <Grid + x:Name="PaneTitleHolder" + Height="40" + Visibility="Collapsed"> + <ContentControl + x:Name="PaneTitlePresenter" + Margin="{ThemeResource NavigationViewPaneTitlePresenterMargin}" + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch" + IsTabStop="False" /> + </Grid> + </Grid> + </Grid> + + <!-- Content layouts --> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="*" /> + </Grid.RowDefinitions> + + <!-- DisplayMode top --> + <StackPanel + x:Name="TopNavArea" + Grid.Row="0" + HorizontalAlignment="Stretch" + VerticalAlignment="Top" + Background="{ThemeResource NavigationViewTopPaneBackground}" + Canvas.ZIndex="1" + XYFocusKeyboardNavigation="Enabled"> + + <Grid + x:Name="TopNavTopPadding" + Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPadding}" + Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPaneVisibility}" /> + + <Grid + x:Name="TopNavGrid" + Height="{ThemeResource NavigationViewTopPaneHeight}" + Margin="{ThemeResource TopNavigationViewTopNavGridMargin}" + BorderBrush="{ThemeResource NavigationViewItemSeparatorForeground}" + Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPaneVisibility}"> + <Grid.ColumnDefinitions> + <ColumnDefinition x:Name="BackButtonPlaceholderOnTopNav" Width="{ThemeResource NavigationBackButtonWidth}" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*" MinWidth="{ThemeResource TopNavigationViewPaneCustomContentMinWidth}" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + + <Grid + x:Name="TopNavLeftPadding" + Grid.Column="1" + Width="0" /> + + <ContentControl + x:Name="PaneHeaderOnTopPane" + Grid.Column="2" + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch" + IsTabStop="False" /> + + <ContentControl + x:Name="PaneTitleOnTopPane" + Grid.Column="2" + Margin="{ThemeResource NavigationViewItemInnerHeaderMargin}" + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch" + IsTabStop="False" /> + + <!-- Top nav ItemsRepeater --> + <muxc:ItemsRepeaterScrollHost Grid.Column="3"> + <ScrollViewer + HorizontalScrollBarVisibility="Hidden" + HorizontalScrollMode="Disabled" + VerticalScrollBarVisibility="Hidden" + VerticalScrollMode="Disabled"> + <muxc:ItemsRepeater + x:Name="TopNavMenuItemsHost" + AutomationProperties.AccessibilityView="Content" + AutomationProperties.LandmarkType="Navigation" + AutomationProperties.Name="{TemplateBinding AutomationProperties.Name}"> + <muxc:ItemsRepeater.Layout> + <muxc:StackLayout Orientation="Horizontal" /> + </muxc:ItemsRepeater.Layout> + </muxc:ItemsRepeater> + </ScrollViewer> + </muxc:ItemsRepeaterScrollHost> + + <Button + x:Name="TopNavOverflowButton" + Grid.Column="4" + Margin="{ThemeResource TopNavigationViewOverflowButtonMargin}" + Content="More" + Style="{StaticResource NavigationViewOverflowButtonStyleWhenPaneOnTop}" + Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.OverflowButtonVisibility}"> + + <Button.Flyout> + <Flyout ElementSoundMode="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ElementSoundMode}" Placement="BottomEdgeAlignedRight"> + <Flyout.FlyoutPresenterStyle> + <Style TargetType="FlyoutPresenter"> + <Setter Property="Padding" Value="{ThemeResource TopNavigationViewOverflowMenuPadding}" /> + <!-- Set negative top margin to make the flyout align exactly with the button --> + <Setter Property="Margin" Value="0,-4,0,0" /> + <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto" /> + <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" /> + <Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto" /> + <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> + <Setter Property="ScrollViewer.ZoomMode" Value="Disabled" /> + <Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="FlyoutPresenter"> + <ScrollViewer + x:Name="ScrollViewer" + AutomationProperties.AccessibilityView="Raw" + HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" + HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" + VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" + VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" + ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"> + <ContentPresenter + x:Name="ContentPresenter" + Padding="{TemplateBinding Padding}" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Content="{TemplateBinding Content}" + ContentTemplate="{TemplateBinding ContentTemplate}" + ContentTransitions="{TemplateBinding ContentTransitions}" + CornerRadius="{TemplateBinding CornerRadius}" /> + </ScrollViewer> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + </Flyout.FlyoutPresenterStyle> + <muxc:ItemsRepeaterScrollHost> + <ScrollViewer VerticalScrollBarVisibility="Auto"> + <muxc:ItemsRepeater x:Name="TopNavMenuItemsOverflowHost" AutomationProperties.AccessibilityView="Content"> + <muxc:ItemsRepeater.Layout> + <muxc:StackLayout /> + </muxc:ItemsRepeater.Layout> + </muxc:ItemsRepeater> + </ScrollViewer> + </muxc:ItemsRepeaterScrollHost> + </Flyout> + </Button.Flyout> + </Button> + + <ContentControl + x:Name="PaneCustomContentOnTopPane" + Grid.Column="5" + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch" + IsTabStop="False" /> + + <Grid + x:Name="TopPaneAutoSuggestArea" + Grid.Column="6" + Height="{ThemeResource NavigationViewTopPaneHeight}"> + + <ContentControl + x:Name="TopPaneAutoSuggestBoxPresenter" + MinWidth="216" + Margin="{ThemeResource TopNavigationViewAutoSuggestBoxMargin}" + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Center" + IsTabStop="False" /> + </Grid> + + <ContentControl + x:Name="PaneFooterOnTopPane" + Grid.Column="7" + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch" + IsTabStop="False" /> + <!-- Top footer menu ItemsRepeater --> + <muxc:ItemsRepeater + x:Name="TopFooterMenuItemsHost" + Grid.Column="8" + AutomationProperties.AccessibilityView="Content" + AutomationProperties.LandmarkType="Navigation"> + <muxc:ItemsRepeater.Layout> + <muxc:StackLayout Orientation="Horizontal" /> + </muxc:ItemsRepeater.Layout> + </muxc:ItemsRepeater> + + </Grid> + <Border x:Name="TopNavContentOverlayAreaGrid" Child="{TemplateBinding ContentOverlay}" /> + </StackPanel> + + <!-- Displaymode (compact/minimal/normal) left --> + <SplitView + x:Name="RootSplitView" + Grid.Row="1" + Background="{TemplateBinding Background}" + BorderBrush="{ThemeResource NavigationViewItemSeparatorForeground}" + BorderThickness="{ThemeResource NavigationViewBorderThickness}" + CompactPaneLength="{TemplateBinding CompactPaneLength}" + CornerRadius="{ThemeResource OverlayCornerRadius}" + DisplayMode="Inline" + IsPaneOpen="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsPaneOpen, Mode=TwoWay}" + IsTabStop="False" + OpenPaneLength="{TemplateBinding OpenPaneLength}" + PaneBackground="{ThemeResource NavigationViewDefaultPaneBackground}"> + + <SplitView.Pane> + <Grid + x:Name="PaneContentGrid" + Margin="{ThemeResource NavigationViewPaneContentGridMargin}" + HorizontalAlignment="Left" + BorderBrush="{ThemeResource NavigationViewItemSeparatorForeground}" + Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.LeftPaneVisibility}"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="0" /> + <!-- above button margin + back button space --> + <RowDefinition x:Name="PaneContentGridToggleButtonRow" Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="0" /> + <!-- above list margin --> + <RowDefinition x:Name="ItemsContainerRow" Height="*" /> + </Grid.RowDefinitions> + + <Grid x:Name="ContentPaneTopPadding" Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPadding}" /> + + <Grid Grid.Row="2"> + <Grid.RowDefinitions> + <RowDefinition x:Name="PaneHeaderContentBorderRow" /> + </Grid.RowDefinitions> + + <Grid.ColumnDefinitions> + <ColumnDefinition x:Name="PaneHeaderCloseButtonColumn" /> + <ColumnDefinition x:Name="PaneHeaderToggleButtonColumn" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + + <ContentControl + x:Name="PaneHeaderContentBorder" + Grid.Column="2" + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch" + IsTabStop="False" /> + </Grid> + + <Grid + x:Name="AutoSuggestArea" + Grid.Row="3" + Height="{ThemeResource NavigationViewAutoSuggestAreaHeight}" + Margin="0,0,0,8" + VerticalAlignment="Center"> + + <ContentControl + x:Name="PaneAutoSuggestBoxPresenter" + Margin="{ThemeResource NavigationViewAutoSuggestBoxMargin}" + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Center" + IsTabStop="False" /> + + <Button + x:Name="PaneAutoSuggestButton" + Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.SmallerPaneToggleButtonWidth}" + Style="{ThemeResource NavigationViewPaneSearchButtonStyle}" + Visibility="Collapsed"> + <Button.Resources> + <ResourceDictionary> + <ResourceDictionary.ThemeDictionaries> + <ResourceDictionary x:Key="Default"> + <StaticResource x:Key="ButtonBackgroundPointerOver" ResourceKey="NavigationViewItemBackgroundPointerOver" /> + <StaticResource x:Key="ButtonBackgroundPressed" ResourceKey="NavigationViewItemBackgroundPressed" /> + <StaticResource x:Key="ButtonBackgroundDisabled" ResourceKey="NavigationViewItemBackgroundDisabled" /> + <StaticResource x:Key="ButtonForegroundPointerOver" ResourceKey="NavigationViewItemForegroundPointerOver" /> + <StaticResource x:Key="ButtonForegroundPressed" ResourceKey="NavigationViewItemForegroundPressed" /> + <StaticResource x:Key="ButtonForegroundDisabled" ResourceKey="NavigationViewItemForegroundDisabled" /> + <StaticResource x:Key="ButtonBorderBrushPointerOver" ResourceKey="NavigationViewItemBorderBrushPointerOver" /> + <StaticResource x:Key="ButtonBorderBrushPressed" ResourceKey="NavigationViewItemBorderBrushPressed" /> + <StaticResource x:Key="ButtonBorderBrushDisabled" ResourceKey="NavigationViewItemBorderBrushDisabled" /> + </ResourceDictionary> + <ResourceDictionary x:Key="Light"> + <StaticResource x:Key="ButtonBackgroundPointerOver" ResourceKey="NavigationViewItemBackgroundPointerOver" /> + <StaticResource x:Key="ButtonBackgroundPressed" ResourceKey="NavigationViewItemBackgroundPressed" /> + <StaticResource x:Key="ButtonBackgroundDisabled" ResourceKey="NavigationViewItemBackgroundDisabled" /> + <StaticResource x:Key="ButtonForegroundPointerOver" ResourceKey="NavigationViewItemForegroundPointerOver" /> + <StaticResource x:Key="ButtonForegroundPressed" ResourceKey="NavigationViewItemForegroundPressed" /> + <StaticResource x:Key="ButtonForegroundDisabled" ResourceKey="NavigationViewItemForegroundDisabled" /> + <StaticResource x:Key="ButtonBorderBrushPointerOver" ResourceKey="NavigationViewItemBorderBrushPointerOver" /> + <StaticResource x:Key="ButtonBorderBrushPressed" ResourceKey="NavigationViewItemBorderBrushPressed" /> + <StaticResource x:Key="ButtonBorderBrushDisabled" ResourceKey="NavigationViewItemBorderBrushDisabled" /> + </ResourceDictionary> + </ResourceDictionary.ThemeDictionaries> + </ResourceDictionary> + </Button.Resources> + </Button> + </Grid> + + <ContentControl + x:Name="PaneCustomContentBorder" + Grid.Row="4" + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch" + IsTabStop="False" /> + + <!-- "Non header" content --> + <Grid x:Name="ItemsContainerGrid" Grid.Row="6"> + <Grid.RowDefinitions> + <RowDefinition Height="*" /> + <!-- MenuItems --> + <RowDefinition Height="Auto" /> + <!-- Separator if overflow --> + <RowDefinition Height="Auto" /> + <!-- PaneFooter --> + <RowDefinition Height="Auto" /> + <!-- FooterItems --> + </Grid.RowDefinitions> + + <!-- MenuItems --> + <muxc:ItemsRepeaterScrollHost HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> + <ScrollViewer + x:Name="MenuItemsScrollViewer" + TabNavigation="Local" + VerticalScrollBarVisibility="Auto"> + <!-- Left nav ItemsRepeater --> + <muxc:ItemsRepeater + x:Name="MenuItemsHost" + AutomationProperties.AccessibilityView="Content" + AutomationProperties.Name="{TemplateBinding AutomationProperties.Name}"> + <muxc:ItemsRepeater.Layout> + <muxc:StackLayout /> + </muxc:ItemsRepeater.Layout> + </muxc:ItemsRepeater> + </ScrollViewer> + </muxc:ItemsRepeaterScrollHost> + + <muxc:NavigationViewItemSeparator + x:Name="VisualItemsSeparator" + Grid.Row="1" + Margin="0,0,0,2" + HorizontalAlignment="Stretch" + VerticalAlignment="Center" + Visibility="Collapsed" /> + + <!-- PaneFooter --> + <ContentControl + x:Name="FooterContentBorder" + Grid.Row="2" + Margin="0,0,0,4" + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch" + IsTabStop="False" /> + + <!-- FooterItems --> + <muxc:ItemsRepeaterScrollHost Grid.Row="3"> + <ScrollViewer + x:Name="FooterItemsScrollViewer" + VerticalAnchorRatio="1" + VerticalScrollBarVisibility="Auto"> + <muxc:ItemsRepeater x:Name="FooterMenuItemsHost" AutomationProperties.AccessibilityView="Content"> + <muxc:ItemsRepeater.Layout> + <muxc:StackLayout /> + </muxc:ItemsRepeater.Layout> + </muxc:ItemsRepeater> + </ScrollViewer> + </muxc:ItemsRepeaterScrollHost> + </Grid> + </Grid> + </SplitView.Pane> + + <SplitView.Content> + <Grid + x:Name="ContentGrid" + Margin="{ThemeResource NavigationViewContentMargin}" + Background="{ThemeResource NavigationViewContentBackground}" + BorderBrush="{ThemeResource NavigationViewContentGridBorderBrush}" + BorderThickness="{ThemeResource NavigationViewContentGridBorderThickness}" + CornerRadius="{ThemeResource NavigationViewContentGridCornerRadius}"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="*" /> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + + <Grid + x:Name="ContentTopPadding" + Grid.ColumnSpan="2" + Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPadding}" + Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.LeftPaneVisibility}" /> + + <Grid x:Name="ContentLeftPadding" Grid.Row="1" /> + + <ContentControl + x:Name="HeaderContent" + Grid.Row="1" + Grid.Column="1" + MinHeight="{StaticResource PaneToggleButtonHeight}" + HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Stretch" + Content="{TemplateBinding Header}" + ContentTemplate="{TemplateBinding HeaderTemplate}" + IsTabStop="False" + Style="{StaticResource NavigationViewTitleHeaderContentControlTextStyle}" /> + + <ContentPresenter + x:Name="ContentPresenter" + Grid.Row="2" + Grid.ColumnSpan="2" + Margin="{ThemeResource NavigationViewContentPresenterMargin}" + AutomationProperties.LandmarkType="Main" + Content="{TemplateBinding Content}" /> + </Grid> + </SplitView.Content> + </SplitView> + + <Grid + x:Name="ShadowCaster" + Grid.RowSpan="2" + Width="{TemplateBinding OpenPaneLength}" + HorizontalAlignment="Left"> + <Grid.RenderTransform> + <CompositeTransform x:Name="ShadowCasterTransform" /> + </Grid.RenderTransform> + </Grid> + + </Grid> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="DisplayModeGroup"> + <VisualState x:Name="Compact" /> + + <VisualState x:Name="Expanded" /> + + <VisualState x:Name="Minimal"> + <VisualState.Setters> + <Setter Target="HeaderContent.Margin" Value="{ThemeResource NavigationViewMinimalHeaderMargin}" /> + <Setter Target="NavigationViewBackButton.Style" Value="{ThemeResource NavigationBackButtonSmallStyle}" /> + <Setter Target="ContentGrid.BorderThickness" Value="{ThemeResource NavigationViewMinimalContentGridBorderThickness}" /> + <Setter Target="ContentGrid.CornerRadius" Value="{ThemeResource NavigationViewMinimalContentGridCornerRadius}" /> + </VisualState.Setters> + </VisualState> + + <VisualState x:Name="TopNavigationMinimal"> + <VisualState.Setters> + <Setter Target="ContentGrid.BorderThickness" Value="{ThemeResource TopNavigationViewContentGridBorderThickness}" /> + <Setter Target="ContentGrid.CornerRadius" Value="{ThemeResource TopNavigationViewContentGridCornerRadius}" /> + <Setter Target="ContentGrid.Margin" Value="{ThemeResource TopNavigationViewContentMargin}" /> + </VisualState.Setters> + </VisualState> + + <VisualState x:Name="MinimalWithBackButton"> + <VisualState.Setters> + <Setter Target="HeaderContent.Margin" Value="{ThemeResource NavigationViewMinimalHeaderMargin}" /> + <Setter Target="NavigationViewBackButton.Style" Value="{ThemeResource NavigationBackButtonSmallStyle}" /> + <Setter Target="ContentGrid.BorderThickness" Value="{ThemeResource NavigationViewMinimalContentGridBorderThickness}" /> + <Setter Target="ContentGrid.CornerRadius" Value="{ThemeResource NavigationViewMinimalContentGridCornerRadius}" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="TogglePaneGroup"> + <VisualState x:Name="TogglePaneButtonCollapsed" /> + <VisualState x:Name="TogglePaneButtonVisible"> + <VisualState.Setters> + <!-- Might not need this setter when all the margins/paddings will be adequately set. --> + <!-- This MinHeight setter is only here to ensure that AutoSuggestBox doesn't draw over ToggleButton. --> + <Setter Target="PaneContentGridToggleButtonRow.MinHeight" Value="{StaticResource NavigationViewPaneHeaderRowMinHeight}" /> + <Setter Target="PaneTitlePresenter.Margin" Value="{ThemeResource NavigationViewItemInnerHeaderMargin}" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="HeaderGroup"> + <VisualState x:Name="HeaderVisible" /> + <VisualState x:Name="HeaderCollapsed"> + <VisualState.Setters> + <Setter Target="HeaderContent.Visibility" Value="Collapsed" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="AutoSuggestGroup"> + <VisualState x:Name="AutoSuggestBoxVisible" /> + <VisualState x:Name="AutoSuggestBoxCollapsed"> + <VisualState.Setters> + <Setter Target="AutoSuggestArea.Visibility" Value="Collapsed" /> + <Setter Target="TopPaneAutoSuggestArea.Visibility" Value="Collapsed" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="PaneStateGroup"> + <VisualState x:Name="NotClosedCompact" /> + <VisualState x:Name="ClosedCompact"> + <VisualState.Setters> + <Setter Target="PaneAutoSuggestBoxPresenter.Visibility" Value="Collapsed" /> + <Setter Target="PaneAutoSuggestButton.Visibility" Value="Visible" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="PaneStateListSizeGroup"> + <VisualState x:Name="ListSizeFull" /> + <VisualState x:Name="ListSizeCompact"> + <VisualState.Setters> + <Setter Target="PaneContentGrid.Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CompactPaneLength}" /> + <Setter Target="ShadowCaster.Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CompactPaneLength}" /> + <Setter Target="PaneTitleTextBlock.Visibility" Value="Collapsed" /> + <Setter Target="PaneHeaderContentBorder.Visibility" Value="Collapsed" /> + <Setter Target="PaneCustomContentBorder.HorizontalAlignment" Value="Left" /> + <Setter Target="FooterContentBorder.HorizontalAlignment" Value="Left" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="PaneOverlayGroup"> + <VisualStateGroup.Transitions> + <VisualTransition From="PaneNotOverlaying" To="PaneOverlaying"> + <Storyboard> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ShadowCasterTransform" Storyboard.TargetProperty="TranslateX"> + <DiscreteDoubleKeyFrame KeyTime="0" Value="{Binding ElementName=RootSplitView, Path=TemplateSettings.NegativeOpenPaneLengthMinusCompactLength}" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.35" + Value="0" /> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ShadowCaster" Storyboard.TargetProperty="Opacity"> + <LinearDoubleKeyFrame KeyTime="0:0:0.35" Value="1" /> + </DoubleAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ShadowCaster" Storyboard.TargetProperty="HorizontalAlignment"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Left" /> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualTransition> + <VisualTransition From="PaneOverlaying" To="PaneNotOverlaying"> + <Storyboard x:Name="ShadowCasterEaseOutStoryboard"> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ShadowCasterTransform" Storyboard.TargetProperty="TranslateX"> + <DiscreteDoubleKeyFrame KeyTime="0" Value="0" /> + <SplineDoubleKeyFrame + KeySpline="0.1,0.9 0.2,1.0" + KeyTime="0:0:0.12" + Value="{Binding ElementName=RootSplitView, Path=TemplateSettings.NegativeOpenPaneLengthMinusCompactLength}" /> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ShadowCaster" Storyboard.TargetProperty="Opacity"> + <LinearDoubleKeyFrame KeyTime="0:0:0.12" Value="0" /> + </DoubleAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ShadowCaster" Storyboard.TargetProperty="HorizontalAlignment"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Left" /> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualTransition> + </VisualStateGroup.Transitions> + <VisualState x:Name="PaneOverlaying" /> + <VisualState x:Name="PaneNotOverlaying"> + <VisualState.Setters> + <Setter Target="RootSplitView.BorderBrush" Value="Transparent" /> + <Setter Target="ShadowCaster.Opacity" Value="0" /> + <Setter Target="RootSplitView.PaneBackground" Value="{ThemeResource NavigationViewExpandedPaneBackground}" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="TitleBarVisibilityGroup"> + <VisualState x:Name="TitleBarVisible" /> + <VisualState x:Name="TitleBarCollapsed"> + <VisualState.Setters> + <Setter Target="PaneContentGrid.Margin" Value="0,32,0,0" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="OverflowLabelGroup"> + <VisualState x:Name="OverflowButtonWithLabel" /> + <VisualState x:Name="OverflowButtonNoLabel"> + <VisualState.Setters> + <Setter Target="TopNavOverflowButton.Style" Value="{ThemeResource NavigationViewOverflowButtonNoLabelStyleWhenPaneOnTop}" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="BackButtonGroup"> + <VisualState x:Name="BackButtonVisible" /> + <VisualState x:Name="BackButtonCollapsed"> + <VisualState.Setters> + <Setter Target="BackButtonPlaceholderOnTopNav.Width" Value="0" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="PaneVisibilityGroup"> + <VisualState x:Name="PaneVisible" /> + <VisualState x:Name="PaneCollapsed"> + <VisualState.Setters> + <!-- Note that RootSplitView.DisplayMode is set in code so we don't want to --> + <!-- write it here and interfere. But these values work together to hide --> + <!-- the left pane. --> + <Setter Target="RootSplitView.CompactPaneLength" Value="0" /> + <Setter Target="ShadowCaster.Width" Value="0" /> + <Setter Target="PaneToggleButtonGrid.Visibility" Value="Collapsed" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="PaneSeparatorStates"> + <VisualState x:Name="SeparatorCollapsed" /> + <VisualState x:Name="SeparatorVisible"> + <VisualState.Setters> + <Setter Target="VisualItemsSeparator.Visibility" Value="Visible" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> +</ResourceDictionary> diff --git a/src/Notepads/Resource/CustomSplitViewStyle.xaml b/src/Notepads/Resource/NotepadsSplitViewStyle.xaml similarity index 99% rename from src/Notepads/Resource/CustomSplitViewStyle.xaml rename to src/Notepads/Resource/NotepadsSplitViewStyle.xaml index 9aa466fd6..181e43d0e 100644 --- a/src/Notepads/Resource/CustomSplitViewStyle.xaml +++ b/src/Notepads/Resource/NotepadsSplitViewStyle.xaml @@ -3,7 +3,13 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Notepads"> - <Style x:Key="CustomSplitViewStyle" TargetType="SplitView"> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="Theme.xaml" /> + </ResourceDictionary.MergedDictionaries> + + <Style BasedOn="{StaticResource NotepadsSplitViewStyle}" TargetType="SplitView" /> + + <Style x:Key="NotepadsSplitViewStyle" TargetType="SplitView"> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property="VerticalContentAlignment" Value="Stretch" /> <Setter Property="OpenPaneLength" Value="{ThemeResource SplitViewOpenPaneThemeLength}" /> @@ -45,7 +51,7 @@ Width="1" HorizontalAlignment="Right" x:DeferLoadStrategy="Lazy" - Fill="{ThemeResource SystemControlForegroundTransparentBrush}" + Fill="{ThemeResource SubtleFillColorTransparentBrush}" Visibility="Collapsed" /> </Grid> <Grid x:Name="ContentRoot" Grid.ColumnSpan="2"> diff --git a/src/Notepads/Resource/NotepadsTabViewStyle.xaml b/src/Notepads/Resource/NotepadsTabViewStyle.xaml new file mode 100644 index 000000000..86892c8dc --- /dev/null +++ b/src/Notepads/Resource/NotepadsTabViewStyle.xaml @@ -0,0 +1,1203 @@ +<ResourceDictionary + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" + xmlns:muxcp="using:Microsoft.UI.Xaml.Controls.Primitives" + xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls"> + + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="Theme.xaml" /> + </ResourceDictionary.MergedDictionaries> + + <ResourceDictionary.ThemeDictionaries> + <ResourceDictionary x:Key="Light"> + <StaticResource x:Key="TabViewBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <!--<StaticResource x:Key="TabViewItemHeaderBackgroundSelected" ResourceKey="SolidBackgroundFillColorTertiaryBrush" />--> + <StaticResource x:Key="TabViewItemHeaderBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderBackgroundDisabled" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderForegroundPressed" ResourceKey="TextFillColorTertiaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderForegroundSelected" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" /> + <StaticResource x:Key="TabViewItemIconForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewItemIconForegroundPressed" ResourceKey="TextFillColorTertiaryBrush" /> + <StaticResource x:Key="TabViewItemIconForegroundSelected" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="TabViewItemIconForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewItemIconForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" /> + <StaticResource x:Key="TabViewButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewButtonBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" /> + <StaticResource x:Key="TabViewButtonBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewButtonBackgroundDisabled" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewButtonForeground" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="TabViewButtonForegroundPressed" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewButtonForegroundPointerOver" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="TabViewButtonForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" /> + <StaticResource x:Key="TabViewScrollButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewScrollButtonBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" /> + <StaticResource x:Key="TabViewScrollButtonBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewScrollButtonBackgroundDisabled" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewScrollButtonForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewScrollButtonForegroundPressed" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewScrollButtonForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewScrollButtonForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" /> + <StaticResource x:Key="TabViewItemSeparator" ResourceKey="DividerStrokeColorDefaultBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonBackgroundPressed" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonBackgroundPointerOver" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderPressedCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderPointerOverCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderSelectedCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderDisabledCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonForegroundPressed" ResourceKey="TextFillColorTertiaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonForegroundPointerOver" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderPressedCloseButtonForeground" ResourceKey="TextFillColorTertiaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderPointerOverCloseButtonForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderSelectedCloseButtonForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderDisabledCloseButtonForeground" ResourceKey="TextFillColorDisabledBrush" /> + <x:Double x:Key="TabViewEdgeShadowOpacity">0.55</x:Double> + + <!-- Note: These theme resources below are no longer used and might be removed in a future WinUI update. --> + <StaticResource x:Key="TabViewButtonBackgroundActiveTab" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewButtonForegroundActiveTab" ResourceKey="ControlStrongFillColorDefaultBrush" /> + + <StaticResource x:Key="TabViewBorderBrush" ResourceKey="CardStrokeColorDefault" /> + <StaticResource x:Key="TabViewItemBorderBrush" ResourceKey="SubtleFillColorTransparentBrush" /> + <LinearGradientBrush x:Key="TabViewSelectedItemBorderBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,4"> + <LinearGradientBrush.RelativeTransform> + <ScaleTransform CenterY="0.5" ScaleY="-1" /> + </LinearGradientBrush.RelativeTransform> + <LinearGradientBrush.GradientStops> + <GradientStop Offset="1.0" Color="Transparent" /> + <GradientStop Offset="1.0" Color="{ThemeResource CardStrokeColorDefault}" /> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + </ResourceDictionary> + + <ResourceDictionary x:Key="Dark"> + <StaticResource x:Key="TabViewBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <!--<StaticResource x:Key="TabViewItemHeaderBackgroundSelected" ResourceKey="SolidBackgroundFillColorTertiaryBrush" />--> + <StaticResource x:Key="TabViewItemHeaderBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderBackgroundDisabled" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderForegroundPressed" ResourceKey="TextFillColorTertiaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderForegroundSelected" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" /> + <StaticResource x:Key="TabViewItemIconForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewItemIconForegroundPressed" ResourceKey="TextFillColorTertiaryBrush" /> + <StaticResource x:Key="TabViewItemIconForegroundSelected" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="TabViewItemIconForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewItemIconForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" /> + <StaticResource x:Key="TabViewButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewButtonBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" /> + <StaticResource x:Key="TabViewButtonBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewButtonBackgroundDisabled" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewButtonForeground" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="TabViewButtonForegroundPressed" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewButtonForegroundPointerOver" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="TabViewButtonForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" /> + <StaticResource x:Key="TabViewScrollButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewScrollButtonBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" /> + <StaticResource x:Key="TabViewScrollButtonBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewScrollButtonBackgroundDisabled" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewScrollButtonForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewScrollButtonForegroundPressed" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewScrollButtonForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewScrollButtonForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" /> + <StaticResource x:Key="TabViewItemSeparator" ResourceKey="DividerStrokeColorDefaultBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonBackgroundPressed" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonBackgroundPointerOver" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderPressedCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderPointerOverCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderSelectedCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderDisabledCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonForegroundPressed" ResourceKey="TextFillColorTertiaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonForegroundPointerOver" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderPressedCloseButtonForeground" ResourceKey="TextFillColorTertiaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderPointerOverCloseButtonForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderSelectedCloseButtonForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TabViewItemHeaderDisabledCloseButtonForeground" ResourceKey="TextFillColorDisabledBrush" /> + <x:Double x:Key="TabViewEdgeShadowOpacity">0.7</x:Double> + + <!-- Note: These theme resources below are no longer used and might be removed in a future WinUI update. --> + <StaticResource x:Key="TabViewButtonBackgroundActiveTab" ResourceKey="SubtleFillColorTransparentBrush" /> + <StaticResource x:Key="TabViewButtonForegroundActiveTab" ResourceKey="ControlStrongFillColorDefaultBrush" /> + + <StaticResource x:Key="TabViewBorderBrush" ResourceKey="CardStrokeColorDefault" /> + <StaticResource x:Key="TabViewItemBorderBrush" ResourceKey="SubtleFillColorTransparentBrush" /> + <LinearGradientBrush x:Key="TabViewSelectedItemBorderBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,4"> + <LinearGradientBrush.RelativeTransform> + <ScaleTransform CenterY="0.5" ScaleY="-1" /> + </LinearGradientBrush.RelativeTransform> + <LinearGradientBrush.GradientStops> + <GradientStop Offset="1.0" Color="Transparent" /> + <GradientStop Offset="1.0" Color="{ThemeResource CardStrokeColorDefault}" /> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + </ResourceDictionary> + + <ResourceDictionary x:Key="HighContrast"> + <StaticResource x:Key="TabViewBackground" ResourceKey="SystemControlBackgroundBaseLowBrush" /> + <StaticResource x:Key="TabViewItemHeaderBackground" ResourceKey="SystemControlBackgroundBaseLowBrush" /> + <!--<StaticResource x:Key="TabViewItemHeaderBackgroundSelected" ResourceKey="SystemControlHighlightChromeHighBrush" />--> + <StaticResource x:Key="TabViewItemHeaderBackgroundPointerOver" ResourceKey="SystemControlHighlightChromeHighBrush" /> + <StaticResource x:Key="TabViewItemHeaderBackgroundPressed" ResourceKey="SystemControlHighlightChromeHighBrush" /> + <StaticResource x:Key="TabViewItemHeaderBackgroundDisabled" ResourceKey="SystemControlBackgroundBaseLowBrush" /> + <StaticResource x:Key="TabViewItemHeaderForeground" ResourceKey="SystemControlForegroundBaseHighBrush" /> + <StaticResource x:Key="TabViewItemHeaderForegroundPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" /> + <StaticResource x:Key="TabViewItemHeaderForegroundSelected" ResourceKey="SystemControlHighlightAltBaseHighBrush" /> + <StaticResource x:Key="TabViewItemHeaderForegroundPointerOver" ResourceKey="SystemControlHighlightAltBaseHighBrush" /> + <StaticResource x:Key="TabViewItemHeaderForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" /> + <StaticResource x:Key="TabViewItemIconForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" /> + <StaticResource x:Key="TabViewItemIconForegroundPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" /> + <StaticResource x:Key="TabViewItemIconForegroundSelected" ResourceKey="SystemControlHighlightAltBaseHighBrush" /> + <StaticResource x:Key="TabViewItemIconForegroundPointerOver" ResourceKey="SystemControlHighlightAltBaseHighBrush" /> + <StaticResource x:Key="TabViewItemIconForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" /> + <StaticResource x:Key="TabViewButtonBackground" ResourceKey="SystemControlBackgroundBaseLowBrush" /> + <StaticResource x:Key="TabViewButtonBackgroundPressed" ResourceKey="SystemControlHighlightChromeHighBrush" /> + <StaticResource x:Key="TabViewButtonBackgroundPointerOver" ResourceKey="SystemControlHighlightChromeHighBrush" /> + <StaticResource x:Key="TabViewButtonBackgroundDisabled" ResourceKey="SystemControlBackgroundBaseLowBrush" /> + <StaticResource x:Key="TabViewButtonForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" /> + <StaticResource x:Key="TabViewButtonForegroundPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" /> + <StaticResource x:Key="TabViewButtonForegroundPointerOver" ResourceKey="SystemControlHighlightAltBaseHighBrush" /> + <StaticResource x:Key="TabViewButtonForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" /> + <StaticResource x:Key="TabViewScrollButtonBackground" ResourceKey="SystemControlBackgroundBaseLowBrush" /> + <StaticResource x:Key="TabViewScrollButtonBackgroundPressed" ResourceKey="SystemControlHighlightChromeHighBrush" /> + <StaticResource x:Key="TabViewScrollButtonBackgroundPointerOver" ResourceKey="SystemControlHighlightChromeHighBrush" /> + <StaticResource x:Key="TabViewScrollButtonBackgroundDisabled" ResourceKey="SystemControlBackgroundBaseLowBrush" /> + <StaticResource x:Key="TabViewScrollButtonForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" /> + <StaticResource x:Key="TabViewScrollButtonForegroundPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" /> + <StaticResource x:Key="TabViewScrollButtonForegroundPointerOver" ResourceKey="SystemControlHighlightAltBaseHighBrush" /> + <StaticResource x:Key="TabViewScrollButtonForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" /> + <StaticResource x:Key="TabViewItemSeparator" ResourceKey="SystemControlForegroundBaseLowBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonBackground" ResourceKey="SystemControlBackgroundBaseLowBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonBackgroundPressed" ResourceKey="SystemControlBackgroundListMediumBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonBackgroundPointerOver" ResourceKey="SystemControlBackgroundListLowBrush" /> + <StaticResource x:Key="TabViewItemHeaderPressedCloseButtonBackground" ResourceKey="SystemControlTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderPointerOverCloseButtonBackground" ResourceKey="SystemControlTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderSelectedCloseButtonBackground" ResourceKey="SystemControlTransparentBrush" /> + <StaticResource x:Key="TabViewItemHeaderDisabledCloseButtonBackground" ResourceKey="SystemControlBackgroundBaseLowBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonForegroundPressed" ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> + <StaticResource x:Key="TabViewItemHeaderCloseButtonForegroundPointerOver" ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> + <StaticResource x:Key="TabViewItemHeaderPressedCloseButtonForeground" ResourceKey="SystemControlBackgroundBaseMediumBrush" /> + <StaticResource x:Key="TabViewItemHeaderPointerOverCloseButtonForeground" ResourceKey="SystemControlBackgroundBaseMediumBrush" /> + <StaticResource x:Key="TabViewItemHeaderSelectedCloseButtonForeground" ResourceKey="SystemControlBackgroundBaseMediumBrush" /> + <StaticResource x:Key="TabViewItemHeaderDisabledCloseButtonForeground" ResourceKey="SystemControlDisabledBaseMediumLowBrush" /> + <x:Double x:Key="TabViewEdgeShadowOpacity">0</x:Double> + + <!-- Note: These theme resources below are no longer used and might be removed in a future WinUI update. --> + <StaticResource x:Key="TabViewButtonBackgroundActiveTab" ResourceKey="SystemControlTransparentBrush" /> + <StaticResource x:Key="TabViewButtonForegroundActiveTab" ResourceKey="SystemControlBackgroundBaseMediumBrush" /> + + <StaticResource x:Key="TabViewBorderBrush" ResourceKey="CardStrokeColorDefault" /> + <StaticResource x:Key="TabViewItemBorderBrush" ResourceKey="SubtleFillColorTransparentBrush" /> + <LinearGradientBrush x:Key="TabViewSelectedItemBorderBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,4"> + <LinearGradientBrush.RelativeTransform> + <ScaleTransform CenterY="0.5" ScaleY="-1" /> + </LinearGradientBrush.RelativeTransform> + <LinearGradientBrush.GradientStops> + <GradientStop Offset="1.0" Color="Transparent" /> + <GradientStop Offset="1.0" Color="{ThemeResource SystemColorHighlightColor}" /> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + </ResourceDictionary> + </ResourceDictionary.ThemeDictionaries> + + <Thickness x:Key="TabViewHeaderPadding">4,0,4,0</Thickness> + <Thickness x:Key="TabViewItemHeaderPadding">8,0,4,0</Thickness> + <Thickness x:Key="TabViewSelectedItemHeaderPadding">9,0,5,0</Thickness> + + <x:Double x:Key="TabViewItemMinHeight">32</x:Double> + <x:Double x:Key="TabViewItemMaxWidth">210</x:Double> + <x:Double x:Key="TabViewItemMinWidth">90</x:Double> + + <x:Double x:Key="TabViewItemHeaderFontSize">14</x:Double> + <x:Double x:Key="TabViewItemHeaderIconSize">7</x:Double> + <Thickness x:Key="TabViewItemHeaderIconMargin">0,0,5,0</Thickness> + + + <x:Double x:Key="TabViewItemHeaderCloseButtonHeight">24</x:Double> + <x:Double x:Key="TabViewItemHeaderCloseButtonWidth">32</x:Double> + + <x:Double x:Key="TabViewItemHeaderCloseButtonSize">16</x:Double> + <x:Double x:Key="TabViewItemHeaderCloseFontSize">14</x:Double> + <Thickness x:Key="TabViewItemHeaderCloseMargin">4,0,0,0</Thickness> + + <x:Double x:Key="TabViewItemScrollButtonWidth">32</x:Double> + <x:Double x:Key="TabViewItemScrollButtonHeight">24</x:Double> + <x:Double x:Key="TabViewItemScrollButonFontSize">12</x:Double> + <Thickness x:Key="TabViewItemScrollButtonPadding">7,3,7,3</Thickness> + <Thickness x:Key="TabViewItemLeftScrollButtonContainerPadding">0,0,3,0</Thickness> + <Thickness x:Key="TabViewItemRightScrollButtonContainerPadding">3,0,0,0</Thickness> + + <x:Double x:Key="TabViewItemAddButtonWidth">42</x:Double> + <x:Double x:Key="TabViewItemAddButtonHeight">32</x:Double> + <x:Double x:Key="TabViewItemAddButtonFontSize">14</x:Double> + <Thickness x:Key="TabViewItemAddButtonContainerPadding">0,0,3,0</Thickness> + + <x:Double x:Key="TabViewShadowDepth">16</x:Double> + + <Thickness x:Key="TabViewItemSeparatorMargin">0,5,0,5</Thickness> + + <Thickness x:Key="TabViewItemBorderThickness">0</Thickness> + + <Thickness x:Key="TabViewSelectedItemBorderThickness">0</Thickness> + + <Thickness x:Key="TabViewSelectedItemHeaderMargin">-1,0,-1,0</Thickness> + + <Style x:Key="TopEdgeShadowStyle" TargetType="wctc:DropShadowPanel"> + <Setter Property="BlurRadius" Value="10" /> + <Setter Property="ShadowOpacity" Value="{ThemeResource TabViewEdgeShadowOpacity}" /> + <Setter Property="VerticalAlignment" Value="Top" /> + <Setter Property="HorizontalAlignment" Value="Stretch" /> + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> + </Style> + + <Style x:Key="BottomEdgeShadowStyle" TargetType="wctc:DropShadowPanel"> + <Setter Property="BlurRadius" Value="10" /> + <Setter Property="ShadowOpacity" Value="{ThemeResource TabViewEdgeShadowOpacity}" /> + <Setter Property="VerticalAlignment" Value="Bottom" /> + <Setter Property="HorizontalAlignment" Value="Stretch" /> + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> + </Style> + + <Style x:Key="SideEdgeShadowStyle" TargetType="wctc:DropShadowPanel"> + <Setter Property="BlurRadius" Value="8" /> + <Setter Property="ShadowOpacity" Value="{ThemeResource TabViewEdgeShadowOpacity}" /> + <Setter Property="Visibility" Value="Visible" /> + </Style> + + <Style BasedOn="{StaticResource NotepadsTabViewStyle}" TargetType="muxc:TabView" /> + + <Style x:Key="NotepadsTabViewStyle" TargetType="muxc:TabView"> + <Setter Property="VerticalAlignment" Value="Stretch" /> + <Setter Property="Padding" Value="{StaticResource TabViewHeaderPadding}" /> + <Setter Property="IsTabStop" Value="False" /> + <Setter Property="Background" Value="{ThemeResource TabViewBackground}" /> + <Setter Property="KeyboardAcceleratorPlacementMode" Value="Hidden" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="muxc:TabView"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="*" /> + </Grid.RowDefinitions> + + <Grid + x:Name="TabContainerGrid" + Background="{TemplateBinding Background}" + XYFocusKeyboardNavigation="Enabled"> + + <Grid.ColumnDefinitions> + <ColumnDefinition x:Name="LeftContentColumn" Width="Auto" /> + <ColumnDefinition x:Name="TabColumn" Width="Auto" /> + <ColumnDefinition x:Name="AddButtonColumn" Width="Auto" /> + <ColumnDefinition x:Name="RightContentColumn" Width="*" /> + </Grid.ColumnDefinitions> + + <!--<Border + Grid.Column="1" + Grid.ColumnSpan="2" + Height="1" + VerticalAlignment="Bottom" + BorderBrush="{ThemeResource TabViewBorderBrush}" + BorderThickness="1" />--> + + <!-- Shadow under Start Header --> + <wctc:DropShadowPanel Grid.Column="0" Style="{StaticResource BottomEdgeShadowStyle}"> + <Grid Height="1" Margin="0,0,0,-1" /> + <wctc:DropShadowPanel.Clip> + <RectangleGeometry Rect="0,-12,1024,12" /> + </wctc:DropShadowPanel.Clip> + </wctc:DropShadowPanel> + + <ContentPresenter + x:Name="LeftContentPresenter" + Grid.Column="0" + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + Content="{TemplateBinding TabStripHeader}" + ContentTemplate="{TemplateBinding TabStripHeaderTemplate}" /> + + <muxcp:TabViewListView + x:Name="TabListView" + Grid.Column="1" + Padding="{TemplateBinding Padding}" + AllowDrop="{TemplateBinding AllowDropTabs}" + CanDragItems="{TemplateBinding CanDragTabs}" + CanReorderItems="{TemplateBinding CanReorderTabs}" + ItemTemplate="{TemplateBinding TabItemTemplate}" + ItemTemplateSelector="{TemplateBinding TabItemTemplateSelector}" + ItemsSource="{TemplateBinding TabItemsSource}" /> + + <!-- Shadow under Add Button --> + <wctc:DropShadowPanel Grid.Column="2" Style="{StaticResource BottomEdgeShadowStyle}"> + <Grid Height="1" Margin="-1,0,0,-1" /> + <wctc:DropShadowPanel.Clip> + <RectangleGeometry Rect="0,-12,1024,12" /> + </wctc:DropShadowPanel.Clip> + </wctc:DropShadowPanel> + + <Border + Grid.Column="2" + Padding="{StaticResource TabViewItemAddButtonContainerPadding}" + Visibility="{Binding IsAddTabButtonVisible, RelativeSource={RelativeSource TemplatedParent}}"> + <Button + x:Name="AddButton" + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + Command="{TemplateBinding AddTabButtonCommand}" + CommandParameter="{TemplateBinding AddTabButtonCommandParameter}" + Content="" + HighContrastAdjustment="None" + IsTextScaleFactorEnabled="False" + Style="{StaticResource TabViewButtonStyle}" /> + </Border> + + <!-- Shadow under Padding area (23040 = 3 x 8k resolution in width just in case) --> + <wctc:DropShadowPanel Grid.Column="3" Style="{StaticResource BottomEdgeShadowStyle}"> + <Grid Height="1" Margin="0,0,0,-1" /> + <wctc:DropShadowPanel.Clip> + <RectangleGeometry Rect="0,-12,23040,12" /> + </wctc:DropShadowPanel.Clip> + </wctc:DropShadowPanel> + + <ContentPresenter + x:Name="RightContentPresenter" + Grid.Column="3" + HorizontalAlignment="Stretch" + Content="{TemplateBinding TabStripFooter}" + ContentTemplate="{TemplateBinding TabStripFooterTemplate}" /> + + </Grid> + + <!-- Shadow below Tab Content --> + <wctc:DropShadowPanel + Grid.Row="1" + VerticalAlignment="Bottom" + Canvas.ZIndex="50" + Style="{StaticResource TopEdgeShadowStyle}"> + <Grid Height="1" /> + <wctc:DropShadowPanel.Clip> + <RectangleGeometry Rect="0,0,23040,12" /> + </wctc:DropShadowPanel.Clip> + </wctc:DropShadowPanel> + + <ContentPresenter + x:Name="TabContentPresenter" + Grid.Row="1" + Background="{ThemeResource TabViewItemHeaderBackgroundSelected}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Canvas.ZIndex="100" /> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="muxcp:TabViewListView"> + <Setter Property="VerticalAlignment" Value="Top" /> + <Setter Property="IsTabStop" Value="False" /> + <Setter Property="TabNavigation" Value="Once" /> + <Setter Property="IsSwipeEnabled" Value="False" /> + <Setter Property="SingleSelectionFollowsFocus" Value="False" /> + <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" /> + <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled" /> + <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Enabled" /> + <Setter Property="ScrollViewer.IsHorizontalRailEnabled" Value="False" /> + <Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled" /> + <Setter Property="ScrollViewer.IsVerticalRailEnabled" Value="False" /> + <Setter Property="ScrollViewer.ZoomMode" Value="Disabled" /> + <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" /> + <Setter Property="ScrollViewer.BringIntoViewOnFocusChange" Value="True" /> + <Setter Property="ItemContainerTransitions"> + <Setter.Value> + <TransitionCollection> + <AddDeleteThemeTransition /> + <ContentThemeTransition /> + <ReorderThemeTransition /> + <EntranceThemeTransition IsStaggeringEnabled="False" /> + </TransitionCollection> + </Setter.Value> + </Setter> + + <Setter Property="ItemsPanel"> + <Setter.Value> + <ItemsPanelTemplate> + <ItemsStackPanel Orientation="Horizontal" /> + </ItemsPanelTemplate> + </Setter.Value> + </Setter> + + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="muxcp:TabViewListView"> + <Border + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{TemplateBinding CornerRadius}"> + <ScrollViewer + x:Name="ScrollViewer" + Grid.Column="1" + AutomationProperties.AccessibilityView="Raw" + BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}" + HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" + HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" + IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" + IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" + IsHorizontalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsHorizontalScrollChainingEnabled}" + IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" + IsVerticalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsVerticalScrollChainingEnabled}" + Style="{StaticResource TabScrollViewerStyle}" + TabNavigation="{TemplateBinding TabNavigation}" + VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" + VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" + ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"> + + <ItemsPresenter x:Name="TabsItemsPresenter" Padding="{TemplateBinding Padding}" /> + + </ScrollViewer> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Name="TabScrollViewerStyle" TargetType="ScrollViewer"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="ScrollViewer"> + <Border + x:Name="Root" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + + <Border + x:Name="ScrollDecreaseButtonContainer" + Padding="{StaticResource TabViewItemLeftScrollButtonContainerPadding}" + VerticalAlignment="Center" + Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"> + <RepeatButton + x:Name="ScrollDecreaseButton" + AutomationProperties.AccessibilityView="Raw" + Content="" + Delay="50" + HighContrastAdjustment="None" + Interval="100" + Style="{ThemeResource TabViewScrollButtonStyle}" /> + </Border> + + <ScrollContentPresenter + x:Name="ScrollContentPresenter" + Grid.Column="1" + Padding="1,0,0,0" + TabFocusNavigation="Once" /> + + <Border + x:Name="ScrollIncreaseButtonContainer" + Grid.Column="2" + Padding="{StaticResource TabViewItemRightScrollButtonContainerPadding}" + VerticalAlignment="Center" + Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"> + <RepeatButton + x:Name="ScrollIncreaseButton" + AutomationProperties.AccessibilityView="Raw" + Content="" + Delay="50" + HighContrastAdjustment="None" + Interval="100" + Style="{ThemeResource TabViewScrollButtonStyle}" /> + </Border> + </Grid> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="TabViewCloseButtonStyle" TargetType="Button"> + <Setter Property="HorizontalContentAlignment" Value="Center" /> + <Setter Property="VerticalContentAlignment" Value="Center" /> + <Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" /> + <Setter Property="FontSize" Value="{StaticResource TabViewItemHeaderCloseFontSize}" /> + <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> + <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> + <Setter Property="Width" Value="{StaticResource TabViewItemHeaderCloseButtonWidth}" /> + <Setter Property="Height" Value="{StaticResource TabViewItemHeaderCloseButtonHeight}" /> + <Setter Property="Background" Value="{ThemeResource TabViewItemHeaderCloseButtonBackground}" /> + <Setter Property="Foreground" Value="{ThemeResource TabViewItemHeaderCloseButtonForeground}" /> + <Setter Property="FocusVisualMargin" Value="-3" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="Button"> + <ContentPresenter + x:Name="ContentPresenter" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + AutomationProperties.AccessibilityView="Raw" + Background="{TemplateBinding Background}" + BackgroundSizing="{TemplateBinding BackgroundSizing}" + Content="{TemplateBinding Content}" + ContentTemplate="{TemplateBinding ContentTemplate}" + ContentTransitions="{TemplateBinding ContentTransitions}" + CornerRadius="{TemplateBinding CornerRadius}"> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="CommonStates"> + <VisualState x:Name="Normal" /> + <VisualState x:Name="PointerOver"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewItemHeaderCloseButtonBackgroundPointerOver}" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewItemHeaderCloseButtonForegroundPointerOver}" /> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + <VisualState x:Name="Pressed"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewItemHeaderCloseButtonBackgroundPressed}" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewItemHeaderCloseButtonForegroundPressed}" /> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + </ContentPresenter> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Name="TabViewButtonStyle" TargetType="Button"> + <Setter Property="Background" Value="{ThemeResource TabViewButtonBackground}" /> + <Setter Property="Foreground" Value="{ThemeResource TabViewButtonForeground}" /> + <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> + <Setter Property="FontSize" Value="{StaticResource TabViewItemAddButtonFontSize}" /> + <Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" /> + <Setter Property="Width" Value="{StaticResource TabViewItemAddButtonWidth}" /> + <Setter Property="Height" Value="{StaticResource TabViewItemAddButtonHeight}" /> + <Setter Property="FocusVisualMargin" Value="-3" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="Button"> + <ContentPresenter + x:Name="ContentPresenter" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + muxc:AnimatedIcon.State="Normal" + AutomationProperties.AccessibilityView="Raw" + Background="{TemplateBinding Background}" + BackgroundSizing="{TemplateBinding BackgroundSizing}" + Content="{TemplateBinding Content}" + ContentTemplate="{TemplateBinding ContentTemplate}" + ContentTransitions="{TemplateBinding ContentTransitions}" + CornerRadius="{TemplateBinding CornerRadius}" + FontFamily="{TemplateBinding FontFamily}" + FontSize="{TemplateBinding FontSize}" + FontWeight="{TemplateBinding FontWeight}"> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="CommonStates"> + <VisualState x:Name="Normal" /> + <VisualState x:Name="PointerOver"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewButtonBackgroundPointerOver}" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewButtonForegroundPointerOver}" /> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + <VisualState.Setters> + <Setter Target="ContentPresenter.(muxc:AnimatedIcon.State)" Value="PointerOver" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="Pressed"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewButtonBackgroundPressed}" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewButtonForegroundPressed}" /> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + <VisualState.Setters> + <Setter Target="ContentPresenter.(muxc:AnimatedIcon.State)" Value="Pressed" /> + </VisualState.Setters> + </VisualState> + <VisualState x:Name="Disabled"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewButtonBackgroundDisabled}" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewButtonForegroundDisabled}" /> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + <VisualState.Setters> + <!-- DisabledVisual Should be handled by the control, not the animated icon. --> + <Setter Target="ContentPresenter.(muxc:AnimatedIcon.State)" Value="Normal" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + </ContentPresenter> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="muxc:TabViewItem"> + <Setter Property="HorizontalContentAlignment" Value="Left" /> + <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> + <Setter Property="MinHeight" Value="{StaticResource TabViewItemMinHeight}" /> + <Setter Property="CornerRadius" Value="0" /> + <!--<Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" />--> + <Setter Property="BorderThickness" Value="{StaticResource TabViewItemBorderThickness}" /> + <Setter Property="BorderBrush" Value="{ThemeResource TabViewItemBorderBrush}" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="muxc:TabViewItem"> + <Grid x:Name="LayoutRoot" Padding="{TemplateBinding Padding}"> + <Grid.ColumnDefinitions> + <ColumnDefinition x:Name="LeftColumn" Width="Auto" /> + <ColumnDefinition Width="*" /> + <ColumnDefinition x:Name="RightColumn" Width="Auto" /> + </Grid.ColumnDefinitions> + + <Grid.RenderTransform> + <ScaleTransform x:Name="LayoutRootScale" /> + </Grid.RenderTransform> + + <!--<Path + x:Name="LeftRadiusRenderArc" + Width="4" + Height="4" + Margin="-4,0,0,0" + VerticalAlignment="Bottom" + x:Load="False" + Data="M4 0C4 1.19469 3.47624 2.26706 2.64582 3H0C1.65685 3 3 1.65685 3 0H4Z" + Fill="{ThemeResource CardStrokeColorDefault}" + Visibility="Collapsed" /> + + <Path + x:Name="LeftRadiusRenderTriangle" + Margin="-4,0,0,0" + VerticalAlignment="Bottom" + x:Load="False" + Data="M0 4H4V0C4 2.20914 2.20914 4 0 4Z" + Fill="{ThemeResource TabViewItemHeaderBackgroundSelected}" + Visibility="Collapsed" /> + + <Path + x:Name="RightRadiusRenderArc" + Grid.Column="2" + Width="4" + Height="4" + Margin="0,0,-4,0" + VerticalAlignment="Bottom" + x:Load="False" + Data="M0 0C0 1.19469 0.523755 2.26706 1.35418 3H4C2.34315 3 1 1.65685 1 0H0Z" + Fill="{ThemeResource CardStrokeColorDefault}" + Visibility="Collapsed" /> + + <Path + x:Name="RightRadiusRenderTriangle" + Grid.Column="2" + Margin="0,0,-4,0" + VerticalAlignment="Bottom" + x:Load="False" + Data="M4 4H0V0C0 2.20914 1.79086 4 4 4Z" + Fill="{ThemeResource TabViewItemHeaderBackgroundSelected}" + Visibility="Collapsed" />--> + + <Border + x:Name="TabSeparator" + Grid.Column="1" + Width="1" + Margin="{StaticResource TabViewItemSeparatorMargin}" + HorizontalAlignment="Right" + BorderBrush="{ThemeResource TabViewItemSeparator}" + BorderThickness="1" /> + + <Grid + x:Name="TabContainer" + Grid.Column="1" + Padding="{StaticResource TabViewItemHeaderPadding}" + Background="{ThemeResource TabViewItemHeaderBackground}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + Control.IsTemplateFocusTarget="True" + CornerRadius="{TemplateBinding CornerRadius}" + FocusVisualMargin="{TemplateBinding FocusVisualMargin}"> + + <Grid.ColumnDefinitions> + <ColumnDefinition x:Name="IconColumn" Width="Auto" /> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + + <Viewbox + x:Name="IconBox" + MaxWidth="{StaticResource TabViewItemHeaderIconSize}" + MaxHeight="{StaticResource TabViewItemHeaderIconSize}" + Margin="{StaticResource TabViewItemHeaderIconMargin}"> + <ContentControl + x:Name="IconControl" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TabViewTemplateSettings.IconElement}" + Foreground="{StaticResource SystemControlForegroundAccentBrush}" + HighContrastAdjustment="None" + IsTabStop="False" /> + </Viewbox> + + <ContentPresenter + x:Name="ContentPresenter" + Grid.Column="1" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + Content="{TemplateBinding Header}" + ContentTemplate="{TemplateBinding HeaderTemplate}" + ContentTransitions="{TemplateBinding ContentTransitions}" + FontSize="{StaticResource TabViewItemHeaderFontSize}" + FontWeight="{TemplateBinding FontWeight}" + Foreground="{ThemeResource TabViewItemHeaderForeground}" + HighContrastAdjustment="None" + OpticalMarginAlignment="TrimSideBearings" /> + + <Button + x:Name="CloseButton" + Grid.Column="2" + Margin="{StaticResource TabViewItemHeaderCloseMargin}" + Content="" + HighContrastAdjustment="None" + IsTabStop="False" + IsTextScaleFactorEnabled="False" + Style="{StaticResource TabViewCloseButtonStyle}" /> + </Grid> + + <wctc:DropShadowPanel + x:Name="ItemLeftSideShadow" + Grid.Column="1" + HorizontalAlignment="Left" + Style="{StaticResource SideEdgeShadowStyle}" + Visibility="Collapsed"> + + <wctc:DropShadowPanel.Clip> + <RectangleGeometry Rect="-8,0,8,32" /> + </wctc:DropShadowPanel.Clip> + + <Grid Width="1" /> + + </wctc:DropShadowPanel> + + <wctc:DropShadowPanel + x:Name="ItemRightSideShadow" + Grid.Column="1" + HorizontalAlignment="Right" + Style="{StaticResource SideEdgeShadowStyle}" + Visibility="Collapsed"> + + <wctc:DropShadowPanel.Clip> + <RectangleGeometry Rect="1,0,8,32" /> + </wctc:DropShadowPanel.Clip> + + <Grid Width="1" /> + + </wctc:DropShadowPanel> + + <wctc:DropShadowPanel + x:Name="ItemBottomSideShadow" + Grid.ColumnSpan="2" + Style="{StaticResource BottomEdgeShadowStyle}"> + <Grid Height="1" /> + </wctc:DropShadowPanel> + + <Rectangle + x:Name="SelectionIndicator" + Grid.ColumnSpan="2" + Height="3" + Margin="0,-1" + VerticalAlignment="Top" + Fill="{StaticResource SystemControlForegroundAccentBrush}" + Opacity="0" /> + + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="CommonStates"> + <VisualState x:Name="Normal" /> + + <VisualState x:Name="PointerOver"> + <VisualState.Setters> + <Setter Target="TabContainer.Background" Value="{ThemeResource TabViewItemHeaderBackgroundPointerOver}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TabViewItemHeaderForegroundPointerOver}" /> + <!--<Setter Target="IconControl.Foreground" Value="{ThemeResource TabViewItemIconForegroundPointerOver}" />--> + <Setter Target="CloseButton.Background" Value="{ThemeResource TabViewItemHeaderPointerOverCloseButtonBackground}" /> + <Setter Target="CloseButton.Foreground" Value="{ThemeResource TabViewItemHeaderPointerOverCloseButtonForeground}" /> + <Setter Target="TabSeparator.Opacity" Value="0" /> + </VisualState.Setters> + </VisualState> + + <VisualState x:Name="Pressed"> + <VisualState.Setters> + <Setter Target="TabContainer.Background" Value="{ThemeResource TabViewItemHeaderBackgroundPressed}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TabViewItemHeaderForegroundPressed}" /> + <!--<Setter Target="IconControl.Foreground" Value="{ThemeResource TabViewItemIconForegroundPressed}" />--> + <Setter Target="CloseButton.Background" Value="{ThemeResource TabViewItemHeaderPressedCloseButtonBackground}" /> + <Setter Target="CloseButton.Foreground" Value="{ThemeResource TabViewItemHeaderPressedCloseButtonForeground}" /> + <Setter Target="TabSeparator.Opacity" Value="0" /> + </VisualState.Setters> + </VisualState> + + <VisualState x:Name="Selected"> + <VisualState.Setters> + <!--<Setter Target="RightRadiusRenderArc.Visibility" Value="Visible" /> + <Setter Target="RightRadiusRenderTriangle.Visibility" Value="Visible" /> + <Setter Target="RightRadiusRenderTriangle.Fill" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" /> + <Setter Target="LeftRadiusRenderArc.Visibility" Value="Visible" /> + <Setter Target="LeftRadiusRenderTriangle.Visibility" Value="Visible" /> + <Setter Target="LeftRadiusRenderTriangle.Fill" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" />--> + <Setter Target="TabContainer.Margin" Value="{StaticResource TabViewSelectedItemHeaderMargin}" /> + <!--<Setter Target="TabContainer.BorderBrush" Value="{ThemeResource TabViewSelectedItemBorderBrush}" /> + <Setter Target="TabContainer.BorderThickness" Value="{ThemeResource TabViewSelectedItemBorderThickness}" />--> + <Setter Target="TabContainer.Background" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" /> + <Setter Target="TabContainer.Padding" Value="{StaticResource TabViewSelectedItemHeaderPadding}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TabViewItemHeaderForegroundSelected}" /> + <!--<Setter Target="TabContainer.CornerRadius" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CornerRadius, Converter={StaticResource TopCornerRadiusFilterConverter}}" />--> + <!--<Setter Target="IconControl.Foreground" Value="{ThemeResource TabViewItemIconForegroundSelected}" />--> + <Setter Target="CloseButton.Background" Value="{ThemeResource TabViewItemHeaderSelectedCloseButtonBackground}" /> + <Setter Target="CloseButton.Foreground" Value="{ThemeResource TabViewItemHeaderSelectedCloseButtonForeground}" /> + <Setter Target="LayoutRoot.Background" Value="Transparent" /> + <Setter Target="ContentPresenter.FontWeight" Value="SemiBold" /> + + <!-- Notepads Setters --> + <Setter Target="SelectionIndicator.Opacity" Value="1" /> + <Setter Target="ItemLeftSideShadow.Visibility" Value="Visible" /> + <Setter Target="ItemRightSideShadow.Visibility" Value="Visible" /> + <Setter Target="ItemBottomSideShadow.Visibility" Value="Collapsed" /> + </VisualState.Setters> + </VisualState> + + <VisualState x:Name="PointerOverSelected"> + <VisualState.Setters> + <!--<Setter Target="RightRadiusRenderArc.Visibility" Value="Visible" /> + <Setter Target="RightRadiusRenderTriangle.Visibility" Value="Visible" /> + <Setter Target="RightRadiusRenderTriangle.Fill" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" /> + <Setter Target="LeftRadiusRenderArc.Visibility" Value="Visible" /> + <Setter Target="LeftRadiusRenderTriangle.Visibility" Value="Visible" /> + <Setter Target="LeftRadiusRenderTriangle.Fill" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" />--> + <Setter Target="TabContainer.Margin" Value="{StaticResource TabViewSelectedItemHeaderMargin}" /> + <!--<Setter Target="TabContainer.BorderBrush" Value="{ThemeResource TabViewSelectedItemBorderBrush}" /> + <Setter Target="TabContainer.BorderThickness" Value="{ThemeResource TabViewSelectedItemBorderThickness}" />--> + <Setter Target="TabContainer.Background" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" /> + <Setter Target="TabContainer.Padding" Value="{StaticResource TabViewSelectedItemHeaderPadding}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TabViewItemHeaderForegroundSelected}" /> + <!--<Setter Target="IconControl.Foreground" Value="{ThemeResource TabViewItemIconForegroundSelected}" />--> + <Setter Target="CloseButton.Background" Value="{ThemeResource TabViewItemHeaderSelectedCloseButtonBackground}" /> + <Setter Target="CloseButton.Foreground" Value="{ThemeResource TabViewItemHeaderSelectedCloseButtonForeground}" /> + <Setter Target="LayoutRoot.Background" Value="Transparent" /> + <Setter Target="ContentPresenter.FontWeight" Value="SemiBold" /> + + <!-- Notepads Setters --> + <Setter Target="SelectionIndicator.Opacity" Value="1" /> + <Setter Target="ItemLeftSideShadow.Visibility" Value="Visible" /> + <Setter Target="ItemRightSideShadow.Visibility" Value="Visible" /> + <Setter Target="ItemBottomSideShadow.Visibility" Value="Collapsed" /> + </VisualState.Setters> + </VisualState> + + <VisualState x:Name="PressedSelected"> + <VisualState.Setters> + <!--<Setter Target="RightRadiusRenderArc.Visibility" Value="Visible" /> + <Setter Target="RightRadiusRenderTriangle.Visibility" Value="Visible" /> + <Setter Target="RightRadiusRenderTriangle.Fill" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" /> + <Setter Target="LeftRadiusRenderArc.Visibility" Value="Visible" /> + <Setter Target="LeftRadiusRenderTriangle.Visibility" Value="Visible" /> + <Setter Target="LeftRadiusRenderTriangle.Fill" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" />--> + <Setter Target="TabContainer.Margin" Value="{StaticResource TabViewSelectedItemHeaderMargin}" /> + <!--<Setter Target="TabContainer.BorderBrush" Value="{ThemeResource TabViewSelectedItemBorderBrush}" /> + <Setter Target="TabContainer.BorderThickness" Value="{ThemeResource TabViewSelectedItemBorderThickness}" />--> + <Setter Target="TabContainer.Background" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" /> + <Setter Target="TabContainer.Padding" Value="{StaticResource TabViewSelectedItemHeaderPadding}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TabViewItemHeaderForegroundSelected}" /> + <!--<Setter Target="IconControl.Foreground" Value="{ThemeResource TabViewItemIconForegroundSelected}" />--> + <Setter Target="CloseButton.Background" Value="{ThemeResource TabViewItemHeaderSelectedCloseButtonBackground}" /> + <Setter Target="CloseButton.Foreground" Value="{ThemeResource TabViewItemHeaderSelectedCloseButtonForeground}" /> + <Setter Target="LayoutRoot.Background" Value="Transparent" /> + <Setter Target="ContentPresenter.FontWeight" Value="SemiBold" /> + + <!-- Notepads Setters --> + <Setter Target="SelectionIndicator.Opacity" Value="1" /> + <Setter Target="ItemLeftSideShadow.Visibility" Value="Visible" /> + <Setter Target="ItemRightSideShadow.Visibility" Value="Visible" /> + <Setter Target="ItemBottomSideShadow.Visibility" Value="Collapsed" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="DisabledStates"> + <VisualState x:Name="Enabled" /> + + <VisualState x:Name="Disabled"> + <VisualState.Setters> + <Setter Target="TabContainer.Background" Value="{ThemeResource TabViewItemHeaderBackgroundDisabled}" /> + <Setter Target="IconControl.Foreground" Value="{ThemeResource TabViewItemHeaderForegroundDisabled}" /> + <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TabViewItemHeaderForegroundDisabled}" /> + <Setter Target="IconControl.Foreground" Value="{ThemeResource TabViewButtonForegroundDisabled}" /> + <Setter Target="CloseButton.Background" Value="{ThemeResource TabViewItemHeaderDisabledCloseButtonBackground}" /> + <Setter Target="CloseButton.Foreground" Value="{ThemeResource TabViewItemHeaderDisabledCloseButtonForeground}" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="DataVirtualizationStates"> + <VisualState x:Name="DataAvailable" /> + + <VisualState x:Name="DataPlaceholder" /> + </VisualStateGroup> + + <VisualStateGroup x:Name="ReorderHintStates"> + <VisualState x:Name="NoReorderHint" /> + + <VisualState x:Name="BottomReorderHint"> + <Storyboard> + <DragOverThemeAnimation + Direction="Bottom" + ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" + TargetName="LayoutRoot" /> + </Storyboard> + </VisualState> + + <VisualState x:Name="TopReorderHint"> + <Storyboard> + <DragOverThemeAnimation + Direction="Top" + ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" + TargetName="LayoutRoot" /> + </Storyboard> + </VisualState> + + <VisualState x:Name="RightReorderHint"> + <Storyboard> + <DragOverThemeAnimation + Direction="Right" + ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" + TargetName="LayoutRoot" /> + </Storyboard> + </VisualState> + + <VisualState x:Name="LeftReorderHint"> + <Storyboard> + <DragOverThemeAnimation + Direction="Left" + ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" + TargetName="LayoutRoot" /> + </Storyboard> + </VisualState> + + <VisualStateGroup.Transitions> + <VisualTransition GeneratedDuration="0:0:0.2" To="NoReorderHint" /> + </VisualStateGroup.Transitions> + </VisualStateGroup> + + <VisualStateGroup x:Name="DragStates"> + <VisualState x:Name="NotDragging" /> + + <VisualState x:Name="Dragging"> + <Storyboard> + <DoubleAnimation + Storyboard.TargetName="LayoutRoot" + Storyboard.TargetProperty="Opacity" + To="{ThemeResource ListViewItemDragThemeOpacity}" + Duration="0" /> + <DragItemThemeAnimation TargetName="LayoutRoot" /> + </Storyboard> + </VisualState> + + <VisualState x:Name="DraggingTarget" /> + + <VisualState x:Name="MultipleDraggingPrimary" /> + + <VisualState x:Name="MultipleDraggingSecondary" /> + + <VisualState x:Name="DraggedPlaceholder" /> + + <VisualState x:Name="Reordering"> + <Storyboard> + <DoubleAnimation + Storyboard.TargetName="LayoutRoot" + Storyboard.TargetProperty="Opacity" + To="{ThemeResource ListViewItemReorderThemeOpacity}" + Duration="0:0:0.240" /> + </Storyboard> + </VisualState> + + <VisualState x:Name="ReorderingTarget"> + <Storyboard> + <DoubleAnimation + Storyboard.TargetName="LayoutRoot" + Storyboard.TargetProperty="Opacity" + To="{ThemeResource ListViewItemReorderTargetThemeOpacity}" + Duration="0:0:0.240" /> + <DoubleAnimation + Storyboard.TargetName="LayoutRootScale" + Storyboard.TargetProperty="ScaleX" + To="{ThemeResource ListViewItemReorderTargetThemeScale}" + Duration="0:0:0.240" /> + <DoubleAnimation + Storyboard.TargetName="LayoutRootScale" + Storyboard.TargetProperty="ScaleY" + To="{ThemeResource ListViewItemReorderTargetThemeScale}" + Duration="0:0:0.240" /> + </Storyboard> + </VisualState> + + <VisualState x:Name="MultipleReorderingPrimary" /> + + <VisualState x:Name="ReorderedPlaceholder"> + <Storyboard> + <FadeOutThemeAnimation TargetName="LayoutRoot" /> + </Storyboard> + </VisualState> + + <VisualState x:Name="DragOver"> + <Storyboard> + <DropTargetItemThemeAnimation TargetName="LayoutRoot" /> + </Storyboard> + </VisualState> + + <VisualStateGroup.Transitions> + <VisualTransition GeneratedDuration="0:0:0.2" To="NotDragging" /> + </VisualStateGroup.Transitions> + </VisualStateGroup> + + <VisualStateGroup x:Name="IconStates"> + <VisualState x:Name="Icon" /> + <VisualState x:Name="NoIcon"> + <VisualState.Setters> + <Setter Target="IconBox.Visibility" Value="Collapsed" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="TabWidthModes"> + <VisualState x:Name="StandardWidth" /> + + <VisualState x:Name="Compact"> + <VisualState.Setters> + <Setter Target="IconBox.Margin" Value="0,0,0,0" /> + <Setter Target="ContentPresenter.Visibility" Value="Collapsed" /> + <Setter Target="IconColumn.Width" Value="{StaticResource TabViewItemHeaderIconSize}" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + + <VisualStateGroup x:Name="CloseIconStates"> + <VisualState x:Name="CloseButtonVisible" /> + <VisualState x:Name="CloseButtonCollapsed"> + <VisualState.Setters> + <Setter Target="CloseButton.Visibility" Value="Collapsed" /> + </VisualState.Setters> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Name="TabViewScrollButtonStyle" TargetType="RepeatButton"> + <Setter Property="Background" Value="{ThemeResource TabViewScrollButtonBackground}" /> + <Setter Property="Foreground" Value="{ThemeResource TabViewScrollButtonForeground}" /> + <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> + <Setter Property="FontSize" Value="{StaticResource TabViewItemScrollButonFontSize}" /> + <Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" /> + <Setter Property="Width" Value="{StaticResource TabViewItemScrollButtonWidth}" /> + <Setter Property="Height" Value="{StaticResource TabViewItemScrollButtonHeight}" /> + <Setter Property="FocusVisualMargin" Value="-3" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="RepeatButton"> + <ContentPresenter + x:Name="ContentPresenter" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + AutomationProperties.AccessibilityView="Raw" + Background="{TemplateBinding Background}" + BackgroundSizing="{TemplateBinding BackgroundSizing}" + Content="{TemplateBinding Content}" + ContentTemplate="{TemplateBinding ContentTemplate}" + ContentTransitions="{TemplateBinding ContentTransitions}" + CornerRadius="{TemplateBinding CornerRadius}" + FontFamily="{TemplateBinding FontFamily}" + FontSize="{TemplateBinding FontSize}" + FontWeight="{TemplateBinding FontWeight}"> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="CommonStates"> + <VisualState x:Name="Normal" /> + + <VisualState x:Name="PointerOver"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewScrollButtonBackgroundPointerOver}" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewScrollButtonForegroundPointerOver}" /> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + + <VisualState x:Name="Pressed"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewScrollButtonBackgroundPressed}" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewScrollButtonForegroundPressed}" /> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + + <VisualState x:Name="Disabled"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewScrollButtonBackgroundDisabled}" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewScrollButtonForegroundDisabled}" /> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + </ContentPresenter> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + +</ResourceDictionary> \ No newline at end of file diff --git a/src/Notepads/Resource/Theme.xaml b/src/Notepads/Resource/Theme.xaml new file mode 100644 index 000000000..21cf61b22 --- /dev/null +++ b/src/Notepads/Resource/Theme.xaml @@ -0,0 +1,841 @@ +<ResourceDictionary + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" + xmlns:muxcp="using:Microsoft.UI.Xaml.Controls.Primitives"> + <!-- + 2.5 controls should not depends on brushes on ths files except new controls like Expander + --> + <ResourceDictionary.ThemeDictionaries> + <ResourceDictionary x:Key="Light"> + + <!-- CornerRadiuses --> + + <CornerRadius x:Key="ControlCornerRadius">4,4,4,4</CornerRadius> + <CornerRadius x:Key="OverlayCornerRadius">8,8,8,8</CornerRadius> + + <!-- Colors --> + + <Color x:Key="TextFillColorPrimary">#E4000000</Color> + <Color x:Key="TextFillColorSecondary">#9E000000</Color> + <Color x:Key="TextFillColorTertiary">#72000000</Color> + <Color x:Key="TextFillColorDisabled">#5C000000</Color> + <Color x:Key="TextFillColorInverse">#FFFFFF</Color> + + <Color x:Key="AccentTextFillColorDisabled">#5C000000</Color> + + <Color x:Key="TextOnAccentFillColorSelectedText">#FFFFFF</Color> + + <Color x:Key="TextOnAccentFillColorPrimary">#FFFFFF</Color> + <Color x:Key="TextOnAccentFillColorSecondary">#B3FFFFFF</Color> + <Color x:Key="TextOnAccentFillColorDisabled">#FFFFFF</Color> + + <Color x:Key="ControlFillColorDefault">#B3FFFFFF</Color> + <Color x:Key="ControlFillColorSecondary">#80F9F9F9</Color> + <Color x:Key="ControlFillColorTertiary">#4DF9F9F9</Color> + <Color x:Key="ControlFillColorDisabled">#4DF9F9F9</Color> + <Color x:Key="ControlFillColorTransparent">#00FFFFFF</Color> + <Color x:Key="ControlFillColorInputActive">#FFFFFF</Color> + + <Color x:Key="ControlStrongFillColorDefault">#72000000</Color> + <Color x:Key="ControlStrongFillColorDisabled">#51000000</Color> + + <Color x:Key="ControlSolidFillColorDefault">#FFFFFF</Color> + + <Color x:Key="SubtleFillColorTransparent">#00FFFFFF</Color> + <Color x:Key="SubtleFillColorSecondary">#09000000</Color> + <Color x:Key="SubtleFillColorTertiary">#06000000</Color> + <Color x:Key="SubtleFillColorDisabled">#00FFFFFF</Color> + + <Color x:Key="ControlAltFillColorTransparent">#00FFFFFF</Color> + <Color x:Key="ControlAltFillColorSecondary">#06000000</Color> + <Color x:Key="ControlAltFillColorTertiary">#0F000000</Color> + <Color x:Key="ControlAltFillColorQuarternary">#18000000</Color> + <Color x:Key="ControlAltFillColorDisabled">#00FFFFFF</Color> + + <Color x:Key="ControlOnImageFillColorDefault">#C9FFFFFF</Color> + <Color x:Key="ControlOnImageFillColorSecondary">#F3F3F3</Color> + <Color x:Key="ControlOnImageFillColorTertiary">#EBEBEB</Color> + <Color x:Key="ControlOnImageFillColorDisabled">#00FFFFFF</Color> + + <Color x:Key="AccentFillColorDisabled">#37000000</Color> + + <Color x:Key="ControlStrokeColorDefault">#0F000000</Color> + <Color x:Key="ControlStrokeColorSecondary">#29000000</Color> + <Color x:Key="ControlStrokeColorOnAccentDefault">#14FFFFFF</Color> + <Color x:Key="ControlStrokeColorOnAccentSecondary">#66000000</Color> + <Color x:Key="ControlStrokeColorOnAccentTertiary">#37000000</Color> + <Color x:Key="ControlStrokeColorOnAccentDisabled">#0F000000</Color> + + <Color x:Key="ControlStrokeColorForStrongFillWhenOnImage">#59FFFFFF</Color> + + <Color x:Key="CardStrokeColorDefault">#0F000000</Color> + <Color x:Key="CardStrokeColorDefaultSolid">#EBEBEB</Color> + + <Color x:Key="ControlStrongStrokeColorDefault">#72000000</Color> + <Color x:Key="ControlStrongStrokeColorDisabled">#37000000</Color> + + <Color x:Key="SurfaceStrokeColorDefault">#66757575</Color> + <Color x:Key="SurfaceStrokeColorFlyout">#0F000000</Color> + <Color x:Key="SurfaceStrokeColorInverse">#15FFFFFF</Color> + + <Color x:Key="DividerStrokeColorDefault">#0F000000</Color> + + <Color x:Key="FocusStrokeColorOuter">#E4000000</Color> + <Color x:Key="FocusStrokeColorInner">#B3FFFFFF</Color> + + <Color x:Key="CardBackgroundFillColorDefault">#B3FFFFFF</Color> + <Color x:Key="CardBackgroundFillColorSecondary">#80F6F6F6</Color> + + <Color x:Key="SmokeFillColorDefault">#4D000000</Color> + + <Color x:Key="LayerFillColorDefault">#80FFFFFF</Color> + <Color x:Key="LayerFillColorAlt">#FFFFFF</Color> + <Color x:Key="LayerOnAcrylicFillColorDefault">#40FFFFFF</Color> + <Color x:Key="LayerOnAccentAcrylicFillColorDefault">#40FFFFFF</Color> + + <Color x:Key="SolidBackgroundFillColorBase">#F3F3F3</Color> + <Color x:Key="SolidBackgroundFillColorSecondary">#EEEEEE</Color> + <Color x:Key="SolidBackgroundFillColorTertiary">#F9F9F9</Color> + <Color x:Key="SolidBackgroundFillColorQuarternary">#FFFFFF</Color> + <Color x:Key="SolidBackgroundFillColorTransparent">#00F3F3F3</Color> + + <Color x:Key="SystemFillColorSuccess">#0F7B0F</Color> + <Color x:Key="SystemFillColorCaution">#9D5D00</Color> + <Color x:Key="SystemFillColorCritical">#C42B1C</Color> + <Color x:Key="SystemFillColorNeutral">#72000000</Color> + <Color x:Key="SystemFillColorSolidNeutral">#8A8A8A</Color> + <Color x:Key="SystemFillColorAttentionBackground">#80F6F6F6</Color> + <Color x:Key="SystemFillColorSuccessBackground">#DFF6DD</Color> + <Color x:Key="SystemFillColorCautionBackground">#FFF4CE</Color> + <Color x:Key="SystemFillColorCriticalBackground">#FDE7E9</Color> + <Color x:Key="SystemFillColorNeutralBackground">#06000000</Color> + <Color x:Key="SystemFillColorSolidAttentionBackground">#F7F7F7</Color> + <Color x:Key="SystemFillColorSolidNeutralBackground">#F3F3F3</Color> + + <!-- Brushes --> + + <SolidColorBrush x:Key="TextFillColorPrimaryBrush" Color="{StaticResource TextFillColorPrimary}" /> + <SolidColorBrush x:Key="TextFillColorSecondaryBrush" Color="{StaticResource TextFillColorSecondary}" /> + <SolidColorBrush x:Key="TextFillColorTertiaryBrush" Color="{StaticResource TextFillColorTertiary}" /> + <SolidColorBrush x:Key="TextFillColorDisabledBrush" Color="{StaticResource TextFillColorDisabled}" /> + <SolidColorBrush x:Key="TextFillColorInverseBrush" Color="{StaticResource TextFillColorInverse}" /> + + <SolidColorBrush x:Key="AccentTextFillColorPrimaryBrush" Color="{ThemeResource SystemAccentColorDark2}" /> + <SolidColorBrush x:Key="AccentTextFillColorSecondaryBrush" Color="{ThemeResource SystemAccentColorDark3}" /> + <SolidColorBrush x:Key="AccentTextFillColorTertiaryBrush" Color="{ThemeResource SystemAccentColorDark1}" /> + <SolidColorBrush x:Key="AccentTextFillColorDisabledBrush" Color="{StaticResource AccentTextFillColorDisabled}" /> + + <SolidColorBrush x:Key="TextOnAccentFillColorSelectedTextBrush" Color="{StaticResource TextOnAccentFillColorSelectedText}" /> + + <SolidColorBrush x:Key="TextOnAccentFillColorPrimaryBrush" Color="{StaticResource TextOnAccentFillColorPrimary}" /> + <SolidColorBrush x:Key="TextOnAccentFillColorSecondaryBrush" Color="{StaticResource TextOnAccentFillColorSecondary}" /> + <SolidColorBrush x:Key="TextOnAccentFillColorDisabledBrush" Color="{StaticResource TextOnAccentFillColorDisabled}" /> + + <SolidColorBrush x:Key="ControlFillColorDefaultBrush" Color="{StaticResource ControlFillColorDefault}" /> + <SolidColorBrush x:Key="ControlFillColorSecondaryBrush" Color="{StaticResource ControlFillColorSecondary}" /> + <SolidColorBrush x:Key="ControlFillColorTertiaryBrush" Color="{StaticResource ControlFillColorTertiary}" /> + <SolidColorBrush x:Key="ControlFillColorDisabledBrush" Color="{StaticResource ControlFillColorDisabled}" /> + <SolidColorBrush x:Key="ControlFillColorTransparentBrush" Color="{StaticResource ControlFillColorTransparent}" /> + <SolidColorBrush x:Key="ControlFillColorInputActiveBrush" Color="{StaticResource ControlFillColorInputActive}" /> + + <SolidColorBrush x:Key="ControlStrongFillColorDefaultBrush" Color="{StaticResource ControlStrongFillColorDefault}" /> + <SolidColorBrush x:Key="ControlStrongFillColorDisabledBrush" Color="{StaticResource ControlStrongFillColorDisabled}" /> + + <SolidColorBrush x:Key="ControlSolidFillColorDefaultBrush" Color="{StaticResource ControlSolidFillColorDefault}" /> + + <SolidColorBrush x:Key="SubtleFillColorTransparentBrush" Color="{StaticResource SubtleFillColorTransparent}" /> + <SolidColorBrush x:Key="SubtleFillColorSecondaryBrush" Color="{StaticResource SubtleFillColorSecondary}" /> + <SolidColorBrush x:Key="SubtleFillColorTertiaryBrush" Color="{StaticResource SubtleFillColorTertiary}" /> + <SolidColorBrush x:Key="SubtleFillColorDisabledBrush" Color="{StaticResource SubtleFillColorDisabled}" /> + + <SolidColorBrush x:Key="ControlAltFillColorTransparentBrush" Color="{StaticResource ControlAltFillColorTransparent}" /> + <SolidColorBrush x:Key="ControlAltFillColorSecondaryBrush" Color="{StaticResource ControlAltFillColorSecondary}" /> + <SolidColorBrush x:Key="ControlAltFillColorTertiaryBrush" Color="{StaticResource ControlAltFillColorTertiary}" /> + <SolidColorBrush x:Key="ControlAltFillColorQuarternaryBrush" Color="{StaticResource ControlAltFillColorQuarternary}" /> + <SolidColorBrush x:Key="ControlAltFillColorDisabledBrush" Color="{StaticResource ControlAltFillColorDisabled}" /> + + <SolidColorBrush x:Key="ControlOnImageFillColorDefaultBrush" Color="{StaticResource ControlOnImageFillColorDefault}" /> + <SolidColorBrush x:Key="ControlOnImageFillColorSecondaryBrush" Color="{StaticResource ControlOnImageFillColorSecondary}" /> + <SolidColorBrush x:Key="ControlOnImageFillColorTertiaryBrush" Color="{StaticResource ControlOnImageFillColorTertiary}" /> + <SolidColorBrush x:Key="ControlOnImageFillColorDisabledBrush" Color="{StaticResource ControlOnImageFillColorDisabled}" /> + + <SolidColorBrush x:Key="AccentFillColorSelectedTextBackgroundBrush" Color="{ThemeResource SystemAccentColor}" /> + + <SolidColorBrush x:Key="AccentFillColorDefaultBrush" Color="{ThemeResource SystemAccentColorDark1}" /> + <SolidColorBrush + x:Key="AccentFillColorSecondaryBrush" + Opacity="0.9" + Color="{ThemeResource SystemAccentColorDark1}" /> + <SolidColorBrush + x:Key="AccentFillColorTertiaryBrush" + Opacity="0.8" + Color="{ThemeResource SystemAccentColorDark1}" /> + <SolidColorBrush x:Key="AccentFillColorDisabledBrush" Color="{StaticResource AccentFillColorDisabled}" /> + + <SolidColorBrush x:Key="ControlStrokeColorDefaultBrush" Color="{StaticResource ControlStrokeColorDefault}" /> + <SolidColorBrush x:Key="ControlStrokeColorSecondaryBrush" Color="{StaticResource ControlStrokeColorSecondary}" /> + <SolidColorBrush x:Key="ControlStrokeColorOnAccentDefaultBrush" Color="{StaticResource ControlStrokeColorOnAccentDefault}" /> + <SolidColorBrush x:Key="ControlStrokeColorOnAccentSecondaryBrush" Color="{StaticResource ControlStrokeColorOnAccentSecondary}" /> + <SolidColorBrush x:Key="ControlStrokeColorOnAccentTertiaryBrush" Color="{StaticResource ControlStrokeColorOnAccentTertiary}" /> + <SolidColorBrush x:Key="ControlStrokeColorOnAccentDisabledBrush" Color="{StaticResource ControlStrokeColorOnAccentDisabled}" /> + + <SolidColorBrush x:Key="ControlStrokeColorForStrongFillWhenOnImageBrush" Color="{StaticResource ControlStrokeColorForStrongFillWhenOnImage}" /> + + <SolidColorBrush x:Key="CardStrokeColorDefaultBrush" Color="{StaticResource CardStrokeColorDefault}" /> + <SolidColorBrush x:Key="CardStrokeColorDefaultSolidBrush" Color="{StaticResource CardStrokeColorDefaultSolid}" /> + + <SolidColorBrush x:Key="ControlStrongStrokeColorDefaultBrush" Color="{StaticResource ControlStrongStrokeColorDefault}" /> + <SolidColorBrush x:Key="ControlStrongStrokeColorDisabledBrush" Color="{StaticResource ControlStrongStrokeColorDisabled}" /> + + <SolidColorBrush x:Key="SurfaceStrokeColorDefaultBrush" Color="{StaticResource SurfaceStrokeColorDefault}" /> + <SolidColorBrush x:Key="SurfaceStrokeColorFlyoutBrush" Color="{StaticResource SurfaceStrokeColorFlyout}" /> + <SolidColorBrush x:Key="SurfaceStrokeColorInverseBrush" Color="{StaticResource SurfaceStrokeColorInverse}" /> + + <SolidColorBrush x:Key="DividerStrokeColorDefaultBrush" Color="{StaticResource DividerStrokeColorDefault}" /> + + <SolidColorBrush x:Key="FocusStrokeColorOuterBrush" Color="{StaticResource FocusStrokeColorOuter}" /> + <SolidColorBrush x:Key="FocusStrokeColorInnerBrush" Color="{StaticResource FocusStrokeColorInner}" /> + + <SolidColorBrush x:Key="CardBackgroundFillColorDefaultBrush" Color="{StaticResource CardBackgroundFillColorDefault}" /> + <SolidColorBrush x:Key="CardBackgroundFillColorSecondaryBrush" Color="{StaticResource CardBackgroundFillColorSecondary}" /> + + <SolidColorBrush x:Key="SmokeFillColorDefaultBrush" Color="{StaticResource SmokeFillColorDefault}" /> + + <SolidColorBrush x:Key="LayerFillColorDefaultBrush" Color="{StaticResource LayerFillColorDefault}" /> + <SolidColorBrush x:Key="LayerFillColorAltBrush" Color="{StaticResource LayerFillColorAlt}" /> + <SolidColorBrush x:Key="LayerOnAcrylicFillColorDefaultBrush" Color="{StaticResource LayerOnAcrylicFillColorDefault}" /> + <SolidColorBrush x:Key="LayerOnAccentAcrylicFillColorDefaultBrush" Color="{StaticResource LayerOnAccentAcrylicFillColorDefault}" /> + + <SolidColorBrush x:Key="SolidBackgroundFillColorBaseBrush" Color="{StaticResource SolidBackgroundFillColorBase}" /> + <SolidColorBrush x:Key="SolidBackgroundFillColorSecondaryBrush" Color="{StaticResource SolidBackgroundFillColorSecondary}" /> + <SolidColorBrush x:Key="SolidBackgroundFillColorTertiaryBrush" Color="{StaticResource SolidBackgroundFillColorTertiary}" /> + <SolidColorBrush x:Key="SolidBackgroundFillColorQuarternaryBrush" Color="{StaticResource SolidBackgroundFillColorQuarternary}" /> + + <SolidColorBrush x:Key="SystemFillColorAttentionBrush" Color="{ThemeResource SystemAccentColor}" /> + <SolidColorBrush x:Key="SystemFillColorSuccessBrush" Color="{StaticResource SystemFillColorSuccess}" /> + <SolidColorBrush x:Key="SystemFillColorCautionBrush" Color="{StaticResource SystemFillColorCaution}" /> + <SolidColorBrush x:Key="SystemFillColorCriticalBrush" Color="{StaticResource SystemFillColorCritical}" /> + <SolidColorBrush x:Key="SystemFillColorNeutralBrush" Color="{StaticResource SystemFillColorNeutral}" /> + <SolidColorBrush x:Key="SystemFillColorSolidNeutralBrush" Color="{StaticResource SystemFillColorSolidNeutral}" /> + <SolidColorBrush x:Key="SystemFillColorAttentionBackgroundBrush" Color="{StaticResource SystemFillColorAttentionBackground}" /> + <SolidColorBrush x:Key="SystemFillColorSuccessBackgroundBrush" Color="{StaticResource SystemFillColorSuccessBackground}" /> + <SolidColorBrush x:Key="SystemFillColorCautionBackgroundBrush" Color="{StaticResource SystemFillColorCautionBackground}" /> + <SolidColorBrush x:Key="SystemFillColorCriticalBackgroundBrush" Color="{StaticResource SystemFillColorCriticalBackground}" /> + <SolidColorBrush x:Key="SystemFillColorNeutralBackgroundBrush" Color="{StaticResource SystemFillColorNeutralBackground}" /> + <SolidColorBrush x:Key="SystemFillColorSolidAttentionBackgroundBrush" Color="{StaticResource SystemFillColorSolidAttentionBackground}" /> + <SolidColorBrush x:Key="SystemFillColorSolidNeutralBackgroundBrush" Color="{StaticResource SystemFillColorSolidNeutralBackground}" /> + + <!-- Elevation border brushes --> + + <LinearGradientBrush x:Key="ControlElevationBorderBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,3"> + <LinearGradientBrush.RelativeTransform> + <ScaleTransform CenterY="0.5" ScaleY="-1" /> + </LinearGradientBrush.RelativeTransform> + <LinearGradientBrush.GradientStops> + <GradientStop Offset="0.33" Color="{StaticResource ControlStrokeColorSecondary}" /> + <GradientStop Offset="1.0" Color="{StaticResource ControlStrokeColorDefault}" /> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + + <LinearGradientBrush x:Key="CircleElevationBorderBrush" MappingMode="RelativeToBoundingBox" StartPoint="0,0" EndPoint="0,1"> + <LinearGradientBrush.GradientStops> + <GradientStop Offset="0.50" Color="{StaticResource ControlStrokeColorDefault}" /> + <GradientStop Offset="0.70" Color="{StaticResource ControlStrokeColorSecondary}" /> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + + <LinearGradientBrush x:Key="AccentControlElevationBorderBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,3"> + <LinearGradientBrush.RelativeTransform> + <ScaleTransform CenterY="0.5" ScaleY="-1" /> + </LinearGradientBrush.RelativeTransform> + <LinearGradientBrush.GradientStops> + <GradientStop Offset="0.33" Color="{StaticResource ControlStrokeColorOnAccentSecondary}" /> + <GradientStop Offset="1.0" Color="{StaticResource ControlStrokeColorOnAccentDefault}" /> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + + <!-- Duplication from HighContrast colors to match keys, set to magenta to show these should not be used --> + <SolidColorBrush x:Key="SystemColorWindowTextColorBrush" Color="#FF00FF" /> + <SolidColorBrush x:Key="SystemColorWindowColorBrush" Color="#FF00FF" /> + <SolidColorBrush x:Key="SystemColorButtonFaceColorBrush" Color="#FF00FF" /> + <SolidColorBrush x:Key="SystemColorButtonTextColorBrush" Color="#FF00FF" /> + <SolidColorBrush x:Key="SystemColorHighlightColorBrush" Color="#FF00FF" /> + <SolidColorBrush x:Key="SystemColorHighlightTextColorBrush" Color="#FF00FF" /> + <SolidColorBrush x:Key="SystemColorHotlightColorBrush" Color="#FF00FF" /> + <SolidColorBrush x:Key="SystemColorGrayTextColorBrush" Color="#FF00FF" /> + + <!-- Notepads Brushes --> + + <SolidColorBrush + x:Key="TabViewItemHeaderBackgroundSelected" + Opacity="0.25" + Color="White" /> + <SolidColorBrush + x:Key="SplitViewBackgroundThemeBrush" + Opacity="0.4" + Color="White" /> + <SolidColorBrush + x:Key="GridSplitterBackgroundThemeBrush" + Opacity="0.5" + Color="LightGray" /> + <SolidColorBrush + x:Key="RightBoxBackgroundThemeBrush" + Opacity="0.25" + Color="White" /> + <SolidColorBrush + x:Key="HeaderBackgroundThemeBrush" + Opacity="0.35" + Color="LightGray" /> + <SolidColorBrush + x:Key="CustomTextBoxBackground" + Opacity="0.7" + Color="#E0E0E0" /> + <SolidColorBrush + x:Key="InAppNotificationBorderBrush" + Opacity="0.2" + Color="Black" /> + <SolidColorBrush x:Key="InAppNotificationBackgroundBrush" Color="#E6E6E6" /> + <SolidColorBrush x:Key="TransparentTextBoxFillColorInputActiveBrush" Color="{StaticResource ControlFillColorInputActive}" /> + <SolidColorBrush x:Key="SettingsPanelBackgroundBrush" Color="WhiteSmoke" /> + </ResourceDictionary> + + <ResourceDictionary x:Key="Dark"> + + <!-- CornerRadiuses --> + + <CornerRadius x:Key="ControlCornerRadius">4,4,4,4</CornerRadius> + <CornerRadius x:Key="OverlayCornerRadius">8,8,8,8</CornerRadius> + + <!-- Colors --> + + <Color x:Key="TextFillColorPrimary">#FFFFFF</Color> + <Color x:Key="TextFillColorSecondary">#C5FFFFFF</Color> + <Color x:Key="TextFillColorTertiary">#87FFFFFF</Color> + <Color x:Key="TextFillColorDisabled">#5DFFFFFF</Color> + <Color x:Key="TextFillColorInverse">#E4000000</Color> + + <Color x:Key="AccentTextFillColorDisabled">#5DFFFFFF</Color> + <Color x:Key="TextOnAccentFillColorSelectedText">#FFFFFF</Color> + <Color x:Key="TextOnAccentFillColorPrimary">#000000</Color> + <Color x:Key="TextOnAccentFillColorSecondary">#80000000</Color> + <Color x:Key="TextOnAccentFillColorDisabled">#87FFFFFF</Color> + + <Color x:Key="ControlFillColorDefault">#0FFFFFFF</Color> + <Color x:Key="ControlFillColorSecondary">#15FFFFFF</Color> + <Color x:Key="ControlFillColorTertiary">#08FFFFFF</Color> + <Color x:Key="ControlFillColorDisabled">#0BFFFFFF</Color> + <Color x:Key="ControlFillColorTransparent">#00FFFFFF</Color> + <Color x:Key="ControlFillColorInputActive">#B31E1E1E</Color> + + <Color x:Key="ControlStrongFillColorDefault">#8BFFFFFF</Color> + <Color x:Key="ControlStrongFillColorDisabled">#3FFFFFFF</Color> + + <Color x:Key="ControlSolidFillColorDefault">#454545</Color> + + <Color x:Key="SubtleFillColorTransparent">#00FFFFFF</Color> + <Color x:Key="SubtleFillColorSecondary">#0FFFFFFF</Color> + <Color x:Key="SubtleFillColorTertiary">#0AFFFFFF</Color> + <Color x:Key="SubtleFillColorDisabled">#00FFFFFF</Color> + + <Color x:Key="ControlAltFillColorTransparent">#00FFFFFF</Color> + <Color x:Key="ControlAltFillColorSecondary">#19000000</Color> + <Color x:Key="ControlAltFillColorTertiary">#0BFFFFFF</Color> + <Color x:Key="ControlAltFillColorQuarternary">#12FFFFFF</Color> + <Color x:Key="ControlAltFillColorDisabled">#00FFFFFF</Color> + + <Color x:Key="ControlOnImageFillColorDefault">#B31C1C1C</Color> + <Color x:Key="ControlOnImageFillColorSecondary">#1A1A1A</Color> + <Color x:Key="ControlOnImageFillColorTertiary">#131313</Color> + <Color x:Key="ControlOnImageFillColorDisabled">#1E1E1E</Color> + + <Color x:Key="AccentFillColorDisabled">#28FFFFFF</Color> + + <Color x:Key="ControlStrokeColorDefault">#12FFFFFF</Color> + <Color x:Key="ControlStrokeColorSecondary">#18FFFFFF</Color> + <Color x:Key="ControlStrokeColorOnAccentDefault">#14FFFFFF</Color> + <Color x:Key="ControlStrokeColorOnAccentSecondary">#23000000</Color> + <Color x:Key="ControlStrokeColorOnAccentTertiary">#37000000</Color> + <Color x:Key="ControlStrokeColorOnAccentDisabled">#33000000</Color> + + <Color x:Key="ControlStrokeColorForStrongFillWhenOnImage">#6B000000</Color> + + <Color x:Key="CardStrokeColorDefault">#19000000</Color> + <Color x:Key="CardStrokeColorDefaultSolid">#1C1C1C</Color> + + <Color x:Key="ControlStrongStrokeColorDefault">#8BFFFFFF</Color> + <Color x:Key="ControlStrongStrokeColorDisabled">#28FFFFFF</Color> + + <Color x:Key="SurfaceStrokeColorDefault">#66757575</Color> + <Color x:Key="SurfaceStrokeColorFlyout">#33000000</Color> + <Color x:Key="SurfaceStrokeColorInverse">#0F000000</Color> + + <Color x:Key="DividerStrokeColorDefault">#15FFFFFF</Color> + + <Color x:Key="FocusStrokeColorOuter">#FFFFFF</Color> + <Color x:Key="FocusStrokeColorInner">#B3000000</Color> + + <Color x:Key="CardBackgroundFillColorDefault">#0DFFFFFF</Color> + <Color x:Key="CardBackgroundFillColorSecondary">#08FFFFFF</Color> + + <Color x:Key="SmokeFillColorDefault">#4D000000</Color> + + <Color x:Key="LayerFillColorDefault">#4C3A3A3A</Color> + <Color x:Key="LayerFillColorAlt">#0DFFFFFF</Color> + <Color x:Key="LayerOnAcrylicFillColorDefault">#09FFFFFF</Color> + <Color x:Key="LayerOnAccentAcrylicFillColorDefault">#09FFFFFF</Color> + + <Color x:Key="SolidBackgroundFillColorBase">#202020</Color> + <Color x:Key="SolidBackgroundFillColorSecondary">#1C1C1C</Color> + <Color x:Key="SolidBackgroundFillColorTertiary">#282828</Color> + <Color x:Key="SolidBackgroundFillColorQuarternary">#2C2C2C</Color> + <Color x:Key="SolidBackgroundFillColorTransparent">#00202020</Color> + + <Color x:Key="SystemFillColorSuccess">#6CCB5F</Color> + <Color x:Key="SystemFillColorCaution">#FCE100</Color> + <Color x:Key="SystemFillColorCritical">#FF99A4</Color> + <Color x:Key="SystemFillColorNeutral">#8BFFFFFF</Color> + <Color x:Key="SystemFillColorSolidNeutral">#9D9D9D</Color> + <Color x:Key="SystemFillColorAttentionBackground">#08FFFFFF</Color> + <Color x:Key="SystemFillColorSuccessBackground">#393D1B</Color> + <Color x:Key="SystemFillColorCautionBackground">#433519</Color> + <Color x:Key="SystemFillColorCriticalBackground">#442726</Color> + <Color x:Key="SystemFillColorNeutralBackground">#08FFFFFF</Color> + <Color x:Key="SystemFillColorSolidAttentionBackground">#2E2E2E</Color> + <Color x:Key="SystemFillColorSolidNeutralBackground">#2E2E2E</Color> + + <!-- Brushes --> + + <SolidColorBrush x:Key="TextFillColorPrimaryBrush" Color="{StaticResource TextFillColorPrimary}" /> + <SolidColorBrush x:Key="TextFillColorSecondaryBrush" Color="{StaticResource TextFillColorSecondary}" /> + <SolidColorBrush x:Key="TextFillColorTertiaryBrush" Color="{StaticResource TextFillColorTertiary}" /> + <SolidColorBrush x:Key="TextFillColorDisabledBrush" Color="{StaticResource TextFillColorDisabled}" /> + <SolidColorBrush x:Key="TextFillColorInverseBrush" Color="{StaticResource TextFillColorInverse}" /> + + <SolidColorBrush x:Key="AccentTextFillColorPrimaryBrush" Color="{ThemeResource SystemAccentColorLight3}" /> + <SolidColorBrush x:Key="AccentTextFillColorSecondaryBrush" Color="{ThemeResource SystemAccentColorLight3}" /> + <SolidColorBrush x:Key="AccentTextFillColorTertiaryBrush" Color="{ThemeResource SystemAccentColorLight2}" /> + <SolidColorBrush x:Key="AccentTextFillColorDisabledBrush" Color="{StaticResource AccentTextFillColorDisabled}" /> + + <SolidColorBrush x:Key="TextOnAccentFillColorSelectedTextBrush" Color="{StaticResource TextOnAccentFillColorSelectedText}" /> + + <SolidColorBrush x:Key="TextOnAccentFillColorPrimaryBrush" Color="{StaticResource TextOnAccentFillColorPrimary}" /> + <SolidColorBrush x:Key="TextOnAccentFillColorSecondaryBrush" Color="{StaticResource TextOnAccentFillColorSecondary}" /> + <SolidColorBrush x:Key="TextOnAccentFillColorDisabledBrush" Color="{StaticResource TextOnAccentFillColorDisabled}" /> + + <SolidColorBrush x:Key="ControlFillColorDefaultBrush" Color="{StaticResource ControlFillColorDefault}" /> + <SolidColorBrush x:Key="ControlFillColorSecondaryBrush" Color="{StaticResource ControlFillColorSecondary}" /> + <SolidColorBrush x:Key="ControlFillColorTertiaryBrush" Color="{StaticResource ControlFillColorTertiary}" /> + <SolidColorBrush x:Key="ControlFillColorDisabledBrush" Color="{StaticResource ControlFillColorDisabled}" /> + <SolidColorBrush x:Key="ControlFillColorTransparentBrush" Color="{StaticResource ControlFillColorTransparent}" /> + <SolidColorBrush x:Key="ControlFillColorInputActiveBrush" Color="{StaticResource ControlFillColorInputActive}" /> + + <SolidColorBrush x:Key="ControlStrongFillColorDefaultBrush" Color="{StaticResource ControlStrongFillColorDefault}" /> + <SolidColorBrush x:Key="ControlStrongFillColorDisabledBrush" Color="{StaticResource ControlStrongFillColorDisabled}" /> + + <SolidColorBrush x:Key="ControlSolidFillColorDefaultBrush" Color="{StaticResource ControlSolidFillColorDefault}" /> + + <SolidColorBrush x:Key="SubtleFillColorTransparentBrush" Color="{StaticResource SubtleFillColorTransparent}" /> + <SolidColorBrush x:Key="SubtleFillColorSecondaryBrush" Color="{StaticResource SubtleFillColorSecondary}" /> + <SolidColorBrush x:Key="SubtleFillColorTertiaryBrush" Color="{StaticResource SubtleFillColorTertiary}" /> + <SolidColorBrush x:Key="SubtleFillColorDisabledBrush" Color="{StaticResource SubtleFillColorDisabled}" /> + + <SolidColorBrush x:Key="ControlAltFillColorTransparentBrush" Color="{StaticResource ControlAltFillColorTransparent}" /> + <SolidColorBrush x:Key="ControlAltFillColorSecondaryBrush" Color="{StaticResource ControlAltFillColorSecondary}" /> + <SolidColorBrush x:Key="ControlAltFillColorTertiaryBrush" Color="{StaticResource ControlAltFillColorTertiary}" /> + <SolidColorBrush x:Key="ControlAltFillColorQuarternaryBrush" Color="{StaticResource ControlAltFillColorQuarternary}" /> + <SolidColorBrush x:Key="ControlAltFillColorDisabledBrush" Color="{StaticResource ControlAltFillColorDisabled}" /> + + <SolidColorBrush x:Key="ControlOnImageFillColorDefaultBrush" Color="{StaticResource ControlOnImageFillColorDefault}" /> + <SolidColorBrush x:Key="ControlOnImageFillColorSecondaryBrush" Color="{StaticResource ControlOnImageFillColorSecondary}" /> + <SolidColorBrush x:Key="ControlOnImageFillColorTertiaryBrush" Color="{StaticResource ControlOnImageFillColorTertiary}" /> + <SolidColorBrush x:Key="ControlOnImageFillColorDisabledBrush" Color="{StaticResource ControlOnImageFillColorDisabled}" /> + + <SolidColorBrush x:Key="AccentFillColorSelectedTextBackgroundBrush" Color="{ThemeResource SystemAccentColor}" /> + + <SolidColorBrush x:Key="AccentFillColorDefaultBrush" Color="{ThemeResource SystemAccentColorLight2}" /> + <SolidColorBrush + x:Key="AccentFillColorSecondaryBrush" + Opacity="0.9" + Color="{ThemeResource SystemAccentColorLight2}" /> + <SolidColorBrush + x:Key="AccentFillColorTertiaryBrush" + Opacity="0.8" + Color="{ThemeResource SystemAccentColorLight2}" /> + <SolidColorBrush x:Key="AccentFillColorDisabledBrush" Color="{StaticResource AccentFillColorDisabled}" /> + + <SolidColorBrush x:Key="ControlStrokeColorDefaultBrush" Color="{StaticResource ControlStrokeColorDefault}" /> + <SolidColorBrush x:Key="ControlStrokeColorSecondaryBrush" Color="{StaticResource ControlStrokeColorSecondary}" /> + <SolidColorBrush x:Key="ControlStrokeColorOnAccentDefaultBrush" Color="{StaticResource ControlStrokeColorOnAccentDefault}" /> + <SolidColorBrush x:Key="ControlStrokeColorOnAccentSecondaryBrush" Color="{StaticResource ControlStrokeColorOnAccentSecondary}" /> + <SolidColorBrush x:Key="ControlStrokeColorOnAccentTertiaryBrush" Color="{StaticResource ControlStrokeColorOnAccentTertiary}" /> + <SolidColorBrush x:Key="ControlStrokeColorOnAccentDisabledBrush" Color="{StaticResource ControlStrokeColorOnAccentDisabled}" /> + + <SolidColorBrush x:Key="ControlStrokeColorForStrongFillWhenOnImageBrush" Color="{StaticResource ControlStrokeColorForStrongFillWhenOnImage}" /> + + <SolidColorBrush x:Key="CardStrokeColorDefaultBrush" Color="{StaticResource CardStrokeColorDefault}" /> + <SolidColorBrush x:Key="CardStrokeColorDefaultSolidBrush" Color="{StaticResource CardStrokeColorDefaultSolid}" /> + + <SolidColorBrush x:Key="ControlStrongStrokeColorDefaultBrush" Color="{StaticResource ControlStrongStrokeColorDefault}" /> + <SolidColorBrush x:Key="ControlStrongStrokeColorDisabledBrush" Color="{StaticResource ControlStrongStrokeColorDisabled}" /> + + <SolidColorBrush x:Key="SurfaceStrokeColorDefaultBrush" Color="{StaticResource SurfaceStrokeColorDefault}" /> + <SolidColorBrush x:Key="SurfaceStrokeColorFlyoutBrush" Color="{StaticResource SurfaceStrokeColorFlyout}" /> + <SolidColorBrush x:Key="SurfaceStrokeColorInverseBrush" Color="{StaticResource SurfaceStrokeColorInverse}" /> + + <SolidColorBrush x:Key="DividerStrokeColorDefaultBrush" Color="{StaticResource DividerStrokeColorDefault}" /> + + <SolidColorBrush x:Key="FocusStrokeColorOuterBrush" Color="{StaticResource FocusStrokeColorOuter}" /> + <SolidColorBrush x:Key="FocusStrokeColorInnerBrush" Color="{StaticResource FocusStrokeColorInner}" /> + + <SolidColorBrush x:Key="CardBackgroundFillColorDefaultBrush" Color="{StaticResource CardBackgroundFillColorDefault}" /> + <SolidColorBrush x:Key="CardBackgroundFillColorSecondaryBrush" Color="{StaticResource CardBackgroundFillColorSecondary}" /> + + <SolidColorBrush x:Key="SmokeFillColorDefaultBrush" Color="{StaticResource SmokeFillColorDefault}" /> + + <SolidColorBrush x:Key="LayerFillColorDefaultBrush" Color="{StaticResource LayerFillColorDefault}" /> + <SolidColorBrush x:Key="LayerFillColorAltBrush" Color="{StaticResource LayerFillColorAlt}" /> + <SolidColorBrush x:Key="LayerOnAcrylicFillColorDefaultBrush" Color="{StaticResource LayerOnAcrylicFillColorDefault}" /> + <SolidColorBrush x:Key="LayerOnAccentAcrylicFillColorDefaultBrush" Color="{StaticResource LayerOnAccentAcrylicFillColorDefault}" /> + + <SolidColorBrush x:Key="SolidBackgroundFillColorBaseBrush" Color="{StaticResource SolidBackgroundFillColorBase}" /> + <SolidColorBrush x:Key="SolidBackgroundFillColorSecondaryBrush" Color="{StaticResource SolidBackgroundFillColorSecondary}" /> + <SolidColorBrush x:Key="SolidBackgroundFillColorTertiaryBrush" Color="{StaticResource SolidBackgroundFillColorTertiary}" /> + <SolidColorBrush x:Key="SolidBackgroundFillColorQuarternaryBrush" Color="{StaticResource SolidBackgroundFillColorQuarternary}" /> + + <SolidColorBrush x:Key="SystemFillColorAttentionBrush" Color="{ThemeResource SystemAccentColorLight2}" /> + <SolidColorBrush x:Key="SystemFillColorSuccessBrush" Color="{StaticResource SystemFillColorSuccess}" /> + <SolidColorBrush x:Key="SystemFillColorCautionBrush" Color="{StaticResource SystemFillColorCaution}" /> + <SolidColorBrush x:Key="SystemFillColorCriticalBrush" Color="{StaticResource SystemFillColorCritical}" /> + <SolidColorBrush x:Key="SystemFillColorNeutralBrush" Color="{StaticResource SystemFillColorNeutral}" /> + <SolidColorBrush x:Key="SystemFillColorSolidNeutralBrush" Color="{StaticResource SystemFillColorSolidNeutral}" /> + <SolidColorBrush x:Key="SystemFillColorAttentionBackgroundBrush" Color="{StaticResource SystemFillColorAttentionBackground}" /> + <SolidColorBrush x:Key="SystemFillColorSuccessBackgroundBrush" Color="{StaticResource SystemFillColorSuccessBackground}" /> + <SolidColorBrush x:Key="SystemFillColorCautionBackgroundBrush" Color="{StaticResource SystemFillColorCautionBackground}" /> + <SolidColorBrush x:Key="SystemFillColorCriticalBackgroundBrush" Color="{StaticResource SystemFillColorCriticalBackground}" /> + <SolidColorBrush x:Key="SystemFillColorNeutralBackgroundBrush" Color="{StaticResource SystemFillColorNeutralBackground}" /> + <SolidColorBrush x:Key="SystemFillColorSolidAttentionBackgroundBrush" Color="{StaticResource SystemFillColorSolidAttentionBackground}" /> + <SolidColorBrush x:Key="SystemFillColorSolidNeutralBackgroundBrush" Color="{StaticResource SystemFillColorSolidNeutralBackground}" /> + + <!-- Duplication from HighContrast colors to match keys, set to magenta to show these should not be used --> + <SolidColorBrush x:Key="SystemColorWindowTextColorBrush" Color="#FF00FF" /> + <SolidColorBrush x:Key="SystemColorWindowColorBrush" Color="#FF00FF" /> + <SolidColorBrush x:Key="SystemColorButtonFaceColorBrush" Color="#FF00FF" /> + <SolidColorBrush x:Key="SystemColorButtonTextColorBrush" Color="#FF00FF" /> + <SolidColorBrush x:Key="SystemColorHighlightColorBrush" Color="#FF00FF" /> + <SolidColorBrush x:Key="SystemColorHighlightTextColorBrush" Color="#FF00FF" /> + <SolidColorBrush x:Key="SystemColorHotlightColorBrush" Color="#FF00FF" /> + <SolidColorBrush x:Key="SystemColorGrayTextColorBrush" Color="#FF00FF" /> + + <!-- Elevation border brushes --> + + <LinearGradientBrush x:Key="ControlElevationBorderBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,3"> + <LinearGradientBrush.GradientStops> + <GradientStop Offset="0.33" Color="{StaticResource ControlStrokeColorSecondary}" /> + <GradientStop Offset="1.0" Color="{StaticResource ControlStrokeColorDefault}" /> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + + <LinearGradientBrush x:Key="CircleElevationBorderBrush" MappingMode="RelativeToBoundingBox" StartPoint="0,0" EndPoint="0,1"> + <LinearGradientBrush.GradientStops> + <GradientStop Offset="0.70" Color="{StaticResource ControlStrokeColorSecondary}" /> + <GradientStop Offset="0.50" Color="{StaticResource ControlStrokeColorDefault}" /> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + + <LinearGradientBrush x:Key="AccentControlElevationBorderBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,3"> + <LinearGradientBrush.RelativeTransform> + <ScaleTransform CenterY="0.5" ScaleY="-1" /> + </LinearGradientBrush.RelativeTransform> + <LinearGradientBrush.GradientStops> + <GradientStop Offset="0.33" Color="{StaticResource ControlStrokeColorOnAccentSecondary}" /> + <GradientStop Offset="1.0" Color="{StaticResource ControlStrokeColorOnAccentDefault}" /> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + + <!-- Notepads Brushes --> + + <SolidColorBrush + x:Key="TabViewItemHeaderBackgroundSelected" + Opacity="0.25" + Color="Black" /> + <SolidColorBrush + x:Key="SplitViewBackgroundThemeBrush" + Opacity="0.25" + Color="Black" /> + <SolidColorBrush + x:Key="GridSplitterBackgroundThemeBrush" + Opacity="0.3" + Color="Black" /> + <SolidColorBrush + x:Key="RightBoxBackgroundThemeBrush" + Opacity="0.15" + Color="Black" /> + <SolidColorBrush + x:Key="HeaderBackgroundThemeBrush" + Opacity="0.2" + Color="Black" /> + <SolidColorBrush + x:Key="CustomTextBoxBackground" + Opacity="0.7" + Color="#1E1E1E" /> + <SolidColorBrush + x:Key="InAppNotificationBorderBrush" + Opacity="0.2" + Color="White" /> + <SolidColorBrush x:Key="InAppNotificationBackgroundBrush" Color="#1F1F1F" /> + <SolidColorBrush x:Key="TransparentTextBoxFillColorInputActiveBrush" Color="#B3141414" /> + <SolidColorBrush x:Key="SettingsPanelBackgroundBrush" Color="#222222" /> + </ResourceDictionary> + + <ResourceDictionary x:Key="HighContrast"> + + <!-- CornerRadiuses --> + + <CornerRadius x:Key="ControlCornerRadius">4,4,4,4</CornerRadius> + <CornerRadius x:Key="OverlayCornerRadius">8,8,8,8</CornerRadius> + + <SolidColorBrush x:Key="TextFillColorPrimaryBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="TextFillColorSecondaryBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="TextFillColorTertiaryBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="TextFillColorDisabledBrush" Color="{ThemeResource SystemColorGrayTextColor}" /> + <SolidColorBrush x:Key="TextFillColorInverseBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + + <SolidColorBrush x:Key="AccentTextFillColorPrimaryBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="AccentTextFillColorSecondaryBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="AccentTextFillColorTertiaryBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="AccentTextFillColorDisabledBrush" Color="{ThemeResource SystemColorGrayTextColor}" /> + + <SolidColorBrush x:Key="TextOnAccentFillColorSelectedTextBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + + <SolidColorBrush x:Key="TextOnAccentFillColorPrimaryBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="TextOnAccentFillColorSecondaryBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="TextOnAccentFillColorDisabledBrush" Color="{ThemeResource SystemColorGrayTextColor}" /> + + <SolidColorBrush x:Key="ControlFillColorDefaultBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="ControlFillColorSecondaryBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="ControlFillColorTertiaryBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="ControlFillColorDisabledBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="ControlFillColorTransparentBrush" Color="Transparent" /> + <SolidColorBrush x:Key="ControlFillColorInputActiveBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + + <SolidColorBrush x:Key="ControlStrongFillColorDefaultBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="ControlStrongFillColorDisabledBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + + <SolidColorBrush x:Key="ControlSolidFillColorDefaultBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + + <SolidColorBrush x:Key="SubtleFillColorTransparentBrush" Color="Transparent" /> + <SolidColorBrush x:Key="SubtleFillColorSecondaryBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="SubtleFillColorTertiaryBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="SubtleFillColorDisabledBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + + <SolidColorBrush x:Key="ControlAltFillColorTransparentBrush" Color="Transparent" /> + <SolidColorBrush x:Key="ControlAltFillColorSecondaryBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="ControlAltFillColorTertiaryBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="ControlAltFillColorQuarternaryBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="ControlAltFillColorDisabledBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + + <SolidColorBrush x:Key="ControlOnImageFillColorDefaultBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="ControlOnImageFillColorSecondaryBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="ControlOnImageFillColorTertiaryBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="ControlOnImageFillColorDisabledBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + + <SolidColorBrush x:Key="AccentFillColorSelectedTextBackgroundBrush" Color="{ThemeResource SystemColorWindowColor}" /> + + <SolidColorBrush x:Key="AccentFillColorDefaultBrush" Color="{ThemeResource SystemColorWindowColor}" /> + <SolidColorBrush x:Key="AccentFillColorSecondaryBrush" Color="{ThemeResource SystemColorWindowColor}" /> + <SolidColorBrush x:Key="AccentFillColorTertiaryBrush" Color="{ThemeResource SystemColorWindowColor}" /> + <SolidColorBrush x:Key="AccentFillColorDisabledBrush" Color="{ThemeResource SystemColorWindowColor}" /> + + <SolidColorBrush x:Key="ControlStrokeColorDefaultBrush" Color="{ThemeResource SystemColorButtonTextColor}" /> + <SolidColorBrush x:Key="ControlStrokeColorSecondaryBrush" Color="{ThemeResource SystemColorButtonTextColor}" /> + <SolidColorBrush x:Key="ControlStrokeColorOnAccentDefaultBrush" Color="{ThemeResource SystemColorButtonTextColor}" /> + <SolidColorBrush x:Key="ControlStrokeColorOnAccentSecondaryBrush" Color="{ThemeResource SystemColorButtonTextColor}" /> + <SolidColorBrush x:Key="ControlStrokeColorOnAccentTertiaryBrush" Color="{ThemeResource SystemColorButtonTextColor}" /> + <SolidColorBrush x:Key="ControlStrokeColorOnAccentDisabledBrush" Color="{ThemeResource SystemColorGrayTextColor}" /> + + <SolidColorBrush x:Key="ControlStrokeColorForStrongFillWhenOnImageBrush" Color="{ThemeResource SystemColorButtonTextColor}" /> + + <SolidColorBrush x:Key="CardStrokeColorDefaultBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="CardStrokeColorDefaultSolidBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + + <SolidColorBrush x:Key="ControlStrongStrokeColorDefaultBrush" Color="{ThemeResource SystemColorButtonTextColor}" /> + <SolidColorBrush x:Key="ControlStrongStrokeColorDisabledBrush" Color="{ThemeResource SystemColorButtonTextColor}" /> + + <SolidColorBrush x:Key="SurfaceStrokeColorDefaultBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="SurfaceStrokeColorFlyoutBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="SurfaceStrokeColorInverseBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + + <SolidColorBrush x:Key="DividerStrokeColorDefaultBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + + <SolidColorBrush x:Key="FocusStrokeColorOuterBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="FocusStrokeColorInnerBrush" Color="{ThemeResource SystemColorWindowColor}" /> + + <SolidColorBrush x:Key="CardBackgroundFillColorDefaultBrush" Color="{ThemeResource SystemColorWindowColor}" /> + <SolidColorBrush x:Key="CardBackgroundFillColorSecondaryBrush" Color="{ThemeResource SystemColorWindowColor}" /> + + <SolidColorBrush x:Key="SmokeFillColorDefaultBrush" Color="{ThemeResource SystemColorWindowColor}" /> + + <SolidColorBrush x:Key="LayerFillColorDefaultBrush" Color="{ThemeResource SystemColorWindowColor}" /> + <SolidColorBrush x:Key="LayerFillColorAltBrush" Color="{ThemeResource SystemColorWindowColor}" /> + <SolidColorBrush x:Key="LayerOnAcrylicFillColorDefaultBrush" Color="{ThemeResource SystemColorWindowColor}" /> + <SolidColorBrush x:Key="LayerOnAccentAcrylicFillColorDefaultBrush" Color="{ThemeResource SystemColorWindowColor}" /> + + <SolidColorBrush x:Key="SolidBackgroundFillColorBaseBrush" Color="{ThemeResource SystemColorWindowColor}" /> + <SolidColorBrush x:Key="SolidBackgroundFillColorSecondaryBrush" Color="{ThemeResource SystemColorWindowColor}" /> + <SolidColorBrush x:Key="SolidBackgroundFillColorTertiaryBrush" Color="{ThemeResource SystemColorWindowColor}" /> + <SolidColorBrush x:Key="SolidBackgroundFillColorQuarternaryBrush" Color="{ThemeResource SystemColorWindowColor}" /> + + <SolidColorBrush x:Key="SystemFillColorAttentionBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="SystemFillColorSuccessBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="SystemFillColorCautionBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="SystemFillColorCriticalBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="SystemFillColorNeutralBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="SystemFillColorSolidNeutralBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="SystemFillColorAttentionBackgroundBrush" Color="{ThemeResource SystemColorWindowColor}" /> + <SolidColorBrush x:Key="SystemFillColorSuccessBackgroundBrush" Color="{ThemeResource SystemColorWindowColor}" /> + <SolidColorBrush x:Key="SystemFillColorCautionBackgroundBrush" Color="{ThemeResource SystemColorWindowColor}" /> + <SolidColorBrush x:Key="SystemFillColorCriticalBackgroundBrush" Color="{ThemeResource SystemColorWindowColor}" /> + <SolidColorBrush x:Key="SystemFillColorNeutralBackgroundBrush" Color="{ThemeResource SystemColorWindowColor}" /> + <SolidColorBrush x:Key="SystemFillColorSolidAttentionBackgroundBrush" Color="{ThemeResource SystemColorWindowColor}" /> + <SolidColorBrush x:Key="SystemFillColorSolidNeutralBackgroundBrush" Color="{ThemeResource SystemColorWindowColor}" /> + + <!-- Elevation border brushes --> + <SolidColorBrush x:Key="ControlElevationBorderBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="CircleElevationBorderBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="AccentControlElevationBorderBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + + <SolidColorBrush x:Key="SystemColorWindowTextColorBrush" Color="{ThemeResource SystemColorWindowTextColor}" /> + <SolidColorBrush x:Key="SystemColorWindowColorBrush" Color="{ThemeResource SystemColorWindowColor}" /> + <SolidColorBrush x:Key="SystemColorButtonFaceColorBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="SystemColorButtonTextColorBrush" Color="{ThemeResource SystemColorButtonTextColor}" /> + <SolidColorBrush x:Key="SystemColorHighlightColorBrush" Color="{ThemeResource SystemColorHighlightColor}" /> + <SolidColorBrush x:Key="SystemColorHighlightTextColorBrush" Color="{ThemeResource SystemColorHighlightTextColor}" /> + <SolidColorBrush x:Key="SystemColorHotlightColorBrush" Color="{ThemeResource SystemColorHotlightColor}" /> + <SolidColorBrush x:Key="SystemColorGrayTextColorBrush" Color="{ThemeResource SystemColorGrayTextColor}" /> + + <!-- + Colors copied from Default theme to match list of keys. Should not + be using these keys. These are set to Red to notify that. + --> + <Color x:Key="TextFillColorPrimary">#FF0000</Color> + <Color x:Key="TextFillColorSecondary">#FF0000</Color> + <Color x:Key="TextFillColorTertiary">#FF0000</Color> + <Color x:Key="TextFillColorDisabled">#FF0000</Color> + <Color x:Key="TextFillColorInverse">#FF0000</Color> + <Color x:Key="AccentTextFillColorDisabled">#FF0000</Color> + <Color x:Key="ControlFillColorDefault">#FF0000</Color> + <Color x:Key="ControlFillColorSecondary">#FF0000</Color> + <Color x:Key="ControlFillColorTertiary">#FF0000</Color> + <Color x:Key="ControlFillColorDisabled">#FF0000</Color> + <Color x:Key="ControlFillColorTransparent">#FF0000</Color> + <Color x:Key="ControlFillColorInputActive">#FF0000</Color> + <Color x:Key="ControlSolidFillColorDefault">#FF0000</Color> + <Color x:Key="SubtleFillColorTransparent">#FF0000</Color> + <Color x:Key="SubtleFillColorSecondary">#FF0000</Color> + <Color x:Key="SubtleFillColorTertiary">#FF0000</Color> + <Color x:Key="SubtleFillColorDisabled">#FF0000</Color> + <Color x:Key="ControlAltFillColorTransparent">#FF0000</Color> + <Color x:Key="ControlAltFillColorSecondary">#FF0000</Color> + <Color x:Key="ControlAltFillColorTertiary">#FF0000</Color> + <Color x:Key="ControlAltFillColorQuarternary">#FF0000</Color> + <Color x:Key="ControlAltFillColorDisabled">#FF0000</Color> + <Color x:Key="ControlOnImageFillColorDefault">#FF0000</Color> + <Color x:Key="ControlOnImageFillColorSecondary">#FF0000</Color> + <Color x:Key="ControlOnImageFillColorTertiary">#FF0000</Color> + <Color x:Key="ControlOnImageFillColorDisabled">#FF0000</Color> + <Color x:Key="ControlStrokeColorDefault">#FF0000</Color> + <Color x:Key="ControlStrokeColorSecondary">#FF0000</Color> + <Color x:Key="ControlStrokeColorOnAccentDefault">#FF0000</Color> + <Color x:Key="ControlStrokeColorOnAccentSecondary">#FF0000</Color> + <Color x:Key="ControlStrokeColorOnAccentTertiary">#FF0000</Color> + <Color x:Key="ControlStrokeColorOnAccentDisabled">#FF0000</Color> + <Color x:Key="CardStrokeColorDefault">#FF0000</Color> + <Color x:Key="CardStrokeColorDefaultSolid">#FF0000</Color> + <Color x:Key="SurfaceStrokeColorDefault">#FF0000</Color> + <Color x:Key="SurfaceStrokeColorFlyout">#FF0000</Color> + <Color x:Key="SurfaceStrokeColorInverse">#FF0000</Color> + <Color x:Key="DividerStrokeColorDefault">#FF0000</Color> + <Color x:Key="FocusStrokeColorOuter">#FF0000</Color> + <Color x:Key="FocusStrokeColorInner">#FF0000</Color> + <Color x:Key="CardBackgroundFillColorDefault">#FF0000</Color> + <Color x:Key="CardBackgroundFillColorSecondary">#FF0000</Color> + <Color x:Key="SmokeFillColorDefault">#FF0000</Color> + <Color x:Key="LayerFillColorDefault">#FF0000</Color> + <Color x:Key="LayerFillColorAlt">#FF0000</Color> + <Color x:Key="LayerOnAcrylicFillColorDefault">#FF0000</Color> + <Color x:Key="LayerOnAccentAcrylicFillColorDefault">#FF0000</Color> + <Color x:Key="SolidBackgroundFillColorBase">#FF0000</Color> + <Color x:Key="SolidBackgroundFillColorSecondary">#FF0000</Color> + <Color x:Key="SolidBackgroundFillColorTertiary">#FF0000</Color> + <Color x:Key="SolidBackgroundFillColorQuarternary">#FF0000</Color> + <Color x:Key="SolidBackgroundFillColorTransparent">#FF0000</Color> + <Color x:Key="SystemFillColorSuccess">#FF0000</Color> + <Color x:Key="SystemFillColorCaution">#FF0000</Color> + <Color x:Key="SystemFillColorCritical">#FF0000</Color> + <Color x:Key="SystemFillColorNeutral">#FF0000</Color> + <Color x:Key="SystemFillColorSolidNeutral">#FF0000</Color> + <Color x:Key="SystemFillColorAttentionBackground">#FF0000</Color> + <Color x:Key="SystemFillColorSuccessBackground">#FF0000</Color> + <Color x:Key="SystemFillColorCautionBackground">#FF0000</Color> + <Color x:Key="SystemFillColorCriticalBackground">#FF0000</Color> + <Color x:Key="SystemFillColorNeutralBackground">#FF0000</Color> + <Color x:Key="SystemFillColorSolidAttentionBackground">#FF0000</Color> + <Color x:Key="SystemFillColorSolidNeutralBackground">#FF0000</Color> + <Color x:Key="TextOnAccentFillColorSelectedText">#FF0000</Color> + <Color x:Key="TextOnAccentFillColorPrimary">#FF0000</Color> + <Color x:Key="TextOnAccentFillColorSecondary">#FF0000</Color> + <Color x:Key="TextOnAccentFillColorDisabled">#FF0000</Color> + <Color x:Key="ControlStrongFillColorDefault">#FF0000</Color> + <Color x:Key="ControlStrongFillColorDisabled">#FF0000</Color> + <Color x:Key="AccentFillColorDisabled">#FF0000</Color> + <Color x:Key="ControlStrokeColorForStrongFillWhenOnImage">#FF0000</Color> + <Color x:Key="ControlStrongStrokeColorDefault">#FF0000</Color> + <Color x:Key="ControlStrongStrokeColorDisabled">#FF0000</Color> + + <!-- Notepads Brushes --> + + <SolidColorBrush x:Key="TabViewItemHeaderBackgroundSelected" Color="{ThemeResource SystemControlHighlightChromeHighBrush}" /> + <SolidColorBrush x:Key="SplitViewBackgroundThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" /> + <SolidColorBrush x:Key="GridSplitterBackgroundThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" /> + <SolidColorBrush x:Key="RightBoxBackgroundThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" /> + <SolidColorBrush x:Key="HeaderBackgroundThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" /> + <SolidColorBrush x:Key="CustomTextBoxBackground" Color="Black" /> + <SolidColorBrush x:Key="SettingsPanelBackgroundBrush" Color="{StaticResource SystemColorHighlightColor}" /> + <SolidColorBrush x:Key="InAppNotificationBackgroundBrush" Color="{ThemeResource SystemControlBackgroundChromeMediumBrush}" /> + <SolidColorBrush x:Key="TransparentTextBoxFillColorInputActiveBrush" Color="{StaticResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="InAppNotificationBorderBrush" Color="{ThemeResource SystemControlForegroundBaseLowBrush}" /> + </ResourceDictionary> + + </ResourceDictionary.ThemeDictionaries> + + <muxcp:CornerRadiusFilterConverter x:Key="TopCornerRadiusFilterConverter" Filter="Top" /> + <muxcp:CornerRadiusFilterConverter x:Key="RightCornerRadiusFilterConverter" Filter="Right" /> + <muxcp:CornerRadiusFilterConverter x:Key="BottomCornerRadiusFilterConverter" Filter="Bottom" /> + <muxcp:CornerRadiusFilterConverter x:Key="LeftCornerRadiusFilterConverter" Filter="Left" /> + <muxcp:CornerRadiusFilterConverter x:Key="TopLeftCornerRadiusDoubleValueConverter" Filter="TopLeftValue" /> + <muxcp:CornerRadiusFilterConverter x:Key="BottomRightCornerRadiusDoubleValueConverter" Filter="BottomRightValue" /> + + + <muxcp:CornerRadiusToThicknessConverter x:Key="TopThicknessFilterConverter" ConversionKind="FilterLeftAndRightFromTop" /> + <muxcp:CornerRadiusToThicknessConverter x:Key="BottomThicknessFilterConverter" ConversionKind="FilterLeftAndRightFromBottom" /> + <muxcp:CornerRadiusToThicknessConverter x:Key="LeftThicknessFilterConverter" ConversionKind="FilterTopAndBottomFromLeft" /> + <muxcp:CornerRadiusToThicknessConverter x:Key="RightThicknessFilterConverter" ConversionKind="FilterTopAndBottomFromRight" /> + + <muxcp:CornerRadiusToThicknessConverter + x:Key="TabViewLeftInsetCornerConverter" + ConversionKind="FilterLeftFromBottomLeft" + Multiplier="-1" /> + <muxcp:CornerRadiusToThicknessConverter + x:Key="TabViewRightInsetCornerConverter" + ConversionKind="FilterRightFromBottomRight" + Multiplier="-1" /> + + <x:String x:Key="ControlFastOutSlowInKeySpline">0,0,0,1</x:String> + + <x:String x:Key="ControlNormalAnimationDuration">00:00:00.250</x:String> + <x:String x:Key="ControlFastAnimationDuration">00:00:00.167</x:String> + <x:String x:Key="ControlFastAnimationAfterDuration">00:00:00.168</x:String> + <x:String x:Key="ControlFasterAnimationDuration">00:00:00.083</x:String> + +</ResourceDictionary> diff --git a/src/Notepads/Resource/TransparentTextBoxStyle.xaml b/src/Notepads/Resource/TransparentTextBoxStyle.xaml index 87569faf5..8a3011d28 100644 --- a/src/Notepads/Resource/TransparentTextBoxStyle.xaml +++ b/src/Notepads/Resource/TransparentTextBoxStyle.xaml @@ -3,65 +3,327 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Notepads"> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="Theme.xaml" /> + </ResourceDictionary.MergedDictionaries> + <ResourceDictionary.ThemeDictionaries> <ResourceDictionary x:Key="Light"> - <SolidColorBrush - x:Key="CustomTextBoxBackground" - Opacity="0.7" - Color="#E0E0E0" /> + <SolidColorBrush x:Key="TextBoxForegroundHeaderThemeBrush" Color="#FF000000" /> + <SolidColorBrush x:Key="TextBoxPlaceholderTextThemeBrush" Color="#AB000000" /> + <SolidColorBrush x:Key="TextBoxBackgroundThemeBrush" Color="#FFFFFFFF" /> + <SolidColorBrush x:Key="TextBoxBorderThemeBrush" Color="#A3000000" /> + <SolidColorBrush x:Key="TextBoxButtonBackgroundThemeBrush" Color="Transparent" /> + <SolidColorBrush x:Key="TextBoxButtonBorderThemeBrush" Color="Transparent" /> + <SolidColorBrush x:Key="TextBoxButtonForegroundThemeBrush" Color="#99000000" /> + <SolidColorBrush x:Key="TextBoxButtonPointerOverBackgroundThemeBrush" Color="#FFDEDEDE" /> + <SolidColorBrush x:Key="TextBoxButtonPointerOverBorderThemeBrush" Color="Transparent" /> + <SolidColorBrush x:Key="TextBoxButtonPointerOverForegroundThemeBrush" Color="Black" /> + <SolidColorBrush x:Key="TextBoxButtonPressedBackgroundThemeBrush" Color="#FF000000" /> + <SolidColorBrush x:Key="TextBoxButtonPressedBorderThemeBrush" Color="Transparent" /> + <SolidColorBrush x:Key="TextBoxButtonPressedForegroundThemeBrush" Color="#FFFFFFFF" /> + <SolidColorBrush x:Key="TextBoxDisabledBackgroundThemeBrush" Color="#66CACACA" /> + <SolidColorBrush x:Key="TextBoxDisabledBorderThemeBrush" Color="#26000000" /> + <SolidColorBrush x:Key="TextBoxDisabledForegroundThemeBrush" Color="#FF666666" /> + <SolidColorBrush x:Key="TextBoxForegroundThemeBrush" Color="#FF000000" /> + + <!-- BUG 31342318: Text color doesn't update if the main color value is the same. To be removed when the bug is fixed. --> + <Color x:Key="TemporaryTextFillColorDisabled">#5C010101</Color> + <Thickness x:Key="TransparentTextControlBorderThemeThickness">0</Thickness> + + <StaticResource x:Key="TextControlBackground" ResourceKey="ControlFillColorDefaultBrush" /> + <StaticResource x:Key="TextControlBackgroundPointerOver" ResourceKey="ControlFillColorSecondaryBrush" /> + <StaticResource x:Key="TextControlBackgroundFocused" ResourceKey="ControlFillColorInputActiveBrush" /> + <StaticResource x:Key="TransparentTextControlBackgroundFocused" ResourceKey="TransparentTextBoxFillColorInputActiveBrush" /> + <StaticResource x:Key="TextControlBackgroundDisabled" ResourceKey="ControlFillColorDisabledBrush" /> + <StaticResource x:Key="TextControlBorderBrush" ResourceKey="TextControlElevationBorderBrush" /> + <StaticResource x:Key="TextControlBorderBrushPointerOver" ResourceKey="TextControlElevationBorderBrush" /> + <StaticResource x:Key="TextControlBorderBrushFocused" ResourceKey="TextControlElevationBorderFocusedBrush" /> + <StaticResource x:Key="TextControlBorderBrushDisabled" ResourceKey="ControlStrokeColorDefaultBrush" /> + <StaticResource x:Key="TextControlForeground" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="TextControlForegroundPointerOver" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="TextControlForegroundFocused" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="TextControlForegroundDisabled" ResourceKey="TemporaryTextFillColorDisabled" /> + <StaticResource x:Key="TextControlPlaceholderForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TextControlPlaceholderForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TextControlPlaceholderForegroundFocused" ResourceKey="TextFillColorTertiaryBrush" /> + <StaticResource x:Key="TextControlPlaceholderForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" /> + <StaticResource x:Key="TextControlSelectionHighlightColor" ResourceKey="AccentFillColorSelectedTextBackgroundBrush" /> + + <StaticResource x:Key="TextControlButtonBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" /> + <StaticResource x:Key="TextControlButtonBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" /> + <StaticResource x:Key="TextControlButtonBorderBrush" ResourceKey="ControlFillColorTransparent" /> + <StaticResource x:Key="TextControlButtonBorderBrushPointerOver" ResourceKey="ControlFillColorTransparent" /> + <StaticResource x:Key="TextControlButtonBorderBrushPressed" ResourceKey="ControlFillColorTransparent" /> + <StaticResource x:Key="TextControlButtonForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TextControlButtonForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TextControlButtonForegroundPressed" ResourceKey="TextFillColorTertiaryBrush" /> + + <LinearGradientBrush x:Key="TextControlElevationBorderBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,2"> + <LinearGradientBrush.RelativeTransform> + <ScaleTransform CenterY="0.5" ScaleY="-1" /> + </LinearGradientBrush.RelativeTransform> + <LinearGradientBrush.GradientStops> + <GradientStop Offset="0.5" Color="{StaticResource ControlStrongStrokeColorDefault}" /> + <GradientStop Offset="1.0" Color="{StaticResource ControlStrokeColorDefault}" /> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + + <LinearGradientBrush x:Key="TextControlElevationBorderFocusedBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,2"> + <LinearGradientBrush.RelativeTransform> + <ScaleTransform CenterY="0.5" ScaleY="-1" /> + </LinearGradientBrush.RelativeTransform> + <LinearGradientBrush.GradientStops> + <GradientStop Offset="1.0" Color="{ThemeResource SystemAccentColorDark1}" /> + <GradientStop Offset="1.0" Color="{StaticResource ControlStrokeColorDefault}" /> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> </ResourceDictionary> + <ResourceDictionary x:Key="Dark"> - <SolidColorBrush - x:Key="CustomTextBoxBackground" - Opacity="0.7" - Color="#1E1E1E" /> + <SolidColorBrush x:Key="TextBoxForegroundHeaderThemeBrush" Color="#FFFFFFFF" /> + <SolidColorBrush x:Key="TextBoxPlaceholderTextThemeBrush" Color="#AB000000" /> + <SolidColorBrush x:Key="TextBoxBackgroundThemeBrush" Color="#FFFFFFFF" /> + <SolidColorBrush x:Key="TextBoxBorderThemeBrush" Color="#FFFFFFFF" /> + <SolidColorBrush x:Key="TextBoxButtonBackgroundThemeBrush" Color="Transparent" /> + <SolidColorBrush x:Key="TextBoxButtonBorderThemeBrush" Color="Transparent" /> + <SolidColorBrush x:Key="TextBoxButtonForegroundThemeBrush" Color="#99FFFFFF" /> + <SolidColorBrush x:Key="TextBoxButtonPointerOverBackgroundThemeBrush" Color="#FFDEDEDE" /> + <SolidColorBrush x:Key="TextBoxButtonPointerOverBorderThemeBrush" Color="Transparent" /> + <SolidColorBrush x:Key="TextBoxButtonPointerOverForegroundThemeBrush" Color="#FF000000" /> + <SolidColorBrush x:Key="TextBoxButtonPressedBackgroundThemeBrush" Color="#FF000000" /> + <SolidColorBrush x:Key="TextBoxButtonPressedBorderThemeBrush" Color="Transparent" /> + <SolidColorBrush x:Key="TextBoxButtonPressedForegroundThemeBrush" Color="#FFFFFFFF" /> + <SolidColorBrush x:Key="TextBoxDisabledBackgroundThemeBrush" Color="Transparent" /> + <SolidColorBrush x:Key="TextBoxDisabledBorderThemeBrush" Color="#66FFFFFF" /> + <SolidColorBrush x:Key="TextBoxDisabledForegroundThemeBrush" Color="#FF666666" /> + <SolidColorBrush x:Key="TextBoxForegroundThemeBrush" Color="#FF000000" /> + + <!-- BUG 31342318: Text color doesn't update if the main color value is the same. To be removed when the bug is fixed. --> + <Color x:Key="TemporaryTextFillColorDisabled">#5DFEFEFE</Color> + <Thickness x:Key="TransparentTextControlBorderThemeThickness">0</Thickness> + + <StaticResource x:Key="TextControlBackground" ResourceKey="ControlFillColorDefaultBrush" /> + <StaticResource x:Key="TextControlBackgroundPointerOver" ResourceKey="ControlFillColorSecondaryBrush" /> + <StaticResource x:Key="TextControlBackgroundFocused" ResourceKey="ControlFillColorInputActiveBrush" /> + <StaticResource x:Key="TransparentTextControlBackgroundFocused" ResourceKey="TransparentTextBoxFillColorInputActiveBrush" /> + <StaticResource x:Key="TextControlBackgroundDisabled" ResourceKey="ControlFillColorDisabledBrush" /> + <StaticResource x:Key="TextControlBorderBrush" ResourceKey="TextControlElevationBorderBrush" /> + <StaticResource x:Key="TextControlBorderBrushPointerOver" ResourceKey="TextControlElevationBorderBrush" /> + <StaticResource x:Key="TextControlBorderBrushFocused" ResourceKey="TextControlElevationBorderFocusedBrush" /> + <StaticResource x:Key="TextControlBorderBrushDisabled" ResourceKey="ControlStrokeColorDefaultBrush" /> + <StaticResource x:Key="TextControlForeground" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="TextControlForegroundPointerOver" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="TextControlForegroundFocused" ResourceKey="TextFillColorPrimaryBrush" /> + <StaticResource x:Key="TextControlForegroundDisabled" ResourceKey="TemporaryTextFillColorDisabled" /> + <StaticResource x:Key="TextControlPlaceholderForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TextControlPlaceholderForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TextControlPlaceholderForegroundFocused" ResourceKey="TextFillColorTertiaryBrush" /> + <StaticResource x:Key="TextControlPlaceholderForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" /> + <StaticResource x:Key="TextControlSelectionHighlightColor" ResourceKey="AccentFillColorSelectedTextBackgroundBrush" /> + + <StaticResource x:Key="TextControlButtonBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" /> + <StaticResource x:Key="TextControlButtonBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" /> + <StaticResource x:Key="TextControlButtonBorderBrush" ResourceKey="ControlFillColorTransparent" /> + <StaticResource x:Key="TextControlButtonBorderBrushPointerOver" ResourceKey="ControlFillColorTransparent" /> + <StaticResource x:Key="TextControlButtonBorderBrushPressed" ResourceKey="ControlFillColorTransparent" /> + <StaticResource x:Key="TextControlButtonForeground" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TextControlButtonForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" /> + <StaticResource x:Key="TextControlButtonForegroundPressed" ResourceKey="TextFillColorTertiaryBrush" /> + + <LinearGradientBrush x:Key="TextControlElevationBorderBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,2"> + <LinearGradientBrush.RelativeTransform> + <ScaleTransform CenterY="0.5" ScaleY="-1" /> + </LinearGradientBrush.RelativeTransform> + <LinearGradientBrush.GradientStops> + <GradientStop Offset="0.5" Color="{StaticResource ControlStrongStrokeColorDefault}" /> + <GradientStop Offset="1.0" Color="{StaticResource ControlStrokeColorDefault}" /> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + + <LinearGradientBrush x:Key="TextControlElevationBorderFocusedBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,2"> + <LinearGradientBrush.RelativeTransform> + <ScaleTransform CenterY="0.5" ScaleY="-1" /> + </LinearGradientBrush.RelativeTransform> + <LinearGradientBrush.GradientStops> + <GradientStop Offset="1.0" Color="{ThemeResource SystemAccentColorLight2}" /> + <GradientStop Offset="1.0" Color="{StaticResource ControlStrokeColorDefault}" /> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> </ResourceDictionary> + <ResourceDictionary x:Key="HighContrast"> - <SolidColorBrush x:Key="CustomTextBoxBackground" Color="Black" /> + <SolidColorBrush x:Key="TextBoxForegroundHeaderThemeBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="TextBoxPlaceholderTextThemeBrush" Color="{ThemeResource SystemColorGrayTextColor}" /> + <SolidColorBrush x:Key="TextBoxBackgroundThemeBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="TextBoxBorderThemeBrush" Color="{ThemeResource SystemColorButtonTextColor}" /> + <SolidColorBrush x:Key="TextBoxButtonBackgroundThemeBrush" Color="Transparent" /> + <SolidColorBrush x:Key="TextBoxButtonBorderThemeBrush" Color="Transparent" /> + <SolidColorBrush x:Key="TextBoxButtonForegroundThemeBrush" Color="{ThemeResource SystemColorButtonTextColor}" /> + <SolidColorBrush x:Key="TextBoxButtonPointerOverBackgroundThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" /> + <SolidColorBrush x:Key="TextBoxButtonPointerOverBorderThemeBrush" Color="{ThemeResource SystemColorButtonTextColor}" /> + <SolidColorBrush x:Key="TextBoxButtonPointerOverForegroundThemeBrush" Color="{ThemeResource SystemColorHighlightTextColor}" /> + <SolidColorBrush x:Key="TextBoxButtonPressedBackgroundThemeBrush" Color="{ThemeResource SystemColorButtonTextColor}" /> + <SolidColorBrush x:Key="TextBoxButtonPressedBorderThemeBrush" Color="{ThemeResource SystemColorButtonTextColor}" /> + <SolidColorBrush x:Key="TextBoxButtonPressedForegroundThemeBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="TextBoxDisabledBackgroundThemeBrush" Color="{ThemeResource SystemColorButtonFaceColor}" /> + <SolidColorBrush x:Key="TextBoxDisabledBorderThemeBrush" Color="{ThemeResource SystemColorGrayTextColor}" /> + <SolidColorBrush x:Key="TextBoxDisabledForegroundThemeBrush" Color="{ThemeResource SystemColorButtonTextColor}" /> + <SolidColorBrush x:Key="TextBoxForegroundThemeBrush" Color="{ThemeResource SystemColorButtonTextColor}" /> + <StaticResource x:Key="TransparentTextControlBackgroundFocused" ResourceKey="TransparentTextBoxFillColorInputActiveBrush" /> + + <!-- BUG 31342318: Text color doesn't update if the main color value is the same. To be removed when the bug is fixed. --> + <Color x:Key="TemporaryTextFillColorDisabled">#5C010101</Color> + <Thickness x:Key="TransparentTextControlBorderThemeThickness">2</Thickness> + + <StaticResource x:Key="TextControlBackgroundFocused" ResourceKey="SystemControlBackgroundAltHighBrush" /> + <StaticResource x:Key="TextControlBorderBrush" ResourceKey="SystemControlForegroundBaseMediumBrush" /> + <StaticResource x:Key="TextControlBorderBrushPointerOver" ResourceKey="SystemControlHighlightBaseMediumHighBrush" /> + <StaticResource x:Key="TextControlButtonForeground" ResourceKey="SystemControlForegroundBaseMediumHighBrush" /> + <StaticResource x:Key="TextControlForegroundFocused" ResourceKey="SystemControlForegroundBaseHighBrush" /> + <StaticResource x:Key="TextControlPlaceholderForegroundFocused" ResourceKey="SystemControlForegroundBaseMediumLowBrush" /> + + <LinearGradientBrush x:Key="TextControlElevationBorderBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,2"> + <LinearGradientBrush.RelativeTransform> + <ScaleTransform CenterY="0.5" ScaleY="-1" /> + </LinearGradientBrush.RelativeTransform> + <LinearGradientBrush.GradientStops> + <GradientStop Offset="0.5" Color="{StaticResource ControlAAStrokeColorDefault}" /> + <GradientStop Offset="1.0" Color="{StaticResource ControlStrokeColorDefault}" /> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + + <LinearGradientBrush x:Key="TextControlElevationBorderFocusedBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,2"> + <LinearGradientBrush.RelativeTransform> + <ScaleTransform CenterY="0.5" ScaleY="-1" /> + </LinearGradientBrush.RelativeTransform> + <LinearGradientBrush.GradientStops> + <GradientStop Offset="1.0" Color="{ThemeResource SystemAccentColorLight2}" /> + <GradientStop Offset="1.0" Color="{StaticResource ControlStrokeColorDefault}" /> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> </ResourceDictionary> </ResourceDictionary.ThemeDictionaries> - <Style BasedOn="{StaticResource TransparentTextBoxStyle}" TargetType="TextBox" /> + <Thickness x:Key="TextBoxTopHeaderMargin">0,0,0,8</Thickness> + <Thickness x:Key="TextBoxInnerButtonMargin">0,4,4,4</Thickness> + <x:Double x:Key="TextBoxIconFontSize">12</x:Double> <Style x:Key="TransparentTextBoxStyle" TargetType="TextBox"> <Setter Property="Foreground" Value="{ThemeResource TextControlForeground}" /> - <Setter Property="Background" Value="{ThemeResource CustomTextBoxBackground}" /> + <Setter Property="Background" Value="{ThemeResource TextControlBackground}" /> <Setter Property="BorderBrush" Value="{ThemeResource TextControlBorderBrush}" /> <Setter Property="SelectionHighlightColor" Value="{ThemeResource TextControlSelectionHighlightColor}" /> - <Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}" /> + <Setter Property="BorderThickness" Value="{ThemeResource TransparentTextControlBorderThemeThickness}" /> <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto" /> - <Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled" /> + <Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto" /> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" /> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" /> <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" /> + <Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}" /> + <Setter Property="MinWidth" Value="{ThemeResource TextControlThemeMinWidth}" /> <Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}" /> <Setter Property="UseSystemFocusVisuals" Value="{ThemeResource IsApplicationFocusVisualKindReveal}" /> <Setter Property="ContextFlyout" Value="{StaticResource TextControlCommandBarContextFlyout}" /> - <!--<Setter Property="SelectionFlyout" Value="{StaticResource TextControlCommandBarSelectionFlyout}"/>--> + <Setter Property="SelectionFlyout" Value="{StaticResource TextControlCommandBarSelectionFlyout}" /> + <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> + <Setter Property="BackgroundSizing" Value="InnerBorderEdge" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="TextBox"> <Grid> - <Grid.Resources> - <ResourceDictionary /> - </Grid.Resources> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> + <!--<Grid.Resources> + <Style x:Name="DeleteButtonStyle" TargetType="Button"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="Button"> + <Grid + x:Name="ButtonLayoutGrid" + Margin="{ThemeResource TextBoxInnerButtonMargin}" + Background="{ThemeResource TextControlButtonBackground}" + BackgroundSizing="{TemplateBinding BackgroundSizing}" + BorderBrush="{ThemeResource TextControlButtonBorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{TemplateBinding CornerRadius}"> + <TextBlock + x:Name="GlyphElement" + HorizontalAlignment="Center" + VerticalAlignment="Center" + AutomationProperties.AccessibilityView="Raw" + FontFamily="{ThemeResource SymbolThemeFontFamily}" + FontSize="{ThemeResource TextBoxIconFontSize}" + FontStyle="Normal" + Foreground="{ThemeResource TextControlButtonForeground}" + Text="" /> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="CommonStates"> + <VisualState x:Name="Normal" /> + + <VisualState x:Name="PointerOver"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonLayoutGrid" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonBackgroundPointerOver}" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonLayoutGrid" Storyboard.TargetProperty="BorderBrush"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonBorderBrushPointerOver}" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="GlyphElement" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonForegroundPointerOver}" /> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + + <VisualState x:Name="Pressed"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonLayoutGrid" Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonBackgroundPressed}" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonLayoutGrid" Storyboard.TargetProperty="BorderBrush"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonBorderBrushPressed}" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="GlyphElement" Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonForegroundPressed}" /> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + + <VisualState x:Name="Disabled"> + <Storyboard> + <DoubleAnimation + Storyboard.TargetName="ButtonLayoutGrid" + Storyboard.TargetProperty="Opacity" + To="0" + Duration="0" /> + </Storyboard> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + </Grid.Resources>--> + <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> + + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + <ContentPresenter x:Name="HeaderContentPresenter" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" - Margin="{StaticResource TextBoxTopHeaderMargin}" + Margin="{ThemeResource TextBoxTopHeaderMargin}" VerticalAlignment="Top" x:DeferLoadStrategy="Lazy" Content="{TemplateBinding Header}" @@ -76,21 +338,21 @@ Grid.RowSpan="1" Grid.Column="0" Grid.ColumnSpan="2" - MinWidth="{ThemeResource TextControlThemeMinWidth}" - MinHeight="{ThemeResource TextControlThemeMinHeight}" + MinWidth="{TemplateBinding MinWidth}" + MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Control.IsTemplateFocusTarget="True" - CornerRadius="{ThemeResource ControlCornerRadius}" /> + CornerRadius="{TemplateBinding CornerRadius}" /> <ScrollViewer x:Name="ContentElement" Grid.Row="1" Grid.Column="0" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" - VerticalAlignment="Center" AutomationProperties.AccessibilityView="Raw" + Foreground="{TemplateBinding Foreground}" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" @@ -100,6 +362,7 @@ VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" ZoomMode="Disabled" /> + <TextBlock x:Name="PlaceholderTextContentPresenter" Grid.Row="1" @@ -107,12 +370,25 @@ Grid.ColumnSpan="2" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" - VerticalAlignment="Center" - Foreground="{Binding PlaceholderForeground, RelativeSource={RelativeSource Mode=TemplatedParent}, TargetNullValue={ThemeResource TextControlPlaceholderForeground}}" + Foreground="{Binding PlaceholderForeground, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={ThemeResource TextControlPlaceholderForeground}}" IsHitTestVisible="False" Text="{TemplateBinding PlaceholderText}" TextAlignment="{TemplateBinding TextAlignment}" TextWrapping="{TemplateBinding TextWrapping}" /> + <!--<Button + x:Name="DeleteButton" + Grid.Row="1" + Grid.Column="1" + Width="30" + Padding="{ThemeResource HelperButtonThemePadding}" + VerticalAlignment="Stretch" + AutomationProperties.AccessibilityView="Raw" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="{TemplateBinding CornerRadius}" + FontSize="{TemplateBinding FontSize}" + IsTabStop="False" + Style="{StaticResource DeleteButtonStyle}" + Visibility="Collapsed" />--> <ContentPresenter x:Name="DescriptionPresenter" Grid.Row="2" @@ -122,10 +398,13 @@ AutomationProperties.AccessibilityView="Raw" Content="{TemplateBinding Description}" Foreground="{ThemeResource SystemControlDescriptionTextForegroundBrush}" /> + <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal" /> + <VisualState x:Name="Disabled"> + <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" Storyboard.TargetProperty="Foreground"> <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlHeaderForegroundDisabled}" /> @@ -134,26 +413,28 @@ <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackgroundDisabled}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemChromeBlackLowColor}" /> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushDisabled}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground"> <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundDisabled}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PlaceholderForeground, RelativeSource={RelativeSource Mode=TemplatedParent}, TargetNullValue={ThemeResource TextControlPlaceholderForegroundDisabled}}" /> + <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PlaceholderForeground, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={ThemeResource TextControlPlaceholderForegroundDisabled}}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> + <VisualState x:Name="PointerOver"> + <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush"> <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushPointerOver}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackground}" /> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackgroundPointerOver}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PlaceholderForeground, RelativeSource={RelativeSource Mode=TemplatedParent}, TargetNullValue={ThemeResource TextControlPlaceholderForegroundPointerOver}}" /> + <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PlaceholderForeground, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={ThemeResource TextControlPlaceholderForegroundPointerOver}}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground"> <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundPointerOver}" /> @@ -161,22 +442,44 @@ </Storyboard> </VisualState> <VisualState x:Name="Focused"> + <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PlaceholderForeground, RelativeSource={RelativeSource Mode=TemplatedParent}, TargetNullValue={ThemeResource SystemControlForegroundTransparentBrush}}" /> + <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PlaceholderForeground, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={ThemeResource TextControlPlaceholderForegroundFocused}}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackground}" /> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TransparentTextControlBackgroundFocused}" /> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush"> <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushFocused}" /> </ObjectAnimationUsingKeyFrames> + <!--<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderThickness"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderThemeThicknessFocused}" /> + </ObjectAnimationUsingKeyFrames>--> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground"> - <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForeground}" /> + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundFocused}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> + </VisualStateGroup> + <!--<VisualStateGroup x:Name="ButtonStates"> + <VisualState x:Name="ButtonVisible"> + + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DeleteButton" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0"> + <DiscreteObjectKeyFrame.Value> + <Visibility>Visible</Visibility> + </DiscreteObjectKeyFrame.Value> + </DiscreteObjectKeyFrame> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </VisualState> + <VisualState x:Name="ButtonCollapsed" /> + + </VisualStateGroup>--> + </VisualStateManager.VisualStateGroups> </Grid> </ControlTemplate> diff --git a/src/Notepads/Services/ThemeSettingsService.cs b/src/Notepads/Services/ThemeSettingsService.cs index ec48ba2d3..04b7452f9 100644 --- a/src/Notepads/Services/ThemeSettingsService.cs +++ b/src/Notepads/Services/ThemeSettingsService.cs @@ -250,7 +250,7 @@ public static void SetRequestedTheme(Panel backgroundPanel, UIElement currentCon if (DialogManager.ActiveDialog != null) { - DialogManager.ActiveDialog.RequestedTheme = ThemeMode; + //DialogManager.ActiveDialog.RequestedTheme = ThemeMode; } // Set accent color diff --git a/src/Notepads/Strings/ar-YE/Resources.resw b/src/Notepads/Strings/ar-YE/Resources.resw index 3696d494f..48c25d628 100644 --- a/src/Notepads/Strings/ar-YE/Resources.resw +++ b/src/Notepads/Strings/ar-YE/Resources.resw @@ -1,17 +1,17 @@ <?xml version="1.0" encoding="utf-8"?> <root> - <!-- - Microsoft ResX Schema - + <!-- + Microsoft ResX Schema + Version 2.0 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes associated with the data types. - + Example: - + ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> @@ -26,36 +26,36 @@ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> - - There are any number of "resheader" rows that contain simple + + There are any number of "resheader" rows that contain simple name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. - + mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with + value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. - + mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with + value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array + value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>إلغاء</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>توجد تغييرات غير محفوظة.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>حفظ الكل ثم الخروج</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>إلغاء التغييرات ثم الخروج</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>هل تريد حفظ التغييرات؟</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>عذراً, الملف "{0}" تعذّر فتحه: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>موافق</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>خطأ فتح ملف</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>عذراً, الملف "{0}" تعذّر حفظه: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>موافق</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>خطأ حفظ ملف</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>الإعدادات</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>إلغاء</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>جميع التغييرات مثل النص ونهاية السطر ووضع الترميز التي تمت على "{0}" سوف تعاد!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>نعم</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>هل تريد بالفعل إعادة التغييرات؟</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>إلغاء</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>هل تريد حفظ الملف "{0}"؟</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>حفظ</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>عدم الحفظ</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>هل تريد حفظ التغييرات؟</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>نحيل</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>إلغاء</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>حفظ</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>إعادة التسمية</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/ar-YE/Settings.resw b/src/Notepads/Strings/ar-YE/Settings.resw index 83a5b8bbc..e4f7c702b 100644 --- a/src/Notepads/Strings/ar-YE/Settings.resw +++ b/src/Notepads/Strings/ar-YE/Settings.resw @@ -153,7 +153,7 @@ <value>بيان سياسة الخصوصية</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>عن البرنامج</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>إعدادات شريط الحالة</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>خيارات متقدمة</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>استخدم نمط Windows</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>التخصيص</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>التفاف الكلمة</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>النص والمحرر</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/bg-BG/Resources.resw b/src/Notepads/Strings/bg-BG/Resources.resw index 5f2020026..39e919f67 100644 --- a/src/Notepads/Strings/bg-BG/Resources.resw +++ b/src/Notepads/Strings/bg-BG/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Затвори</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>Има незапазени промени.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Запазване на всички и изход</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Изхвърлете и излезте</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Искате ли да запазите промените?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>За съжаление файлът "{0}" не може да бъде отворен: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ок</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>Грешка при отваряне на файл</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>За съжаление файлът "{0}" не може да бъде запазен: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ок</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>Грешка при запазване на файл</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>Настройки</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>Отказ</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>Всички промени, включително текст, край на реда и кодиране, направени на "{0}", ще бъдат възстановени!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>Да</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>Сигурни ли сте да възстановите всички промени?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Отказ</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>Запазване на файла "{0}"?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Запазване</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Не запазвай</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Запази промените?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Thin</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Cancel</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Save</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Rename</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/bg-BG/Settings.resw b/src/Notepads/Strings/bg-BG/Settings.resw index f4bca8f9d..3bd22c246 100644 --- a/src/Notepads/Strings/bg-BG/Settings.resw +++ b/src/Notepads/Strings/bg-BG/Settings.resw @@ -153,7 +153,7 @@ <value>Декларация за поверителност</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>За</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>Настройки на лентата на състоянието</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Разширени</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>Използвай моя режим Windows</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Персонализация</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>Пренеси дума</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Текст и редактор</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/cs-CZ/Resources.resw b/src/Notepads/Strings/cs-CZ/Resources.resw index ba8fc058e..35e151cd0 100644 --- a/src/Notepads/Strings/cs-CZ/Resources.resw +++ b/src/Notepads/Strings/cs-CZ/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Zrušit</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>Máte neuložené změny.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Uložit vše a Zavřít</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Zahodit a Zavřít</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Chcete uložit změny?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -173,11 +173,11 @@ <value>Omlouváme se, soubor "{0}" nemohl být otevřen: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>Chyba při otevírání souboru</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -185,11 +185,11 @@ <value>Omlouváme se, soubor "{0}" nemohl být uložen: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>Chyba při ukládání souboru</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -269,7 +269,7 @@ <value>Nastavení</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>Zrušit</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>Všechny změny včetně textu, ukončení řádků a kódování udělaných v "{0}" budou vráceny zpět!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>Ano</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>Opravdu chcete vrátit všechny změny?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Zrušit</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -293,15 +293,15 @@ <value>Uložit soubor "{0}"?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Uložit</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Neukládat</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Přejete si uložit změny?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Štíhlý</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Cancel</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Uložit</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Přejumenovat</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/cs-CZ/Settings.resw b/src/Notepads/Strings/cs-CZ/Settings.resw index a153bef69..8f48b1a60 100644 --- a/src/Notepads/Strings/cs-CZ/Settings.resw +++ b/src/Notepads/Strings/cs-CZ/Settings.resw @@ -153,7 +153,7 @@ <value>Prohlášení o zásadách ochrany osobních údajů</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>O programu</value> <comment>AboutPage Title display text.</comment> </data> @@ -185,7 +185,7 @@ <value>Nastavení Stavového Řádku</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Pokročilé</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -225,7 +225,7 @@ <value>Použít Windows motiv</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Přizpůsobení</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -301,7 +301,7 @@ <value>Zalamovat text</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Text a Editor</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/de-CH/Resources.resw b/src/Notepads/Strings/de-CH/Resources.resw index c06bbe7ac..c0987f144 100644 --- a/src/Notepads/Strings/de-CH/Resources.resw +++ b/src/Notepads/Strings/de-CH/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Abbrechen</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>Es exisitieren nicht gespeicherte Änderungen.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Speichern</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Nicht speichern</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Änderungen speichern?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>Die Datei "{0}" konnte leider nicht geöffnet werden: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>Fehler beim öffnen der Datei</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>Die Datei "{0}" konnte leider nicht gespeichert werden: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>Fehler beim speichern der Datei</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>Einstellungen</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>Abbrechen</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>Alle Änderungen, inklusive Text, Zeilenumbrüche und Zeichenkodierung, an "{0}" werden rückgängig gemacht!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>Ja</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>Alle Änderungen rückgängig machen?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Abbrechen</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>Datei "{0}" speichern?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Speichern</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Nicht speichern</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Änderungen speichern?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Thin</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Abbrechen</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Speichern</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Umbennen</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/de-CH/Settings.resw b/src/Notepads/Strings/de-CH/Settings.resw index 5a84e9fd6..64b3701a6 100644 --- a/src/Notepads/Strings/de-CH/Settings.resw +++ b/src/Notepads/Strings/de-CH/Settings.resw @@ -153,7 +153,7 @@ <value>Datenschutzerklärung</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Über</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>Statusleisteneinstellungen</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Erweitert</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>Windows Modus verwenden</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Personalisierung</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>Wörter umbrechen</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Text & Editor</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/de-DE/Resources.resw b/src/Notepads/Strings/de-DE/Resources.resw index bc47ee231..a4387651c 100644 --- a/src/Notepads/Strings/de-DE/Resources.resw +++ b/src/Notepads/Strings/de-DE/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Abbrechen</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>Es exisitieren nicht gespeicherte Änderungen.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Speichern</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Nicht speichern</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Änderungen speichern?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>Die Datei „{0}“ konnte leider nicht geöffnet werden: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>Fehler beim öffnen der Datei</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>Die Datei „{0}“ konnte leider nicht gespeichert werden: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>Fehler beim speichern der Datei</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>Einstellungen</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>Abbrechen</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>Alle Änderungen, inklusive Text, Zeilenumbrüche und Zeichenkodierung, an „{0}“ werden rückgängig gemacht!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>Ja</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>Alle Änderungen rückgängig machen?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Abbrechen</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>Datei „{0}“ speichern?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Speichern</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Nicht speichern</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Änderungen speichern?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Thin</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Abbrechen</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Speichern</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Umbennen</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/de-DE/Settings.resw b/src/Notepads/Strings/de-DE/Settings.resw index ef052933f..692f8140d 100644 --- a/src/Notepads/Strings/de-DE/Settings.resw +++ b/src/Notepads/Strings/de-DE/Settings.resw @@ -153,7 +153,7 @@ <value>Datenschutzerklärung</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Über</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>Statusleisteneinstellungen</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Erweitert</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>Windows Modus verwenden</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Personalisierung</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>Wörter umbrechen</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Text & Editor</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/en-US/Resources.resw b/src/Notepads/Strings/en-US/Resources.resw index 3a480c07e..6dc040051 100644 --- a/src/Notepads/Strings/en-US/Resources.resw +++ b/src/Notepads/Strings/en-US/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Cancel</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>There are unsaved changes.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Save All & Exit</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Discard & Exit</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Do you want to save the changes?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>Sorry, file "{0}" couldn't be opened: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>File Open Error</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>Sorry, file "{0}" couldn't be saved: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>File Save Error</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>Settings</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>Cancel</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>All changes including text, line ending and encoding made to "{0}" will be reverted!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>Yes</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>Are you sure to revert all changes?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Cancel</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>Save file "{0}"?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Save</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Don't Save</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Save your changes?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Thin</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Cancel</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Save</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Rename</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/en-US/Settings.resw b/src/Notepads/Strings/en-US/Settings.resw index fa358b94f..04c4331be 100644 --- a/src/Notepads/Strings/en-US/Settings.resw +++ b/src/Notepads/Strings/en-US/Settings.resw @@ -153,7 +153,7 @@ <value>Privacy Statement</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>About</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>Status Bar Settings</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Advanced</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>Use my Windows mode</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Personalization</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>Wrap word</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Text & Editor</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/es-ES/Resources.resw b/src/Notepads/Strings/es-ES/Resources.resw index df7efae62..5bece75ae 100644 --- a/src/Notepads/Strings/es-ES/Resources.resw +++ b/src/Notepads/Strings/es-ES/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Cancelar</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>Hay cambios sin guardar.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Guardar Todo & Salir</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Descartar & Salir</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Quieres Guardar los Cambios?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>Lo sentimos, el archivo "{0}" no pudo ser abierto: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>Eror al Abrir Archivo</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>Lo sentimos, el archivo "{0}" no pudo ser guardado: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>Error al Guardar Archivo</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>Ajustes</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>Cancelar</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>Todos los cambios incluyendo texto, fin de línea y codificación hechos a ¨{0}" serán revertidos!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>Sí</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>Está seguro de revertir todos los cambios?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Cancelar</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>Guardar Archivo "{0}"?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Guardar</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>No Guardar</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Guardar Cambios?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Delgado</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Cancel</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Save</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Rename</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/es-ES/Settings.resw b/src/Notepads/Strings/es-ES/Settings.resw index fa3f7fea9..4aa3bc2ed 100644 --- a/src/Notepads/Strings/es-ES/Settings.resw +++ b/src/Notepads/Strings/es-ES/Settings.resw @@ -153,7 +153,7 @@ <value>Declaración de Privacidad</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Información</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>Ajusted de Barra de Estado</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Avanzado</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>Usar el modo de Windows</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Personalización</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>Ajuste Automático</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Texto y Editor</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/fi-FI/Resources.resw b/src/Notepads/Strings/fi-FI/Resources.resw index 69e871860..cefd0b950 100644 --- a/src/Notepads/Strings/fi-FI/Resources.resw +++ b/src/Notepads/Strings/fi-FI/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Peruuta</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>Tiedostossa on tallentamattomia muutoksia.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Tallenna kaikki & poistu</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Hylkää & poistu</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Haluatko tallentaa muutokset?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>Tiedostoa "{0}" ei voitu avata: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>Virhe avattaessa tiedostoa</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>Tiedostoa "{0}" ei voitu tallentaa: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>Virhe tallennettaessa tiedostoa</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>Asetukset</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>Cancel</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>All changes including text, line ending and encoding made to "{0}" will be reverted!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>Yes</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>Are you sure to revert all changes?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Peruuta</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>Tallennetaanko tiedosto "{0}"?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Tallenna</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Älä tallenna</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Tallennetaanko muutoksesi?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Thin</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Cancel</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Save</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Rename</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/fi-FI/Settings.resw b/src/Notepads/Strings/fi-FI/Settings.resw index 53257b56a..4e2a75da1 100644 --- a/src/Notepads/Strings/fi-FI/Settings.resw +++ b/src/Notepads/Strings/fi-FI/Settings.resw @@ -153,7 +153,7 @@ <value>Privacy Statement</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>About</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>Status Bar Settings</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Advanced</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>Use my Windows mode</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Personalization</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>Wrap word</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Text & Editor</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/fr-FR/Resources.resw b/src/Notepads/Strings/fr-FR/Resources.resw index 4cce35570..3ec1a18e7 100644 --- a/src/Notepads/Strings/fr-FR/Resources.resw +++ b/src/Notepads/Strings/fr-FR/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Annuler</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>Certaines modifications n'ont pas été enregistrées.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Enregistrer tout</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Ne pas enregistrer</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Voulez-vous enregistrer les modifications ?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>Désolé, le fichier "{0}" ne peut pas être ouvert : {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>OK</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>Erreur lors de l'ouverture du fichier.</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>Désolé, le fichier "{0}" ne peut pas être enregistré : {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>OK</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>Erreur lors de l'enregistrement du fichier.</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>Paramètres</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>Annuler</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>Toutes les modifications du texte, des fins de lignes et de l'encodage apportées à "{0}" seront annulées !</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>Oui</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>Êtes-vous sûr de vouloir annuler toutes les modifications ?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Annuler</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>Enregistrer le fichier "{0}" ?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Enregistrer</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Ne pas enregistrer</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Enregistrer les modifications ?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Mince</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Annuler</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Sauvegarder</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Renommer</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/fr-FR/Settings.resw b/src/Notepads/Strings/fr-FR/Settings.resw index 6eddf8e18..b18e9a630 100644 --- a/src/Notepads/Strings/fr-FR/Settings.resw +++ b/src/Notepads/Strings/fr-FR/Settings.resw @@ -153,7 +153,7 @@ <value>Déclaration de confidentialité</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>À propos</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>Paramètres de la barre d'état</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Avancé</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>Utiliser mon thème Windows</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Personalisation</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>Retour automatique à la ligne</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Texte & éditeur</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/hi-IN/Resources.resw b/src/Notepads/Strings/hi-IN/Resources.resw index da3003cdc..6b76f1565 100644 --- a/src/Notepads/Strings/hi-IN/Resources.resw +++ b/src/Notepads/Strings/hi-IN/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>रद्द करें</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>असेव परिवर्तन मौजूद हैं।</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>सभी सेव करें और निकास</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>छोड़ें और निकास</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>क्या आप परिवर्तनों को सेव करना चाहते हैं?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>क्षमा करें, दस्तावेज़ "{0}" नहीं खोला जा सकता है: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>ठीक</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>दस्तावेज़ खोलनेका त्रुटि</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>क्षमा करें, दस्तावेज़ "{0}" सेव नहीं जा सकता है: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>ठीक</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>दस्तावेज़ सेव त्रुटि</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>सेटिंग्स</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>रद्द करें</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>पाठ, लाइन एंडींग और एन्कोडिंग सहित "{0}" मे किए गए सभी परिवर्तन वापस आ जाएंगे!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>हाँ</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>क्या आप सभी परिवर्तनों को वापस करने के लिए सुनिश्चित हैं?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>रद्द करें</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>दस्तावेज़ "{0}" को सेव करें?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>सेव करें</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>सेव ना करें</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>अपने परिवर्तनों का सेव करें</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>पतला</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>रद्द करें</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>सेव करें</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>नाम बदलें</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/hi-IN/Settings.resw b/src/Notepads/Strings/hi-IN/Settings.resw index 8ee1e57f0..a8b47e3ab 100644 --- a/src/Notepads/Strings/hi-IN/Settings.resw +++ b/src/Notepads/Strings/hi-IN/Settings.resw @@ -153,7 +153,7 @@ <value>गोपनीयता विवरण</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>करीबन</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>स्टेटस बार सेटिंग्स</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>वरिष्ठ</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>मेरे Windows मोड का उपयोग करें</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>वैयक्तिकरण</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>रैप वर्ड</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>पाठ और संपादक</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/hr-HR/Resources.resw b/src/Notepads/Strings/hr-HR/Resources.resw index ea5a874d8..53c2b800e 100644 --- a/src/Notepads/Strings/hr-HR/Resources.resw +++ b/src/Notepads/Strings/hr-HR/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Odustani</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>Postoje nespremljene promjene.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Spremi i zatvori</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Odbaci i zatvori</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Spremiti promjene?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>Nažalost se datoteka „{0}” ne može otvoriti: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>U redu</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>Greška pri otvaranju datoteke</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>Nažalost se datoteka „{0}” ne može spremiti: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>U redu</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>Greška pri spremanju datoteke</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>Postavke</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>Odustani</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>Poništit će se sve promjene u datoteci „{0}” – uključujući tekst, prijelome redaka i kodiranje!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>Da</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>Sve promjene poništiti?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Odustani</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>Spremiti datoteku „{0}”?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Spremi</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Nemoj spremiti</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Spremiti promjene?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Thin</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Cancel</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Save</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Rename</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/hr-HR/Settings.resw b/src/Notepads/Strings/hr-HR/Settings.resw index c8ea886f8..de4b7212d 100644 --- a/src/Notepads/Strings/hr-HR/Settings.resw +++ b/src/Notepads/Strings/hr-HR/Settings.resw @@ -153,7 +153,7 @@ <value>Izjava o privatnosti</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Informacije</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>Postavke za traku stanja</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Napredno</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>Koristi modus Windowsa</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Postavke</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>Prelomi riječi</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Tekst i uređivanje</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/hu-HU/Resources.resw b/src/Notepads/Strings/hu-HU/Resources.resw index 7a5229de5..1e14ec144 100644 --- a/src/Notepads/Strings/hu-HU/Resources.resw +++ b/src/Notepads/Strings/hu-HU/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Mégse</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>Önnek nem mentett módosításai vannak.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Mentés & Kilépés</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Elvetés & Kilépés</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>El akarod menteni a módosításokat?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>Sajnos a(z) "{0}" nem nyitható meg: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>Fájl Megnyitási Hiba</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>Sajnos a fájl "{0}" nem menthető el: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>Fájl Mentési Hiba</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>Beállítások</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>Mégse</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>Minden szöveg, sor végződés és kódolás-i módosítás "{0}"-ről vissza lesz vonva!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>Igen</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>Biztosan visszavonja az összes módosítást?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Mégse</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>Elmenti a(z) "{0}" fájlt?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Mentés</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Ne Mentsen</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>El szeretné menteni a módosításokat?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Kicsi</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Törlés</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Mentés</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Átnevezés</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/hu-HU/Settings.resw b/src/Notepads/Strings/hu-HU/Settings.resw index bb6c542ce..69c008e50 100644 --- a/src/Notepads/Strings/hu-HU/Settings.resw +++ b/src/Notepads/Strings/hu-HU/Settings.resw @@ -153,7 +153,7 @@ <value>Adatvédelmi Nyilatkozat</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Névjegy</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>Állapotsor Beállítások</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Haladó</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>Rendszerbeállítás használata</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Testreszabás</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>Sortörés</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Szöveg & Szerkesztő</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/it-IT/Resources.resw b/src/Notepads/Strings/it-IT/Resources.resw index fb0d98d29..b86c5560f 100644 --- a/src/Notepads/Strings/it-IT/Resources.resw +++ b/src/Notepads/Strings/it-IT/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Annulla</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>Ci sono modifiche non salvate.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Salva tutto & Esci</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Non salvare & Esci</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Salvare le modifiche?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>Spiacenti, il file "{0}" non può essere aperto: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>Errore nell'apertura del file</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>Spiacenti, il file "{0}" non può essere salvato: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>Errore nel salvataggio del file</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>Opzioni</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>No</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>Tutte le modifiche inclusi testi, ritorni a capo e codifica apportate a "{0}" verranno annullate!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>Si</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>Annullare tutte le modifiche?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Annulla</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>Salvare il file "{0}"?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Salva</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Non salvare</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Salvare le modifiche?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Sottile</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Annulla</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Salva</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Rinomina</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/it-IT/Settings.resw b/src/Notepads/Strings/it-IT/Settings.resw index 2cd6c957e..dc23dc43b 100644 --- a/src/Notepads/Strings/it-IT/Settings.resw +++ b/src/Notepads/Strings/it-IT/Settings.resw @@ -153,7 +153,7 @@ <value>Informativa sulla Privacy</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Informazioni</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>Impostazioni della barra di stato</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Avanzate</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>Usa l'impostazione di sistema</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Personalizzazione</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>Manda a capo le parole</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Testi & Editor</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/ja-JP/Resources.resw b/src/Notepads/Strings/ja-JP/Resources.resw index 3d1710b80..cf8621fef 100644 --- a/src/Notepads/Strings/ja-JP/Resources.resw +++ b/src/Notepads/Strings/ja-JP/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>キャンセル</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>保存していない変更があります。</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>全て保存して終了</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>破棄して終了</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>変更内容を保存しますか?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>ファイル "{0}" を開けませんでした: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>ファイルオープンエラー</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>ファイル "{0}" を保存できませんでした: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>ファイル保存エラー</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>設定</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>キャンセル</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>ファイル "{0}" に加えられた全ての文章・行末・エンコーディングの変更は元に戻ります!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>はい</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>本当に全ての変更を元に戻しますか?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>キャンセル</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>ファイル"{0}"に保存しますか?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>保存</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>保存しない</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>変更を保存しますか?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Thin</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Cancel</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Save</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Rename</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/ja-JP/Settings.resw b/src/Notepads/Strings/ja-JP/Settings.resw index a842e5cce..3f8c11dbc 100644 --- a/src/Notepads/Strings/ja-JP/Settings.resw +++ b/src/Notepads/Strings/ja-JP/Settings.resw @@ -153,7 +153,7 @@ <value>プライバシーについて</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>このアプリについて</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>ステータス バー</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>詳細設定</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>Windows の設定を使う</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>個人用設定</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>単語で折り返す</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>テキストとエディター</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/ka-GE/Resources.resw b/src/Notepads/Strings/ka-GE/Resources.resw index aa36f44d2..60bf3e4cc 100644 --- a/src/Notepads/Strings/ka-GE/Resources.resw +++ b/src/Notepads/Strings/ka-GE/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>გაუქმება</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>ცვლილებები შენახული არ არის.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>შეინახე ყველაფერი & გამოდი</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>არ შეინახო</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>გსურთ ცვლილებების შენახვა?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>სამწუხაროდ ფაილი "{0}"-ის გახსნა შეუძლებელია: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>კარგი</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>ფაილის გახსნის შეცდომა</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>სამწუხაროდ ფაილი "{0}"-ის შენახვა შეუძლებელია: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>კარგი</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>ფაილის შენახვის შეცდომა</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>სეთინგები</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>შეწყვეტა</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>ყველა ცვლილება ტექსტის, ხაზის დაბოლოების და ენკოდინგის ჩათვლით გათებეული "{0}"-ს მიხედვით, იქნება უკუშექცეული!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>დიახ</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>ნამდვილად გსურთ ყველაფრის უკან დაბრუნება?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>შეწყვეტა</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>შეინახე ფაილი "{0}"?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>შეინახე</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>არ შეინახო</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>გსურთ თქვენი ფაილების შენახვა?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Thin</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Cancel</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Save</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Rename</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/ka-GE/Settings.resw b/src/Notepads/Strings/ka-GE/Settings.resw index e9e4312f1..77512e5eb 100644 --- a/src/Notepads/Strings/ka-GE/Settings.resw +++ b/src/Notepads/Strings/ka-GE/Settings.resw @@ -153,7 +153,7 @@ <value>კონფედენციალურობის შესახებგანცხადება</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>შესახებ</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>სტატუს ბარის სეთინგები</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>გაფართოებული</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>გამოიყენე ჩემი Windows-ის რეჟიმი</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>პერსონალიზაცია</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>ტექსტის შეფუთვა</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>ტექსტი & ედიტორი</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/ko-KR/Resources.resw b/src/Notepads/Strings/ko-KR/Resources.resw index 952383a94..2d008f1d5 100644 --- a/src/Notepads/Strings/ko-KR/Resources.resw +++ b/src/Notepads/Strings/ko-KR/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>취소</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>저장하지 않은 변경 사항이 있습니다.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>모두 저장</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>저장하지 않고 종료</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>변경 사항을 저장하시겠습니까?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>파일 "{0}" 을 열 수 없습니다: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>확인</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>파일 열기 오류</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>파일 "{0}" 을 저장할 수 없습니다: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>확인</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>파일 저장 오류</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>설정</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>취소</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>파일 "{0}" 의 모든 변경 사항이 원래대로 돌아갑니다!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>확인</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>정말 모든 변경 사항을 취소하시겠습니까?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>취소</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>"{0}"에 저장하시겠습니까?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>저장</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>저장하지 않음</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>변경 사항을 저장하시겠습니까?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Thin</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Cancel</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Save</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Rename</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/ko-KR/Settings.resw b/src/Notepads/Strings/ko-KR/Settings.resw index a59588493..f72909bcb 100644 --- a/src/Notepads/Strings/ko-KR/Settings.resw +++ b/src/Notepads/Strings/ko-KR/Settings.resw @@ -153,7 +153,7 @@ <value>개인정보 보호 정책</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>애플리케이션 정보</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>상태표시줄 설정</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>고급</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>기본 Windows 모드 사용</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>개인 설정</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>단어 단위로 자동 개행</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>에디터 설정</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/or-IN/Resources.resw b/src/Notepads/Strings/or-IN/Resources.resw index 980e3ec9d..90bbadc65 100644 --- a/src/Notepads/Strings/or-IN/Resources.resw +++ b/src/Notepads/Strings/or-IN/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>ବାତିଲ୍ କରନ୍ତୁ</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>ଅସଞ୍ଚିତ ପରିବର୍ତ୍ତନଗୁଡିକ ଅଛି।</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>ସମସ୍ତ ସଞ୍ଚୟ କରି ପ୍ରସ୍ଥାନ</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>ପରିତ୍ୟାଗ ଏବଂ ପ୍ରସ୍ଥାନ</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>ଆପଣ ପରିବର୍ତ୍ତନଗୁଡିକ ସଞ୍ଚୟ କରିବାକୁ ଚାହୁଁଛନ୍ତି କି?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>ଦୁଃଖିତ, ଫାଇଲ୍ "{0}" ଖୋଲାଯାଇ ପାରିଲା ନାହିଁ: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>ଠିକ୍ ଅଛି</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>ଫାଇଲ୍ ଖୋଲା ତ୍ରୁଟି</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>ଦୁଃଖିତ, ଫାଇଲ୍ "{0}" ସଞ୍ଚୟ ହୋଇପାରିଲା ନାହିଁ: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>ଠିକ୍ ଅଛି</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>ଫାଇଲ ସଞ୍ଚୟ ତ୍ରୁଟି</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>ସେଟିଙ୍ଗ୍ସ</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>ବାତିଲ୍ କରନ୍ତୁ</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>ଟେକ୍ସଟ୍, ଲାଇନ୍ ଏଣ୍ଡିଙ୍ଗ୍ ଏବଂ ଏନକୋଡିଂ ସହିତ "{0}" ର ସମସ୍ତ ପରିବର୍ତ୍ତନ ଫେରସ୍ତ ହେବ!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>ହଁ</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>ଆପଣ ସମସ୍ତ ପରିବର୍ତ୍ତନକୁ ଫେରାଇବାକୁ ନିଶ୍ଚିତ କି?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>ବାତିଲ୍ କରନ୍ତୁ</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>ଫାଇଲ୍ "{0}" ସଞ୍ଚୟ କରନ୍ତୁ?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>ସଞ୍ଚୟ କରନ୍ତୁ</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>ସଞ୍ଚୟ କରନ୍ତୁ ନାହିଁ</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>ଆପଣଙ୍କର ପରିବର୍ତ୍ତନଗୁଡିକ ସଞ୍ଚୟ କରନ୍ତୁ</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>ପତଳା</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>ବାତିଲ୍ କରନ୍ତୁ</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>ସଞ୍ଚୟ କରନ୍ତୁ</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>ନାମବଦଳ</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/or-IN/Settings.resw b/src/Notepads/Strings/or-IN/Settings.resw index cb8dc7ebd..a1aadf26c 100644 --- a/src/Notepads/Strings/or-IN/Settings.resw +++ b/src/Notepads/Strings/or-IN/Settings.resw @@ -153,7 +153,7 @@ <value>ଗୋପନୀୟତା ବିବୃତ୍ତି</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>ବିଷୟରେ</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>ଷ୍ଟାଟସ୍ ବାର୍ ସେଟିଙ୍ଗ୍ସ</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>ଅଭିନବ</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>ମୋ Windows ମୋଡ୍ ବ୍ୟବହାର କରନ୍ତୁ</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>ବ୍ୟକ୍ତିଗତକରଣ</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>ରାପ୍ ୱର୍ଡ</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>ପାଠ ଏବଂ ସମ୍ପାଦକ</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/pl-PL/Resources.resw b/src/Notepads/Strings/pl-PL/Resources.resw index 45d27992a..9978bf074 100644 --- a/src/Notepads/Strings/pl-PL/Resources.resw +++ b/src/Notepads/Strings/pl-PL/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Anuluj</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>Zmiany nie zostały zapisane.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Zapisz</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Nie zapisuj</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Czy chcesz zapisać zmiany w pliku?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>Niestety, plik "{0}" nie może zostać otworzony: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>OK</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>Nie można otworzyć pliku</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>Niestety, plik "{0}" nie może zostać zapisany: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>OK</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>Błąd zapisu pliku</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>Ustawienia</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>Anuluj</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>Wszystkie zmiany takie jak: wpisany tekst, zakończenia lini oraz kodowanie dokonane w pliku "{0}" zostaną wycofane!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>Tak</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>Czy chcesz wycofać wszystkie zmiany?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Anuluj</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>Zmiany w pliku "{0}" nie zostały zapisane?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Zapisz</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Nie zapisuj</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Zapisać dokonane zmiany?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Thin</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Anuluj</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Zapisz</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Zmień nazwę</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/pl-PL/Settings.resw b/src/Notepads/Strings/pl-PL/Settings.resw index 72dd70183..d6f69c206 100644 --- a/src/Notepads/Strings/pl-PL/Settings.resw +++ b/src/Notepads/Strings/pl-PL/Settings.resw @@ -153,7 +153,7 @@ <value>Polityka prywatności</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>O programie</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>Pasek stanu</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Zaawansowane</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>Użyj motywu systemu Windows</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Personalizacja</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>Zawijaj wiersze</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Tekst i edytor</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/pt-BR/Resources.resw b/src/Notepads/Strings/pt-BR/Resources.resw index 38d16d4a1..5ce411403 100644 --- a/src/Notepads/Strings/pt-BR/Resources.resw +++ b/src/Notepads/Strings/pt-BR/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Cancelar</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>Há alterações não salvas.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Salvar Todos</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Descartar</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Você deseja salvar as alterações?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -153,11 +153,11 @@ <value>Desculpe, o arquivo "{0}" não pôde ser aberto: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>Erro ao abrir o arquivo</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -165,11 +165,11 @@ <value>Desculpe, o arquivo "{0}" não pôde ser salvo: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>Erro ao salvar o arquivo</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -249,7 +249,7 @@ <value>Configurações</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>Cancelar</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -257,15 +257,15 @@ <value>Todas as alterações incluindo texto, terminação e codificação de linha feitas no "{0}" serão revertidas!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>Sim</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>Reverter todas as alterações?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Cancelar</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -273,15 +273,15 @@ <value>Salvar o arquivo "{0}"?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Salvar</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Não Salvar</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Salvar as alterações?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Fina</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Cancelar</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Salvar</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Renomear</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/pt-BR/Settings.resw b/src/Notepads/Strings/pt-BR/Settings.resw index 0221f33da..e23261a6f 100644 --- a/src/Notepads/Strings/pt-BR/Settings.resw +++ b/src/Notepads/Strings/pt-BR/Settings.resw @@ -153,7 +153,7 @@ <value>Declaração de privacidade</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Sobre</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>Configurações da barra de status</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Avançado</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>Usar configuração do sistema</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Personalização</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>Desativar quebra de linha</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Editor e texto</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/pt-PT/Resources.resw b/src/Notepads/Strings/pt-PT/Resources.resw index 929bdf6ac..7dba7d121 100644 --- a/src/Notepads/Strings/pt-PT/Resources.resw +++ b/src/Notepads/Strings/pt-PT/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Cancelar</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>Há alterações não guardadas.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Guardar Todos</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Descartar</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Você deseja guardar as alterações?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -153,11 +153,11 @@ <value>Desculpe, o ficheiro "{0}" não pôde ser aberto: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>Erro ao abrir o ficheiro</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -165,11 +165,11 @@ <value>Desculpe, o ficheiro "{0}" não pôde ser guardado: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Ok</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>Erro ao guardar o ficheiro</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -249,7 +249,7 @@ <value>Configurações</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>Cancelar</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -257,15 +257,15 @@ <value>Todas as alterações incluindo texto, terminação e codificação de linha feitas no "{0}" serão revertidas!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>Sim</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>Reverter todas as alterações?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Cancelar</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -273,15 +273,15 @@ <value>Guardar o ficheiro "{0}"?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Guardar</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Não Guardar</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Guardar as alterações?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Fina</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Cancelar</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Guardar</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Renomear</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/pt-PT/Settings.resw b/src/Notepads/Strings/pt-PT/Settings.resw index 80ff35a64..86b7eba63 100644 --- a/src/Notepads/Strings/pt-PT/Settings.resw +++ b/src/Notepads/Strings/pt-PT/Settings.resw @@ -153,7 +153,7 @@ <value>Declaração de privacidade</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Acerca</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>Configurações da barra de estado</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Avançado</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>Usar configuração do sistema</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Personalização</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>Desativar quebra de linha</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Editor e texto</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/ru-RU/Resources.resw b/src/Notepads/Strings/ru-RU/Resources.resw index b5f9dc079..fa0675b70 100644 --- a/src/Notepads/Strings/ru-RU/Resources.resw +++ b/src/Notepads/Strings/ru-RU/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Отмена</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>У вас есть не сохраненные изменения.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Сохранить все</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Не сохранять</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Вы хотите сохранить изменения?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>Извините, файл "{0}" не может быть открыт: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>ОК</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>Ошибка открытия файла</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>Извините, файл "{0}" не может быть сохранен: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>ОК</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>Ошибка сохранения файла</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>Настройки</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>Отмена</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>Все внесенные изменения, включая текст, разрыв страки и кодировку, сделанные в "{0}" будут отменены!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>Да</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>Вы действительно хотите отменить все изменения?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Отмена</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>Сохранить файл "{0}"?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Сохранить</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Не сохранять</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Сохранить изменения?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Thin</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Отмена</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Сохранить</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Переименовать</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/ru-RU/Settings.resw b/src/Notepads/Strings/ru-RU/Settings.resw index 802ef5b0d..ef8de57ff 100644 --- a/src/Notepads/Strings/ru-RU/Settings.resw +++ b/src/Notepads/Strings/ru-RU/Settings.resw @@ -153,7 +153,7 @@ <value>Заявление о конфиденциальности</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>О программе</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>Строка состояния</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Дополнительно</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>Стандартная Windows</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Персонализация</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>Перенос по словам</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Текст и редактирование</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/tr-TR/Resources.resw b/src/Notepads/Strings/tr-TR/Resources.resw index 107a0796e..5def71ed7 100755 --- a/src/Notepads/Strings/tr-TR/Resources.resw +++ b/src/Notepads/Strings/tr-TR/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>İptal Et</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>Kaydedilmemiş değişiklikler var.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Tümünü Kaydet ve Çık</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>İptal Et ve Çık</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Değişiklikleri kaydetmek istiyor musunuz?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>Üzgünüm, "{0}" dosyası açılamıyor: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Tamam</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>Dosya Açma Hatası</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>Üzgünüm, "{0}" dosyası kaydedilemedi: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>Tamam</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>Dosya Kaydetme Hatası</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>Ayarlar</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>İptal Et</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>"{0}" dosyasına yapılan tüm değişiklikler geri alınacak!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>Evet</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>Tüm değişiklikleri geri almak istediğinizden emin misiniz?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>İptal Et</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>"{0}" dosyası kaydedilsin mi?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Kaydet</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Kaydetme</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Değişiklikler kaydedilsin mi?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>İnce</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>İptal Et</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Kaydet</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Yeniden Adlandır</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/tr-TR/Settings.resw b/src/Notepads/Strings/tr-TR/Settings.resw index 31f680e1e..54d6b3817 100755 --- a/src/Notepads/Strings/tr-TR/Settings.resw +++ b/src/Notepads/Strings/tr-TR/Settings.resw @@ -153,7 +153,7 @@ <value>Gizlilik Beyanı</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Hakkında</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>Durum Çubuğu Ayarları</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Gelişmiş</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>Windows rengini kullan</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Kişiselleştirme</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>Sözcük kaydır</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Metin ve Editor</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/uk-UA/Resources.resw b/src/Notepads/Strings/uk-UA/Resources.resw index b46ad6662..035ee63b7 100644 --- a/src/Notepads/Strings/uk-UA/Resources.resw +++ b/src/Notepads/Strings/uk-UA/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Скасувати</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>У вас є незбережені зміни.</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Зберегти</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Не зберігати</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Хочете зберегти зміни?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>Вибачте, файл "{0}" не може бути відкритий: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>ОК</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>Помилка відкриття файлу</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>Вибачте, файл "{0}" не може бути збережений: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>ОК</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>Помилка збереження файлу</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>Настройки</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>Ні</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>Усі зміни, включаючи текст, закінчення рядків та кодування, внесені до файлу "{0}" будуть cкасовані!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>Так</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>Ви впевнені, що хочете скасувати всі зміни?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>Скасувати</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>Зберегти файл "{0}"?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>Зберегти</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>Не зберігати</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>Зберегти зміни?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Thin</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>Скасувати</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>Зберегти</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>Перейменування</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/uk-UA/Settings.resw b/src/Notepads/Strings/uk-UA/Settings.resw index b4c29d7e8..8d6061a01 100644 --- a/src/Notepads/Strings/uk-UA/Settings.resw +++ b/src/Notepads/Strings/uk-UA/Settings.resw @@ -153,7 +153,7 @@ <value>Конфіденційність</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Про програму</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>Налаштування рядка стану</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Додатково</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>Використовувати тему Windows</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Персоналізація</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>Переносити слова</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>Текст і редактор</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/zh-CN/Resources.resw b/src/Notepads/Strings/zh-CN/Resources.resw index 30305b89d..d3e4c8b1a 100644 --- a/src/Notepads/Strings/zh-CN/Resources.resw +++ b/src/Notepads/Strings/zh-CN/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>取消</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>您有尚未保存的内容。</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>全部保存并退出</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>退出不保存</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>是否保存更改?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>抱歉,文件 "{0}" 打开失败: {1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>明白</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>文件打开失败</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>抱歉,文件 "{0}" 保存失败: {1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>明白</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>文件保存失败</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>设置</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>取消</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>所有对 "{0}" 的改动包括文字,换行符和编码将会被撤消!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>是的</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>是否撤消所有改动?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>取消</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>是否将更改保存到 "{0}"?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>保存</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>不保存</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>是否保存更改?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>Thin</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>取消</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>确认</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>重命名</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/zh-CN/Settings.resw b/src/Notepads/Strings/zh-CN/Settings.resw index 2b9dcbd0a..e42302b7d 100644 --- a/src/Notepads/Strings/zh-CN/Settings.resw +++ b/src/Notepads/Strings/zh-CN/Settings.resw @@ -153,7 +153,7 @@ <value>隐私声明</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>关于</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>状态栏设置</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>高级</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>使用我的Windows模式</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>个性化</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>自动换行</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>文本与编辑器</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Strings/zh-TW/Resources.resw b/src/Notepads/Strings/zh-TW/Resources.resw index 568f4dd84..d06abad4c 100644 --- a/src/Notepads/Strings/zh-TW/Resources.resw +++ b/src/Notepads/Strings/zh-TW/Resources.resw @@ -117,23 +117,23 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="AppCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>取消</value> <comment>AppCloseSaveReminderDialog: CloseButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Content" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Content" xml:space="preserve"> <value>尚還有未儲存的內容。</value> <comment>AppCloseSaveReminderDialog: "Content" display text.</comment> </data> - <data name="AppCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>全部儲存並退出</value> <comment>AppCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>退出不儲存</value> <comment>AppCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="AppCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="AppCloseSaveReminderDialog.Title" xml:space="preserve"> <value>您要儲存這些變更嗎?</value> <comment>AppCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -157,11 +157,11 @@ <value>抱歉,檔案「{0}」開啟時發生錯誤:{1}</value> <comment>FileOpenErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileOpenErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileOpenErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>確定</value> <comment>FileOpenErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileOpenErrorDialog_Title" xml:space="preserve"> + <data name="FileOpenErrorDialog.Title" xml:space="preserve"> <value>檔案開啟錯誤</value> <comment>FileOpenErrorDialog: "Title" display text.</comment> </data> @@ -169,11 +169,11 @@ <value>抱歉,檔案「{0}」儲存時發生錯誤:{1}</value> <comment>FileSaveErrorDialog: "Content" display text, {0} stands for file path, {1} stands for error message. You can change the order but DO NOT REMOVE them from the string.</comment> </data> - <data name="FileSaveErrorDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileSaveErrorDialog.PrimaryButtonText" xml:space="preserve"> <value>確定</value> <comment>FileSaveErrorDialog: PrimaryButtonText.</comment> </data> - <data name="FileSaveErrorDialog_Title" xml:space="preserve"> + <data name="FileSaveErrorDialog.Title" xml:space="preserve"> <value>檔案儲存錯誤</value> <comment>FileSaveErrorDialog: "Title" display text.</comment> </data> @@ -253,7 +253,7 @@ <value>設定</value> <comment>MainMenu: "Settings" button display text.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_CloseButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.CloseButtonText" xml:space="preserve"> <value>取消</value> <comment>RevertAllChangesConfirmationDialog: CloseButtonText.</comment> </data> @@ -261,15 +261,15 @@ <value>所有對「{0}」的變更包括文字、行尾以及編碼將會被還原!</value> <comment>RevertAllChangesConfirmationDialog: "Content" display text, {0} stands for file name. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_PrimaryButtonText" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.PrimaryButtonText" xml:space="preserve"> <value>是</value> <comment>RevertAllChangesConfirmationDialog: PrimaryButtonText.</comment> </data> - <data name="RevertAllChangesConfirmationDialog_Title" xml:space="preserve"> + <data name="RevertAllChangesConfirmationDialog.Title" xml:space="preserve"> <value>您確定要還原所有變更嗎?</value> <comment>RevertAllChangesConfirmationDialog: "Title" display text.</comment> </data> - <data name="SetCloseSaveReminderDialog_CloseButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.CloseButtonText" xml:space="preserve"> <value>取消</value> <comment>SetCloseSaveReminderDialog: CloseButtonText.</comment> </data> @@ -277,15 +277,15 @@ <value>要儲存對「{0}」的變更嗎?</value> <comment>SetCloseSaveReminderDialog: "Content" display text. {0} stands for file name/path. You can change the order but DO NOT REMOVE it from the string.</comment> </data> - <data name="SetCloseSaveReminderDialog_PrimaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.PrimaryButtonText" xml:space="preserve"> <value>儲存</value> <comment>SetCloseSaveReminderDialog: PrimaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_SecondaryButtonText" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.SecondaryButtonText" xml:space="preserve"> <value>不要儲存</value> <comment>SetCloseSaveReminderDialog: SecondaryButtonText.</comment> </data> - <data name="SetCloseSaveReminderDialog_Title" xml:space="preserve"> + <data name="SetCloseSaveReminderDialog.Title" xml:space="preserve"> <value>是否儲存變更?</value> <comment>SetCloseSaveReminderDialog: "Title" display text.</comment> </data> @@ -641,15 +641,15 @@ <value>細體</value> <comment>FontWeight: "Thin"</comment> </data> - <data name="FileRenameDialog_CloseButtonText" xml:space="preserve"> + <data name="FileRenameDialog.CloseButtonText" xml:space="preserve"> <value>取消</value> <comment>FileRenameDialog: CloseButtonText.</comment> </data> - <data name="FileRenameDialog_PrimaryButtonText" xml:space="preserve"> + <data name="FileRenameDialog.PrimaryButtonText" xml:space="preserve"> <value>確定</value> <comment>FileRenameDialog: PrimaryButtonText.</comment> </data> - <data name="FileRenameDialog_Title" xml:space="preserve"> + <data name="FileRenameDialog.Title" xml:space="preserve"> <value>重新命名</value> <comment>FileRenameDialog: "Title" display text.</comment> </data> diff --git a/src/Notepads/Strings/zh-TW/Settings.resw b/src/Notepads/Strings/zh-TW/Settings.resw index 9a3d4533f..ac075e1a9 100644 --- a/src/Notepads/Strings/zh-TW/Settings.resw +++ b/src/Notepads/Strings/zh-TW/Settings.resw @@ -153,7 +153,7 @@ <value>隱私權聲明</value> <comment>AboutPage PrivacyStatementTitle display text.</comment> </data> - <data name="AboutPage_Title.Content" xml:space="preserve"> + <data name="AboutPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>關於</value> <comment>AboutPage Title display text.</comment> </data> @@ -169,7 +169,7 @@ <value>狀態列設定</value> <comment>AdvancedPage StatusBarSettings Title display text.</comment> </data> - <data name="AdvancedPage_Title.Content" xml:space="preserve"> + <data name="AdvancedPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>進階設定</value> <comment>AdvancedPage Title display text.</comment> </data> @@ -209,7 +209,7 @@ <value>使用 Windows 設定</value> <comment>PersonalizationPage ThemeModeSettings WindowsModeRadioButton content display text.</comment> </data> - <data name="PersonalizationPage_Title.Content" xml:space="preserve"> + <data name="PersonalizationPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>個人化</value> <comment>PersonalizationPage Title display text.</comment> </data> @@ -285,7 +285,7 @@ <value>自動換行</value> <comment>TextAndEditorPage TextWrappingSettings ToggleSwitch On display text.</comment> </data> - <data name="TextAndEditorPage_Title.Content" xml:space="preserve"> + <data name="TextAndEditorPage_Title.ToolTipService.ToolTip" xml:space="preserve"> <value>文字與編輯器</value> <comment>TextAndEditorPage Title display text.</comment> </data> diff --git a/src/Notepads/Utilities/BehaviorUtility.cs b/src/Notepads/Utilities/BehaviorUtility.cs new file mode 100644 index 000000000..b746324de --- /dev/null +++ b/src/Notepads/Utilities/BehaviorUtility.cs @@ -0,0 +1,47 @@ +namespace Notepads.Utilities +{ + using System; + using Windows.UI.Xaml; + using Microsoft.Xaml.Interactivity; + + public static class BehaviorUtility + { + public static DataTemplate GetAttachedBehaviors(DependencyObject obj) + { + return (DataTemplate)obj.GetValue(AttachedBehaviorsProperty); + } + + public static void SetAttachedBehaviors(DependencyObject obj, DataTemplate value) + { + obj.SetValue(AttachedBehaviorsProperty, value); + } + + public static readonly DependencyProperty AttachedBehaviorsProperty = + DependencyProperty.RegisterAttached( + "AttachedBehaviors", + typeof(DataTemplate), + typeof(BehaviorUtility), + new PropertyMetadata(null, Callback) + ); + + private static void Callback(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + BehaviorCollection collection = null; + var value = (e.NewValue as DataTemplate)?.LoadContent(); + + switch (value) + { + case BehaviorCollection behaviors: + collection = behaviors; + break; + case IBehavior _: + collection = new BehaviorCollection { value }; + break; + default: + throw new Exception($"AttachedBehaviors should be a BehaviorCollection or an IBehavior."); + } + // collection may be null here, if e.NewValue is null + Interaction.SetBehaviors(d, collection); + } + } +} diff --git a/src/Notepads/Utilities/DialogManager.cs b/src/Notepads/Utilities/DialogManager.cs index f3728635b..0d51e996d 100644 --- a/src/Notepads/Utilities/DialogManager.cs +++ b/src/Notepads/Utilities/DialogManager.cs @@ -9,11 +9,11 @@ public static class DialogManager { - public static NotepadsDialog ActiveDialog; + public static INotepadsDialog ActiveDialog; private static TaskCompletionSource<bool> _dialogAwaiter = new TaskCompletionSource<bool>(); - public static async Task<ContentDialogResult?> OpenDialogAsync(NotepadsDialog dialog, bool awaitPreviousDialog) + public static async Task<ContentDialogResult?> OpenDialogAsync(INotepadsDialog dialog, bool awaitPreviousDialog) { try { @@ -43,7 +43,7 @@ public static class DialogManager return null; } - private static async Task<ContentDialogResult> OpenDialog(NotepadsDialog dialog, bool awaitPreviousDialog) + private static async Task<ContentDialogResult> OpenDialog(INotepadsDialog dialog, bool awaitPreviousDialog) { TaskCompletionSource<bool> currentAwaiter = _dialogAwaiter; TaskCompletionSource<bool> nextAwaiter = new TaskCompletionSource<bool>(); diff --git a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml index 2982bc777..84dd6bb4b 100644 --- a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml +++ b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml @@ -4,9 +4,10 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Core="using:Microsoft.Xaml.Interactions.Core" xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" - xmlns:controls="using:Notepads.Controls" 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" + xmlns:muxca="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals" xmlns:wctc="using:Microsoft.Toolkit.Uwp.UI.Controls" xmlns:wctui="using:Microsoft.Toolkit.Uwp.UI" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" @@ -33,23 +34,24 @@ OpenPaneLength="385" PaneBackground="Transparent" PanePlacement="Right" - Style="{StaticResource CustomSplitViewStyle}"> + Style="{StaticResource NotepadsSplitViewStyle}"> <SplitView.Content> <Grid> - <controls:SetsView + <muxc:TabView x:Name="Sets" Grid.ColumnSpan="2" AllowDrop="True" + AllowDropTabs="True" Background="Transparent" - CanCloseSets="True" - CanDragItems="True" - CanReorderItems="True" - IsCloseButtonOverlay="False" + CanDrag="True" + CanDragTabs="True" + CanReorderTabs="True" + CloseButtonOverlayMode="OnPointerOver" Loaded="Sets_Loaded" - SetsWidthBehavior="Equal" + Style="{StaticResource NotepadsTabViewStyle}" TabIndex="0" - Template="{StaticResource SetsViewTemplate}"> + TabWidthMode="Equal"> <!--<sets:SetsView.KeyboardAccelerators> <KeyboardAccelerator Key="N" Modifiers="Control" Invoked="KeyboardAccelerator_Ctrl_N_OnInvoked"/> @@ -58,21 +60,14 @@ <KeyboardAccelerator Key="Tab" Modifiers="Control,Shift" Invoked="KeyboardAccelerator_Ctrl_Shift_Tab_OnInvoked"/> </sets:SetsView.KeyboardAccelerators>--> - <controls:SetsView.Resources> - <x:Double x:Key="SetsViewItemHeaderMinHeight">32</x:Double> - <x:Double x:Key="SetsViewItemHeaderMinWidth">90</x:Double> - <x:Double x:Key="SetsViewItemHeaderMaxWidth">210</x:Double> - <Storyboard x:Name="NewSetButtonOpacityAnimation"> - <DoubleAnimation - Storyboard.TargetName="NewSetButton" - Storyboard.TargetProperty="Opacity" - From="0.0" - To="1.0" - Duration="0:0:1" /> - </Storyboard> - </controls:SetsView.Resources> + <!--<muxc:TabView.Resources> + <x:Double x:Key="TabViewItemMinHeight">32</x:Double> + <x:Double x:Key="TabViewItemAddButtonHeight">32</x:Double> + <x:Double x:Key="TabViewItemMinWidth">90</x:Double> + <x:Double x:Key="TabViewItemMaxWidth">210</x:Double> + </muxc:TabView.Resources>--> - <controls:SetsView.SetsStartHeader> + <muxc:TabView.TabStripHeader> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> @@ -83,16 +78,16 @@ x:Name="ExitCompactOverlayButton" Grid.Column="0" Width="42" - Height="{StaticResource SetsViewItemHeaderMinHeight}" + Height="{StaticResource TabViewItemMinHeight}" Margin="0,0,0,0" Background="Transparent" BorderThickness="0" Click="ExitCompactOverlayButton_OnClick" IsTabStop="False" - Style="{ThemeResource ButtonRevealStyle}" + Style="{StaticResource TabViewButtonStyle}" Visibility="Collapsed"> <Viewbox MaxWidth="18" MaxHeight="18"> - <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> + <FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> </Viewbox> </Button> @@ -100,18 +95,29 @@ x:Name="MainMenuButton" Grid.Column="1" Width="42" - Height="{StaticResource SetsViewItemHeaderMinHeight}" - Margin="0,0,-1,0" + Height="{StaticResource TabViewItemMinHeight}" + Margin="0,0,0,0" Padding="0" Background="Transparent" BorderThickness="0" IsTabStop="False" - Style="{ThemeResource ButtonRevealStyle}"> - <Viewbox MaxWidth="16" MaxHeight="16"> - <SymbolIcon Symbol="GlobalNavigationButton" /> - </Viewbox> + Style="{StaticResource TabViewButtonStyle}"> + <muxc:AnimatedIcon + x:Name="MainMenuButtonIcon" + MaxWidth="16" + MaxHeight="16"> + <muxc:AnimatedIcon.Source> + <muxca:AnimatedGlobalNavigationButtonVisualSource /> + </muxc:AnimatedIcon.Source> + <muxc:AnimatedIcon.FallbackIconSource> + <muxc:SymbolIconSource Symbol="GlobalNavigationButton" /> + </muxc:AnimatedIcon.FallbackIconSource> + </muxc:AnimatedIcon> <FlyoutBase.AttachedFlyout> - <MenuFlyout x:Name="MainMenuButtonFlyout" Placement="BottomEdgeAlignedLeft"> + <MenuFlyout + x:Name="MainMenuButtonFlyout" + MenuFlyoutPresenterStyle="{StaticResource MainMenuFlyoutStyle}" + Placement="BottomEdgeAlignedLeft"> <MenuFlyoutItem x:Name="MenuCreateNewButton" x:Uid="MainMenu_Button_New" @@ -129,7 +135,7 @@ x:Uid="MainMenu_Button_New_Window" AccessKey="N"> <MenuFlyoutItem.Icon> - <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> + <FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> </MenuFlyoutItem.Icon> <MenuFlyoutItem.KeyboardAccelerators> <KeyboardAccelerator @@ -247,19 +253,13 @@ <KeyboardAccelerator Key="F1" IsEnabled="False" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> - <MenuFlyout.MenuFlyoutPresenterStyle> - <Style TargetType="MenuFlyoutPresenter"> - <Setter Property="BorderThickness" Value="0" /> - <Setter Property="MaxWidth" Value="1200" /> - </Style> - </MenuFlyout.MenuFlyoutPresenterStyle> </MenuFlyout> </FlyoutBase.AttachedFlyout> </Button> </Grid> - </controls:SetsView.SetsStartHeader> + </muxc:TabView.TabStripHeader> - <controls:SetsView.SetsActionHeader> + <!--<controls:SetsView.SetsActionHeader> <Button x:Name="NewSetButton" Grid.Column="0" @@ -271,28 +271,42 @@ IsTabStop="False" Style="{ThemeResource ButtonRevealStyle}"> <Viewbox MaxWidth="14" MaxHeight="14"> - <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> + <FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> </Viewbox> </Button> - </controls:SetsView.SetsActionHeader> + </controls:SetsView.SetsActionHeader>--> - <controls:SetsView.SetsPaddingHeader> + <!--<controls:SetsView.SetsPaddingHeader> <Grid x:Name="AppTitleBar" Height="32" Background="Transparent" /> - </controls:SetsView.SetsPaddingHeader> + </controls:SetsView.SetsPaddingHeader>--> - <controls:SetsView.SetsEndHeader> - <Grid - x:Name="TitleBarReservedArea" - Width="180" - Height="32" - HorizontalAlignment="Center" - Background="Transparent" /> - </controls:SetsView.SetsEndHeader> + <muxc:TabView.TabStripFooter> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + + <Grid + x:Name="AppTitleBar" + Grid.Column="0" + Height="{StaticResource TabViewItemMinHeight}" + Background="Transparent" /> + + <Grid + x:Name="TitleBarReservedArea" + Grid.Column="1" + Width="180" + Height="{StaticResource TabViewItemMinHeight}" + HorizontalAlignment="Center" + Background="Transparent" /> + </Grid> + </muxc:TabView.TabStripFooter> - </controls:SetsView> + </muxc:TabView> <wctc:InAppNotification x:Name="StatusNotification" @@ -303,7 +317,7 @@ FontWeight="Light" HorizontalOffset="0" ShowDismissButton="False" - Style="{StaticResource InAppNotificationNoDismissButton}" + Style="{StaticResource NotepadsInAppNotificationStyle}" VerticalOffset="-20" /> </Grid> </SplitView.Content> @@ -332,17 +346,6 @@ Grid.Row="1" Height="25" x:Load="false"> - <Grid.Resources> - <Style x:Key="StatusBarTextBlockStyle" TargetType="TextBlock"> - <Setter Property="Height" Value="25" /> - <Setter Property="Padding" Value="8,4,8,4" /> - <Setter Property="HorizontalAlignment" Value="Left" /> - <Setter Property="FontSize" Value="11" /> - <Setter Property="FontWeight" Value="Normal" /> - <Setter Property="Opacity" Value="1.0" /> - <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseMediumHighBrush}" /> - </Style> - </Grid.Resources> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" MinWidth="4" /> <ColumnDefinition Width="*" /> @@ -358,26 +361,9 @@ <Grid x:Name="FileModificationStateIndicator" Padding="8,5,6,5" - wctui:FrameworkElementExtensions.Cursor="Hand" IsTapEnabled="True" + Style="{StaticResource NotepadsInteractiveGridStyle}" Tapped="StatusBarComponent_OnTapped"> - <Interactivity:Interaction.Behaviors> - <Core:EventTriggerBehavior EventName="PointerEntered"> - <Core:ChangePropertyAction PropertyName="Background"> - <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}" /> - </Core:ChangePropertyAction.Value> - </Core:ChangePropertyAction> - </Core:EventTriggerBehavior> - - <Core:EventTriggerBehavior EventName="PointerExited"> - <Core:ChangePropertyAction PropertyName="Background"> - <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="Transparent" /> - </Core:ChangePropertyAction.Value> - </Core:ChangePropertyAction> - </Core:EventTriggerBehavior> - </Interactivity:Interaction.Behaviors> <Viewbox> <FontIcon x:Name="FileModificationStateIndicatorIcon" Foreground="{StaticResource SystemControlForegroundAccentBrush}" /> </Viewbox> @@ -385,6 +371,7 @@ <MenuFlyout x:Name="FileModifiedOutsideFlyout" Closing="StatusBarFlyout_OnClosing" + MenuFlyoutPresenterStyle="{StaticResource StatusBarFlyoutStyle}" Placement="TopEdgeAlignedLeft"> <MenuFlyoutItem x:Name="FileModifiedOutsideFlyoutReloadFileFromDiskFlyoutItem" @@ -401,48 +388,23 @@ Modifiers="Control,Shift" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> - <MenuFlyout.MenuFlyoutPresenterStyle> - <Style TargetType="MenuFlyoutPresenter"> - <Setter Property="BorderThickness" Value="0" /> - </Style> - </MenuFlyout.MenuFlyoutPresenterStyle> </MenuFlyout> </Grid.ContextFlyout> </Grid> </Grid> - <Grid - wctui:FrameworkElementExtensions.Cursor="Hand" - Column="1" - CornerRadius="{ThemeResource ControlCornerRadius}"> + <Grid Column="1" Style="{StaticResource NotepadsInteractiveLargeGridStyle}"> <TextBlock x:Name="PathIndicator" Padding="4,4,8,4" IsTapEnabled="True" Style="{StaticResource StatusBarTextBlockStyle}" Tapped="StatusBarComponent_OnTapped"> - - <Interactivity:Interaction.Behaviors> - <Core:EventTriggerBehavior EventName="PointerEntered"> - <Core:ChangePropertyAction PropertyName="Opacity"> - <Core:ChangePropertyAction.Value> - 0.7 - </Core:ChangePropertyAction.Value> - </Core:ChangePropertyAction> - </Core:EventTriggerBehavior> - - <Core:EventTriggerBehavior EventName="PointerExited"> - <Core:ChangePropertyAction PropertyName="Opacity"> - <Core:ChangePropertyAction.Value> - 1.0 - </Core:ChangePropertyAction.Value> - </Core:ChangePropertyAction> - </Core:EventTriggerBehavior> - </Interactivity:Interaction.Behaviors> <TextBlock.ContextFlyout> <MenuFlyout x:Name="PathIndicatorFlyout" Closing="StatusBarFlyout_OnClosing" + MenuFlyoutPresenterStyle="{StaticResource StatusBarFlyoutStyle}" Placement="TopEdgeAlignedLeft"> <MenuFlyoutItem x:Name="PathIndicatorFlyoutReloadFileFromDiskFlyoutItem" @@ -488,38 +450,12 @@ <KeyboardAccelerator Key="F2" IsEnabled="False" /> </MenuFlyoutItem.KeyboardAccelerators> </MenuFlyoutItem> - <MenuFlyout.MenuFlyoutPresenterStyle> - <Style TargetType="MenuFlyoutPresenter"> - <Setter Property="BorderThickness" Value="0" /> - </Style> - </MenuFlyout.MenuFlyoutPresenterStyle> </MenuFlyout> </TextBlock.ContextFlyout> </TextBlock> </Grid> - <Grid - wctui:FrameworkElementExtensions.Cursor="Hand" - Column="2" - CornerRadius="{ThemeResource ControlCornerRadius}"> - <Interactivity:Interaction.Behaviors> - <Core:EventTriggerBehavior EventName="PointerEntered"> - <Core:ChangePropertyAction PropertyName="Background"> - <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}" /> - </Core:ChangePropertyAction.Value> - </Core:ChangePropertyAction> - </Core:EventTriggerBehavior> - - <Core:EventTriggerBehavior EventName="PointerExited"> - <Core:ChangePropertyAction PropertyName="Background"> - <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="Transparent" /> - </Core:ChangePropertyAction.Value> - </Core:ChangePropertyAction> - </Core:EventTriggerBehavior> - </Interactivity:Interaction.Behaviors> - + <Grid Column="2" Style="{StaticResource NotepadsInteractiveGridStyle}"> <TextBlock x:Name="ModificationIndicator" Foreground="{StaticResource SystemControlForegroundAccentBrush}" @@ -530,6 +466,7 @@ <MenuFlyout x:Name="ModificationFlyout" Closing="StatusBarFlyout_OnClosing" + MenuFlyoutPresenterStyle="{StaticResource StatusBarFlyoutStyle}" Placement="TopEdgeAlignedRight"> <MenuFlyoutItem x:Name="PreviewTextChangesFlyoutItem" @@ -554,12 +491,6 @@ <FontIcon Glyph="" /> </MenuFlyoutItem.Icon> </MenuFlyoutItem> - - <MenuFlyout.MenuFlyoutPresenterStyle> - <Style TargetType="MenuFlyoutPresenter"> - <Setter Property="BorderThickness" Value="0" /> - </Style> - </MenuFlyout.MenuFlyoutPresenterStyle> </MenuFlyout> </TextBlock.ContextFlyout> </TextBlock> @@ -567,26 +498,8 @@ <Grid x:Name="LineColumnIndicatorButton" - wctui:FrameworkElementExtensions.Cursor="Hand" Column="3" - CornerRadius="{ThemeResource ControlCornerRadius}"> - <Interactivity:Interaction.Behaviors> - <Core:EventTriggerBehavior EventName="PointerEntered"> - <Core:ChangePropertyAction PropertyName="Background"> - <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}" /> - </Core:ChangePropertyAction.Value> - </Core:ChangePropertyAction> - </Core:EventTriggerBehavior> - - <Core:EventTriggerBehavior EventName="PointerExited"> - <Core:ChangePropertyAction PropertyName="Background"> - <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="Transparent" /> - </Core:ChangePropertyAction.Value> - </Core:ChangePropertyAction> - </Core:EventTriggerBehavior> - </Interactivity:Interaction.Behaviors> + Style="{StaticResource NotepadsInteractiveGridStyle}"> <TextBlock x:Name="LineColumnIndicator" IsTapEnabled="True" @@ -594,125 +507,69 @@ Tapped="StatusBarComponent_OnTapped" /> </Grid> - <Grid - wctui:FrameworkElementExtensions.Cursor="Hand" - Column="4" - CornerRadius="{ThemeResource ControlCornerRadius}"> - <Interactivity:Interaction.Behaviors> - <Core:EventTriggerBehavior EventName="PointerEntered"> - <Core:ChangePropertyAction PropertyName="Background"> - <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}" /> - </Core:ChangePropertyAction.Value> - </Core:ChangePropertyAction> - </Core:EventTriggerBehavior> - - <Core:EventTriggerBehavior EventName="PointerExited"> - <Core:ChangePropertyAction PropertyName="Background"> - <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="Transparent" /> - </Core:ChangePropertyAction.Value> - </Core:ChangePropertyAction> - </Core:EventTriggerBehavior> - </Interactivity:Interaction.Behaviors> - + <Grid Column="4" Style="{StaticResource NotepadsInteractiveGridStyle}"> <TextBlock x:Name="FontZoomIndicator" IsTapEnabled="True" Style="{StaticResource StatusBarTextBlockStyle}" Tapped="StatusBarComponent_OnTapped"> <TextBlock.ContextFlyout> - <Flyout + <muxc:CommandBarFlyout x:Name="FontZoomIndicatorFlyout" + AlwaysExpanded="True" Closing="StatusBarFlyout_OnClosing" Placement="TopEdgeAlignedRight"> - <StackPanel> - <StackPanel Margin="-10,0,-10,0" Orientation="Horizontal"> - <AppBarButton - x:Name="ZoomOut" - x:Uid="TextEditor_FontZoomIndicator_FlyoutItem_ZoomOut" - Width="40" - VerticalAlignment="Center" - BorderBrush="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}" - Click="FontZoomIndicatorFlyoutSelection_OnClick" - CornerRadius="{ThemeResource ControlCornerRadius}" - KeyboardAcceleratorTextOverride="Ctrl+Minus" - LabelPosition="Collapsed"> - <AppBarButton.Icon> - <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> - </AppBarButton.Icon> - <AppBarButton.KeyboardAccelerators> - <KeyboardAccelerator - Key="Subtract" - IsEnabled="False" - Modifiers="Control" /> - </AppBarButton.KeyboardAccelerators> - </AppBarButton> - <Slider - x:Name="FontZoomSlider" - Width="150" - Margin="5" - VerticalAlignment="Center" - Maximum="500" - Minimum="10" - ValueChanged="FontZoomSlider_ValueChanged" - Value="100" /> - <AppBarButton - x:Name="ZoomIn" - x:Uid="TextEditor_FontZoomIndicator_FlyoutItem_ZoomIn" - Width="40" - VerticalAlignment="Center" - BorderBrush="{ThemeResource SystemControlBackgroundTransparentRevealBorderBrush}" - Click="FontZoomIndicatorFlyoutSelection_OnClick" - CornerRadius="{ThemeResource ControlCornerRadius}" - KeyboardAcceleratorTextOverride="Ctrl+Plus" - LabelPosition="Collapsed"> - <AppBarButton.Icon> - <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> - </AppBarButton.Icon> - <AppBarButton.KeyboardAccelerators> - <KeyboardAccelerator - Key="Add" - IsEnabled="False" - Modifiers="Control" /> - </AppBarButton.KeyboardAccelerators> - </AppBarButton> - </StackPanel> - <StackPanel Margin="5,-5,0,0" Orientation="Horizontal"> - <TextBlock - x:Name="MinZoom" - Margin="30,0,0,0" - FontSize="10" - Text="10%" /> - <TextBlock - x:Name="MaxZoom" - Margin="108,0,0,0" - FontSize="10" - Text="500%" /> - </StackPanel> - <StackPanel - Margin="0,-15,0,0" - HorizontalAlignment="Center" - Orientation="Horizontal"> - <TextBlock - VerticalAlignment="Center" - FontSize="15" - Text="{x:Bind FontZoomSlider.Value, Mode=OneWay}" /> - <TextBlock - VerticalAlignment="Center" - FontSize="15" - Text="%" /> - </StackPanel> + <AppBarButton + x:Name="ZoomOut" + x:Uid="TextEditor_FontZoomIndicator_FlyoutItem_ZoomOut" + Click="FontZoomIndicatorFlyoutSelection_OnClick" + KeyboardAcceleratorTextOverride="Ctrl+Minus" + LabelPosition="Collapsed"> + <AppBarButton.Icon> + <FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> + </AppBarButton.Icon> + <AppBarButton.KeyboardAccelerators> + <KeyboardAccelerator + Key="Subtract" + IsEnabled="False" + Modifiers="Control" /> + </AppBarButton.KeyboardAccelerators> + </AppBarButton> + <AppBarElementContainer> + <Slider + x:Name="FontZoomSlider" + Width="180" + Margin="0,2,0,0" + Maximum="500" + Minimum="10" + StepFrequency="1" + TickFrequency="90" + TickPlacement="Outside" + ValueChanged="FontZoomSlider_ValueChanged" + Value="100" /> + </AppBarElementContainer> + <AppBarButton + x:Name="ZoomIn" + x:Uid="TextEditor_FontZoomIndicator_FlyoutItem_ZoomIn" + Click="FontZoomIndicatorFlyoutSelection_OnClick" + KeyboardAcceleratorTextOverride="Ctrl+Plus" + LabelPosition="Collapsed"> + <AppBarButton.Icon> + <FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> + </AppBarButton.Icon> + <AppBarButton.KeyboardAccelerators> + <KeyboardAccelerator + Key="Add" + IsEnabled="False" + Modifiers="Control" /> + </AppBarButton.KeyboardAccelerators> + </AppBarButton> + <muxc:CommandBarFlyout.SecondaryCommands> <AppBarButton x:Name="RestoreDefaultZoom" x:Uid="TextEditor_FontZoomIndicator_FlyoutItem_RestoreDefaultZoom" - Margin="-10,5,-10,-5" - HorizontalAlignment="Stretch" - VerticalAlignment="Center" Click="FontZoomIndicatorFlyoutSelection_OnClick" - CornerRadius="{ThemeResource ControlCornerRadius}" - Icon="Undo" - Style="{StaticResource CustomAppBarButtonLabelToRightStyle}"> + Icon="Undo"> <AppBarButton.KeyboardAccelerators> <KeyboardAccelerator Key="Number0" @@ -720,39 +577,13 @@ Modifiers="Control" /> </AppBarButton.KeyboardAccelerators> </AppBarButton> - </StackPanel> - <Flyout.FlyoutPresenterStyle> - <Style TargetType="FlyoutPresenter"> - <Setter Property="BorderThickness" Value="0" /> - </Style> - </Flyout.FlyoutPresenterStyle> - </Flyout> + </muxc:CommandBarFlyout.SecondaryCommands> + </muxc:CommandBarFlyout> </TextBlock.ContextFlyout> </TextBlock> </Grid> - <Grid - wctui:FrameworkElementExtensions.Cursor="Hand" - Column="5" - CornerRadius="{ThemeResource ControlCornerRadius}"> - <Interactivity:Interaction.Behaviors> - <Core:EventTriggerBehavior EventName="PointerEntered"> - <Core:ChangePropertyAction PropertyName="Background"> - <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}" /> - </Core:ChangePropertyAction.Value> - </Core:ChangePropertyAction> - </Core:EventTriggerBehavior> - - <Core:EventTriggerBehavior EventName="PointerExited"> - <Core:ChangePropertyAction PropertyName="Background"> - <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="Transparent" /> - </Core:ChangePropertyAction.Value> - </Core:ChangePropertyAction> - </Core:EventTriggerBehavior> - </Interactivity:Interaction.Behaviors> - + <Grid Column="5" Style="{StaticResource NotepadsInteractiveGridStyle}"> <TextBlock x:Name="LineEndingIndicator" IsTapEnabled="True" @@ -762,6 +593,7 @@ <MenuFlyout x:Name="LineEndingSelectionFlyout" Closing="StatusBarFlyout_OnClosing" + MenuFlyoutPresenterStyle="{StaticResource StatusBarFlyoutStyle}" Placement="TopEdgeAlignedRight"> <MenuFlyoutItem Click="LineEndingSelection_OnClick" @@ -775,38 +607,12 @@ Click="LineEndingSelection_OnClick" Tag="LF" Text="Unix (LF)" /> - <MenuFlyout.MenuFlyoutPresenterStyle> - <Style TargetType="MenuFlyoutPresenter"> - <Setter Property="BorderThickness" Value="0" /> - </Style> - </MenuFlyout.MenuFlyoutPresenterStyle> </MenuFlyout> </TextBlock.ContextFlyout> </TextBlock> </Grid> - <Grid - wctui:FrameworkElementExtensions.Cursor="Hand" - Column="6" - CornerRadius="{ThemeResource ControlCornerRadius}"> - <Interactivity:Interaction.Behaviors> - <Core:EventTriggerBehavior EventName="PointerEntered"> - <Core:ChangePropertyAction PropertyName="Background"> - <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}" /> - </Core:ChangePropertyAction.Value> - </Core:ChangePropertyAction> - </Core:EventTriggerBehavior> - - <Core:EventTriggerBehavior EventName="PointerExited"> - <Core:ChangePropertyAction PropertyName="Background"> - <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="Transparent" /> - </Core:ChangePropertyAction.Value> - </Core:ChangePropertyAction> - </Core:EventTriggerBehavior> - </Interactivity:Interaction.Behaviors> - + <Grid Column="6" Style="{StaticResource NotepadsInteractiveGridStyle}"> <TextBlock x:Name="EncodingIndicator" IsTapEnabled="True" @@ -816,50 +622,23 @@ <MenuFlyout x:Name="EncodingSelectionFlyout" Closing="StatusBarFlyout_OnClosing" - Placement="TopEdgeAlignedRight"> - <MenuFlyout.MenuFlyoutPresenterStyle> - <Style TargetType="MenuFlyoutPresenter"> - <Setter Property="BorderThickness" Value="0" /> - </Style> - </MenuFlyout.MenuFlyoutPresenterStyle> - </MenuFlyout> + MenuFlyoutPresenterStyle="{StaticResource StatusBarFlyoutStyle}" + Placement="TopEdgeAlignedRight" /> </TextBlock.ContextFlyout> </TextBlock> </Grid> <Grid - wctui:FrameworkElementExtensions.Cursor="Hand" + x:Name="ShadowWindowIndicator" + Padding="6,6,6,6" Column="7" - CornerRadius="{ThemeResource ControlCornerRadius}"> - <Interactivity:Interaction.Behaviors> - <Core:EventTriggerBehavior EventName="PointerEntered"> - <Core:ChangePropertyAction PropertyName="Background"> - <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}" /> - </Core:ChangePropertyAction.Value> - </Core:ChangePropertyAction> - </Core:EventTriggerBehavior> - - <Core:EventTriggerBehavior EventName="PointerExited"> - <Core:ChangePropertyAction PropertyName="Background"> - <Core:ChangePropertyAction.Value> - <SolidColorBrush Color="Transparent" /> - </Core:ChangePropertyAction.Value> - </Core:ChangePropertyAction> - </Core:EventTriggerBehavior> - </Interactivity:Interaction.Behaviors> - - <Grid - x:Name="ShadowWindowIndicator" - Padding="6,6,6,6" - CornerRadius="{ThemeResource ControlCornerRadius}" - IsTapEnabled="True" - Tapped="StatusBarComponent_OnTapped" - Visibility="Collapsed"> - <Viewbox> - <FontIcon Foreground="{ThemeResource SystemControlForegroundBaseMediumHighBrush}" Glyph="" /> - </Viewbox> - </Grid> + IsTapEnabled="True" + Style="{StaticResource NotepadsInteractiveGridStyle}" + Tapped="StatusBarComponent_OnTapped" + Visibility="Collapsed"> + <Viewbox> + <FontIcon Foreground="{ThemeResource SystemControlForegroundBaseMediumHighBrush}" Glyph="" /> + </Viewbox> </Grid> </Grid> diff --git a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml.cs b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml.cs index 1c5c45016..ea41c10fe 100644 --- a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml.cs +++ b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml.cs @@ -127,7 +127,8 @@ private void InitializeControls() ToolTipService.SetToolTip(ExitCompactOverlayButton, _resourceLoader.GetString("App_ExitCompactOverlayMode_Text")); RootSplitView.PaneOpening += delegate { SettingsFrame.Navigate(typeof(SettingsPage), null, new SuppressNavigationTransitionInfo()); }; RootSplitView.PaneClosed += delegate { NotepadsCore.FocusOnSelectedTextEditor(); }; - NewSetButton.Click += delegate { NotepadsCore.OpenNewTextEditor(_defaultNewFileName); }; + Sets.AddTabButtonClick += delegate { NotepadsCore.OpenNewTextEditor(_defaultNewFileName); }; + //NewSetButton.Click += delegate { NotepadsCore.OpenNewTextEditor(_defaultNewFileName); }; } private void InitializeKeyboardShortcuts() @@ -172,7 +173,7 @@ private static async Task OpenNewAppInstance() } } - #region Application Life Cycle & Window management + #region Application Life Cycle & Window management // Handles external links or cmd args activation before Sets loaded protected override void OnNavigatedTo(NavigationEventArgs e) @@ -269,7 +270,7 @@ private async void Sets_Loaded(object sender, RoutedEventArgs e) // An issue with the Game Bar extension model and Windows platform prevents the Notepads process from exiting cleanly // when more than one CoreWindow has been created, and NotepadsMainPage is the last to close. The common case for this // is to open Notepads in Game Bar, then open its settings, then close the settings and finally close Notepads. - // This puts the process in a bad state where it will no longer open in Game Bar and the Notepads process is orphaned. + // This puts the process in a bad state where it will no longer open in Game Bar and the Notepads process is orphaned. // To work around this do not use the EnteredBackground event when running as a widget. // Microsoft is tracking this issue as VSO#25735260 Application.Current.EnteredBackground -= App_EnteredBackground; diff --git a/src/Notepads/Views/Settings/SettingsPage.xaml b/src/Notepads/Views/Settings/SettingsPage.xaml index 763811473..191460d38 100644 --- a/src/Notepads/Views/Settings/SettingsPage.xaml +++ b/src/Notepads/Views/Settings/SettingsPage.xaml @@ -11,37 +11,48 @@ <muxc:NavigationView x:Name="SettingsNavigationView" + CompactModeThresholdWidth="10" IsBackButtonVisible="Collapsed" IsBackEnabled="False" IsPaneOpen="False" IsSettingsVisible="False" ItemInvoked="SettingsPanel_OnItemInvoked" OpenPaneLength="200" - PaneDisplayMode="LeftCompact" + PaneDisplayMode="Top" PaneToggleButtonStyle="{StaticResource PaneToggleButtonStyle}"> <muxc:NavigationView.MenuItems> <muxc:NavigationViewItem x:Uid="/Settings/TextAndEditorPage_Title" + Width="78" IsSelected="True" Tag="TextAndEditor"> <muxc:NavigationViewItem.Icon> - <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> + <FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> </muxc:NavigationViewItem.Icon> </muxc:NavigationViewItem> - <muxc:NavigationViewItem x:Uid="/Settings/PersonalizationPage_Title" Tag="Personalization"> + <muxc:NavigationViewItem + x:Uid="/Settings/PersonalizationPage_Title" + Width="78" + Tag="Personalization"> <muxc:NavigationViewItem.Icon> - <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> + <FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> </muxc:NavigationViewItem.Icon> </muxc:NavigationViewItem> - <muxc:NavigationViewItem x:Uid="/Settings/AdvancedPage_Title" Tag="Advanced"> + <muxc:NavigationViewItem + x:Uid="/Settings/AdvancedPage_Title" + Width="78" + Tag="Advanced"> <muxc:NavigationViewItem.Icon> - <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> + <FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> </muxc:NavigationViewItem.Icon> </muxc:NavigationViewItem> - <muxc:NavigationViewItem x:Uid="/Settings/AboutPage_Title" Tag="About"> + <muxc:NavigationViewItem + x:Uid="/Settings/AboutPage_Title" + Width="78" + Tag="About"> <muxc:NavigationViewItem.Icon> - <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" /> + <FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> </muxc:NavigationViewItem.Icon> </muxc:NavigationViewItem> </muxc:NavigationView.MenuItems> diff --git a/src/Notepads/Views/Settings/SettingsPage.xaml.cs b/src/Notepads/Views/Settings/SettingsPage.xaml.cs index 8378e28ea..5d512d188 100644 --- a/src/Notepads/Views/Settings/SettingsPage.xaml.cs +++ b/src/Notepads/Views/Settings/SettingsPage.xaml.cs @@ -32,7 +32,7 @@ private void SettingsPage_Loaded(object sender, RoutedEventArgs e) var firstItem = ((NavigationViewItem)SettingsNavigationView.MenuItems.First()); firstItem.IsSelected = true; - SettingsPanel.Show(firstItem.Content.ToString(), firstItem?.Tag as string); + SettingsPanel.Show(Windows.UI.Xaml.Controls.ToolTipService.GetToolTip(firstItem).ToString(), firstItem?.Tag as string); } private void SettingsPage_Unloaded(object sender, RoutedEventArgs e) @@ -70,7 +70,7 @@ protected override void OnNavigatedTo(NavigationEventArgs e) private void SettingsPanel_OnItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args) { - SettingsPanel.Show((args.InvokedItem as string), (args.InvokedItemContainer as NavigationViewItem)?.Tag as string); + SettingsPanel.Show((Windows.UI.Xaml.Controls.ToolTipService.GetToolTip(args.InvokedItemContainer) as string), (args.InvokedItemContainer as NavigationViewItem)?.Tag as string); } } } \ No newline at end of file diff --git a/src/Notepads/Views/Settings/SettingsPanel.xaml b/src/Notepads/Views/Settings/SettingsPanel.xaml index e838a71be..57857fbcb 100644 --- a/src/Notepads/Views/Settings/SettingsPanel.xaml +++ b/src/Notepads/Views/Settings/SettingsPanel.xaml @@ -7,22 +7,6 @@ Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" mc:Ignorable="d"> - <Page.Resources> - <ResourceDictionary> - <ResourceDictionary.ThemeDictionaries> - <ResourceDictionary x:Key="Light"> - <SolidColorBrush x:Key="SettingsPanelBackgroundBrush" Color="WhiteSmoke" /> - </ResourceDictionary> - <ResourceDictionary x:Key="Dark"> - <SolidColorBrush x:Key="SettingsPanelBackgroundBrush" Color="#222222" /> - </ResourceDictionary> - <ResourceDictionary x:Key="HighContrast"> - <SolidColorBrush x:Key="SettingsPanelBackgroundBrush" Color="{StaticResource SystemColorHighlightColor}" /> - </ResourceDictionary> - </ResourceDictionary.ThemeDictionaries> - </ResourceDictionary> - </Page.Resources> - <Grid Background="{ThemeResource SettingsPanelBackgroundBrush}"> <Grid.RowDefinitions> <RowDefinition Height="60" /> From def50d1c397e3e9c707ed90a10eabfbad92da413 Mon Sep 17 00:00:00 2001 From: Soumya Ranjan Mahunt <devsoumyamahunt@gmail.com> Date: Sun, 1 Aug 2021 17:44:39 +0530 Subject: [PATCH 14/15] ui: center settings tabs --- .../Resource/NotepadsSettingsViewStyle.xaml | 36 ++++++++++--------- src/Notepads/Views/Settings/SettingsPage.xaml | 8 ++--- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/Notepads/Resource/NotepadsSettingsViewStyle.xaml b/src/Notepads/Resource/NotepadsSettingsViewStyle.xaml index a758b094e..c8274e5a4 100644 --- a/src/Notepads/Resource/NotepadsSettingsViewStyle.xaml +++ b/src/Notepads/Resource/NotepadsSettingsViewStyle.xaml @@ -138,10 +138,10 @@ <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="*" MinWidth="{ThemeResource TopNavigationViewPaneCustomContentMinWidth}" /> - <ColumnDefinition Width="Auto" /> + <!--<ColumnDefinition Width="*" MinWidth="{ThemeResource TopNavigationViewPaneCustomContentMinWidth}" /> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" />--> </Grid.ColumnDefinitions> <Grid @@ -183,7 +183,7 @@ </ScrollViewer> </muxc:ItemsRepeaterScrollHost> - <Button + <!--<Button x:Name="TopNavOverflowButton" Grid.Column="4" Margin="{ThemeResource TopNavigationViewOverflowButtonMargin}" @@ -196,7 +196,9 @@ <Flyout.FlyoutPresenterStyle> <Style TargetType="FlyoutPresenter"> <Setter Property="Padding" Value="{ThemeResource TopNavigationViewOverflowMenuPadding}" /> - <!-- Set negative top margin to make the flyout align exactly with the button --> + --> + <!-- Set negative top margin to make the flyout align exactly with the button --> + <!-- <Setter Property="Margin" Value="0,-4,0,0" /> <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto" /> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" /> @@ -244,16 +246,16 @@ </muxc:ItemsRepeaterScrollHost> </Flyout> </Button.Flyout> - </Button> + </Button>--> - <ContentControl + <!--<ContentControl x:Name="PaneCustomContentOnTopPane" Grid.Column="5" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" - IsTabStop="False" /> + IsTabStop="False" />--> - <Grid + <!--<Grid x:Name="TopPaneAutoSuggestArea" Grid.Column="6" Height="{ThemeResource NavigationViewTopPaneHeight}"> @@ -265,16 +267,16 @@ HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center" IsTabStop="False" /> - </Grid> + </Grid>--> - <ContentControl + <!--<ContentControl x:Name="PaneFooterOnTopPane" Grid.Column="7" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" - IsTabStop="False" /> + IsTabStop="False" />--> <!-- Top footer menu ItemsRepeater --> - <muxc:ItemsRepeater + <!--<muxc:ItemsRepeater x:Name="TopFooterMenuItemsHost" Grid.Column="8" AutomationProperties.AccessibilityView="Content" @@ -282,7 +284,7 @@ <muxc:ItemsRepeater.Layout> <muxc:StackLayout Orientation="Horizontal" /> </muxc:ItemsRepeater.Layout> - </muxc:ItemsRepeater> + </muxc:ItemsRepeater>--> </Grid> <Border x:Name="TopNavContentOverlayAreaGrid" Child="{TemplateBinding ContentOverlay}" /> @@ -579,7 +581,7 @@ </VisualState> </VisualStateGroup> - <VisualStateGroup x:Name="AutoSuggestGroup"> + <!--<VisualStateGroup x:Name="AutoSuggestGroup"> <VisualState x:Name="AutoSuggestBoxVisible" /> <VisualState x:Name="AutoSuggestBoxCollapsed"> <VisualState.Setters> @@ -587,7 +589,7 @@ <Setter Target="TopPaneAutoSuggestArea.Visibility" Value="Collapsed" /> </VisualState.Setters> </VisualState> - </VisualStateGroup> + </VisualStateGroup>--> <VisualStateGroup x:Name="PaneStateGroup"> <VisualState x:Name="NotClosedCompact" /> @@ -669,14 +671,14 @@ </VisualState> </VisualStateGroup> - <VisualStateGroup x:Name="OverflowLabelGroup"> + <!--<VisualStateGroup x:Name="OverflowLabelGroup"> <VisualState x:Name="OverflowButtonWithLabel" /> <VisualState x:Name="OverflowButtonNoLabel"> <VisualState.Setters> <Setter Target="TopNavOverflowButton.Style" Value="{ThemeResource NavigationViewOverflowButtonNoLabelStyleWhenPaneOnTop}" /> </VisualState.Setters> </VisualState> - </VisualStateGroup> + </VisualStateGroup>--> <VisualStateGroup x:Name="BackButtonGroup"> <VisualState x:Name="BackButtonVisible" /> diff --git a/src/Notepads/Views/Settings/SettingsPage.xaml b/src/Notepads/Views/Settings/SettingsPage.xaml index 191460d38..1fd5a6ea4 100644 --- a/src/Notepads/Views/Settings/SettingsPage.xaml +++ b/src/Notepads/Views/Settings/SettingsPage.xaml @@ -24,7 +24,7 @@ <muxc:NavigationView.MenuItems> <muxc:NavigationViewItem x:Uid="/Settings/TextAndEditorPage_Title" - Width="78" + Width="90" IsSelected="True" Tag="TextAndEditor"> <muxc:NavigationViewItem.Icon> @@ -33,7 +33,7 @@ </muxc:NavigationViewItem> <muxc:NavigationViewItem x:Uid="/Settings/PersonalizationPage_Title" - Width="78" + Width="90" Tag="Personalization"> <muxc:NavigationViewItem.Icon> <FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> @@ -41,7 +41,7 @@ </muxc:NavigationViewItem> <muxc:NavigationViewItem x:Uid="/Settings/AdvancedPage_Title" - Width="78" + Width="90" Tag="Advanced"> <muxc:NavigationViewItem.Icon> <FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> @@ -49,7 +49,7 @@ </muxc:NavigationViewItem> <muxc:NavigationViewItem x:Uid="/Settings/AboutPage_Title" - Width="78" + Width="90" Tag="About"> <muxc:NavigationViewItem.Icon> <FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> From 4ca77a3b220acd68663fe25784ef88fc44b9dc9d Mon Sep 17 00:00:00 2001 From: Soumya Ranjan Mahunt <devsoumyamahunt@gmail.com> Date: Sun, 1 Aug 2021 22:13:25 +0530 Subject: [PATCH 15/15] ui: add animated icon to settings --- .../Resource/NotepadsTabViewStyle.xaml | 16 ++++++++++++ .../Views/MainPage/NotepadsMainPage.xaml | 5 +--- src/Notepads/Views/Settings/SettingsPage.xaml | 25 ++++++++++++++++--- 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/Notepads/Resource/NotepadsTabViewStyle.xaml b/src/Notepads/Resource/NotepadsTabViewStyle.xaml index 86892c8dc..ee3f1cbf5 100644 --- a/src/Notepads/Resource/NotepadsTabViewStyle.xaml +++ b/src/Notepads/Resource/NotepadsTabViewStyle.xaml @@ -492,6 +492,14 @@ <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> + <!-- Scroll to the left button bottom shadow --> + <wctc:DropShadowPanel Grid.Column="0" Style="{StaticResource BottomEdgeShadowStyle}"> + <Grid Height="1" Margin="-1,0,0,-1" /> + <wctc:DropShadowPanel.Clip> + <RectangleGeometry Rect="-1,-12,1024,12" /> + </wctc:DropShadowPanel.Clip> + </wctc:DropShadowPanel> + <Border x:Name="ScrollDecreaseButtonContainer" Padding="{StaticResource TabViewItemLeftScrollButtonContainerPadding}" @@ -513,6 +521,14 @@ Padding="1,0,0,0" TabFocusNavigation="Once" /> + <!-- Scroll to the right button bottom shadow --> + <wctc:DropShadowPanel Grid.Column="2" Style="{StaticResource BottomEdgeShadowStyle}"> + <Grid Height="1" Margin="0,0,0,-1" /> + <wctc:DropShadowPanel.Clip> + <RectangleGeometry Rect="0,-12,1024,12" /> + </wctc:DropShadowPanel.Clip> + </wctc:DropShadowPanel> + <Border x:Name="ScrollIncreaseButtonContainer" Grid.Column="2" diff --git a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml index 84dd6bb4b..c3afcbd97 100644 --- a/src/Notepads/Views/MainPage/NotepadsMainPage.xaml +++ b/src/Notepads/Views/MainPage/NotepadsMainPage.xaml @@ -102,10 +102,7 @@ BorderThickness="0" IsTabStop="False" Style="{StaticResource TabViewButtonStyle}"> - <muxc:AnimatedIcon - x:Name="MainMenuButtonIcon" - MaxWidth="16" - MaxHeight="16"> + <muxc:AnimatedIcon MaxWidth="16" MaxHeight="16"> <muxc:AnimatedIcon.Source> <muxca:AnimatedGlobalNavigationButtonVisualSource /> </muxc:AnimatedIcon.Source> diff --git a/src/Notepads/Views/Settings/SettingsPage.xaml b/src/Notepads/Views/Settings/SettingsPage.xaml index 1fd5a6ea4..874362f63 100644 --- a/src/Notepads/Views/Settings/SettingsPage.xaml +++ b/src/Notepads/Views/Settings/SettingsPage.xaml @@ -5,6 +5,7 @@ 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" + xmlns:muxca="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals" xmlns:settings="using:Notepads.Views.Settings" Background="{ThemeResource SystemControlForegroundTransparentBrush}" mc:Ignorable="d"> @@ -28,7 +29,11 @@ IsSelected="True" Tag="TextAndEditor"> <muxc:NavigationViewItem.Icon> - <FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> + <muxc:AnimatedIcon> + <muxc:AnimatedIcon.FallbackIconSource> + <muxc:FontIconSource FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> + </muxc:AnimatedIcon.FallbackIconSource> + </muxc:AnimatedIcon> </muxc:NavigationViewItem.Icon> </muxc:NavigationViewItem> <muxc:NavigationViewItem @@ -36,7 +41,11 @@ Width="90" Tag="Personalization"> <muxc:NavigationViewItem.Icon> - <FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> + <muxc:AnimatedIcon> + <muxc:AnimatedIcon.FallbackIconSource> + <muxc:FontIconSource FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> + </muxc:AnimatedIcon.FallbackIconSource> + </muxc:AnimatedIcon> </muxc:NavigationViewItem.Icon> </muxc:NavigationViewItem> <muxc:NavigationViewItem @@ -44,7 +53,11 @@ Width="90" Tag="Advanced"> <muxc:NavigationViewItem.Icon> - <FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> + <muxc:AnimatedIcon> + <muxc:AnimatedIcon.FallbackIconSource> + <muxc:FontIconSource FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> + </muxc:AnimatedIcon.FallbackIconSource> + </muxc:AnimatedIcon> </muxc:NavigationViewItem.Icon> </muxc:NavigationViewItem> <muxc:NavigationViewItem @@ -52,7 +65,11 @@ Width="90" Tag="About"> <muxc:NavigationViewItem.Icon> - <FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> + <muxc:AnimatedIcon> + <muxc:AnimatedIcon.FallbackIconSource> + <muxc:FontIconSource FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="" /> + </muxc:AnimatedIcon.FallbackIconSource> + </muxc:AnimatedIcon> </muxc:NavigationViewItem.Icon> </muxc:NavigationViewItem> </muxc:NavigationView.MenuItems>