From f9541bff846bd34b7a0b6b5b40dce2f5a087a578 Mon Sep 17 00:00:00 2001 From: ArchieCoder Date: Wed, 4 Aug 2021 14:49:09 -0400 Subject: [PATCH 1/9] Completed --- .../Microsoft.Toolkit.Uwp.SampleApp.csproj | 9 +++ .../KeyDownTriggerBehaviorPage.xaml | 60 +++++++++++++++++ .../KeyDownTriggerBehaviorPage.xaml.cs | 16 +++++ .../KeyDownTriggerBehaviorXaml.bind | 58 ++++++++++++++++ .../SamplePages/samples.json | 18 +++-- .../Keyboard/KeyDownTriggerBehavior.cs | 66 +++++++++++++++++++ 6 files changed, 223 insertions(+), 4 deletions(-) create mode 100644 Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorPage.xaml create mode 100644 Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorPage.xaml.cs create mode 100644 Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorXaml.bind create mode 100644 Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs diff --git a/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj b/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj index 07b878addb8..ef365f43ba0 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj +++ b/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj @@ -503,6 +503,9 @@ FocusBehaviorPage.xaml + + KeyDownTriggerBehaviorPage.xaml + MetadataControlPage.xaml @@ -626,6 +629,7 @@ Designer + @@ -974,6 +978,10 @@ Designer + + MSBuild:Compile + Designer + Designer MSBuild:Compile @@ -1475,6 +1483,7 @@ Visual C++ 2015 Runtime for Universal Windows Platform Apps + 14.0 diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorPage.xaml b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorPage.xaml new file mode 100644 index 00000000000..d5b605fc0f4 --- /dev/null +++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorPage.xaml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorPage.xaml.cs b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorPage.xaml.cs new file mode 100644 index 00000000000..d777b3137cb --- /dev/null +++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorPage.xaml.cs @@ -0,0 +1,16 @@ +// 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. + +using Windows.UI.Xaml.Controls; + +namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages +{ + /// + /// A page that shows how to use the AutoFocusBehavior + /// + public sealed partial class KeyDownTriggerBehaviorPage : Page + { + public KeyDownTriggerBehaviorPage() => InitializeComponent(); + } +} \ No newline at end of file diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorXaml.bind b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorXaml.bind new file mode 100644 index 00000000000..0fc18f48c5e --- /dev/null +++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorXaml.bind @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json index b07fedab76b..1a4ccac2cd9 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json +++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json @@ -785,7 +785,7 @@ "Type": "ThemeListenerPage", "Subcategory": "Systems", "About": "The ThemeListener allows you to keep track of changes to the System Theme.", - "CodeUrl" : "https://github.com/CommunityToolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Helpers/ThemeListener.cs", + "CodeUrl": "https://github.com/CommunityToolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Helpers/ThemeListener.cs", "Icon": "/Assets/Helpers.png", "DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/ThemeListener.md" }, @@ -839,12 +839,22 @@ "Icon": "/Assets/Helpers.png", "DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/behaviors/AutoSelectBehavior.md" }, + { + "Name": "KeyDownTriggerBehavior", + "Type": "KeyDownTriggerBehaviorPage", + "Subcategory": "Systems", + "About": "Behavior to listen to a key press on a control and executes actions", + "CodeUrl": "https://github.com/CommunityToolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs", + "XamlCodeFile": "KeyDownTriggerBehaviorXaml.bind", + "Icon": "/Assets/Helpers.png", + "DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/behaviors/KeyboardBehaviors.md" + }, { "Name": "Win2d Path Mini Language Parser", "Type": "CanvasPathGeometryPage", "Subcategory": "Parser", "About": "CanvasPathGeometry class allows you to convert Win2d Path Mini Language string to CanvasGeometry, Brushes, CanvasStrokes or CanvasStrokeStyles.", - "CodeUrl" : "https://github.com/CommunityToolkit/WindowsCommunityToolkit/tree/main/Microsoft.Toolkit.Uwp.UI.Media/Geometry", + "CodeUrl": "https://github.com/CommunityToolkit/WindowsCommunityToolkit/tree/main/Microsoft.Toolkit.Uwp.UI.Media/Geometry", "Icon": "/SamplePages/CanvasPathGeometry/CanvasPathGeometry.png", "DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/parsers/CanvasPathGeometry.md" }, @@ -882,7 +892,7 @@ "Name": "Guard APIs", "Subcategory": "Developer", "About": "The Guard APIs can be used to validate method arguments in a streamlined manner, which is also faster, less verbose, more expressive and less error prone than manually writing checks and throwing exceptions.", - "CodeUrl" : "https://github.com/CommunityToolkit/WindowsCommunityToolkit/tree/main/Microsoft.Toolkit.Diagnostics", + "CodeUrl": "https://github.com/CommunityToolkit/WindowsCommunityToolkit/tree/main/Microsoft.Toolkit.Diagnostics", "Icon": "/Assets/Helpers.png", "DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/developer-tools/Guard.md" }, @@ -890,7 +900,7 @@ "Name": "High Performance APIs", "Subcategory": "Developer", "About": "The High Performance package contains a set of APIs that are heavily focused on optimization. All the new APIs have been carefully crafted to achieve the best possible performance when using them, either through reduced memory allocation, micro-optimizations at the assembly level, or by structuring the APIs in a way that facilitates writing performance oriented code in general.", - "CodeUrl" : "https://github.com/CommunityToolkit/WindowsCommunityToolkit/tree/main/Microsoft.Toolkit.HighPerformance", + "CodeUrl": "https://github.com/CommunityToolkit/WindowsCommunityToolkit/tree/main/Microsoft.Toolkit.HighPerformance", "Icon": "/Assets/Helpers.png", "DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/high-performance/Introduction.md" }, diff --git a/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs b/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs new file mode 100644 index 00000000000..367f1ba8cf8 --- /dev/null +++ b/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs @@ -0,0 +1,66 @@ +using System.Windows.Input; +using Microsoft.Xaml.Interactivity; +using Windows.System; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Input; + +namespace Microsoft.Toolkit.Uwp.UI.Behaviors +{ + /// + /// This behavior listens to a key down event on the associated when it is loaded and executes an action. + /// + [TypeConstraint(typeof(FrameworkElement))] + public class KeyDownTriggerBehavior : Trigger + { + + /// + /// The DP to store the property value. + /// + public static readonly DependencyProperty KeyProperty = DependencyProperty.Register( + "Key", + typeof(VirtualKey), + typeof(KeyDownTriggerBehavior), + new PropertyMetadata(null)); + + /// + /// Gets or sets the key to listen when the associated object is loaded. + /// + public VirtualKey Key + { + get => (VirtualKey)GetValue(KeyProperty); + set => SetValue(KeyProperty, value); + } + + public static readonly DependencyProperty CommandProperty = DependencyProperty.Register( + "Command", + typeof(ICommand), + typeof(KeyDownTriggerBehavior), + new PropertyMetadata(null)); + + /// + protected override void OnAttached() + { + ((FrameworkElement)AssociatedObject).KeyDown += OnAssociatedObjectKeyDown; + } + + /// + protected override void OnDetaching() + { + ((FrameworkElement)AssociatedObject).KeyDown -= OnAssociatedObjectKeyDown; + } + + /// + /// Invokes the current actions when the is pressed. + /// + /// The source instance. + /// The arguments for the event (unused). + private void OnAssociatedObjectKeyDown(object sender, KeyRoutedEventArgs keyRoutedEventArgs) + { + if (keyRoutedEventArgs.Key == Key) + { + keyRoutedEventArgs.Handled = true; + Interaction.ExecuteActions(sender, Actions, keyRoutedEventArgs); + } + } + } +} \ No newline at end of file From 7513e421f70fc9339ec6993b9931abb06dcc855e Mon Sep 17 00:00:00 2001 From: ArchieCoder Date: Thu, 5 Aug 2021 13:26:52 -0400 Subject: [PATCH 2/9] Update Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs Co-authored-by: Michael Hawker MSFT (XAML Llama) <24302614+michael-hawker@users.noreply.github.com> --- .../Keyboard/KeyDownTriggerBehavior.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs b/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs index 367f1ba8cf8..df3a910aa69 100644 --- a/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs +++ b/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs @@ -14,7 +14,7 @@ public class KeyDownTriggerBehavior : Trigger { /// - /// The DP to store the property value. + /// Identifies the property. /// public static readonly DependencyProperty KeyProperty = DependencyProperty.Register( "Key", @@ -63,4 +63,4 @@ private void OnAssociatedObjectKeyDown(object sender, KeyRoutedEventArgs keyRout } } } -} \ No newline at end of file +} From fc4e6d713fa2cb1679ce9389f323460d8b612d87 Mon Sep 17 00:00:00 2001 From: ArchieCoder Date: Thu, 5 Aug 2021 13:27:45 -0400 Subject: [PATCH 3/9] Update Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs Co-authored-by: Michael Hawker MSFT (XAML Llama) <24302614+michael-hawker@users.noreply.github.com> --- .../Keyboard/KeyDownTriggerBehavior.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs b/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs index df3a910aa69..18f302ac0d1 100644 --- a/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs +++ b/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs @@ -17,7 +17,7 @@ public class KeyDownTriggerBehavior : Trigger /// Identifies the property. /// public static readonly DependencyProperty KeyProperty = DependencyProperty.Register( - "Key", + nameof(Key), typeof(VirtualKey), typeof(KeyDownTriggerBehavior), new PropertyMetadata(null)); From 6c5f8a231cdf3f50665fbf36ad09a0383305cb71 Mon Sep 17 00:00:00 2001 From: ArchieCoder Date: Fri, 6 Aug 2021 00:21:43 -0400 Subject: [PATCH 4/9] Fixes post code review --- .../Microsoft.Toolkit.Uwp.SampleApp.csproj | 7 -- .../KeyDownTriggerBehaviorPage.xaml | 60 ------------- .../KeyDownTriggerBehaviorPage.xaml.cs | 16 ---- .../KeyDownTriggerBehaviorXaml.bind | 90 +++++++++++++++---- .../SamplePages/XamlOnlyPage.xaml | 1 + .../Keyboard/KeyDownTriggerBehavior.cs | 9 +- 6 files changed, 73 insertions(+), 110 deletions(-) delete mode 100644 Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorPage.xaml delete mode 100644 Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorPage.xaml.cs diff --git a/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj b/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj index ef365f43ba0..9dddf4fb6b0 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj +++ b/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj @@ -503,9 +503,6 @@ FocusBehaviorPage.xaml - - KeyDownTriggerBehaviorPage.xaml - MetadataControlPage.xaml @@ -978,10 +975,6 @@ Designer - - MSBuild:Compile - Designer - Designer MSBuild:Compile diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorPage.xaml b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorPage.xaml deleted file mode 100644 index d5b605fc0f4..00000000000 --- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorPage.xaml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorPage.xaml.cs b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorPage.xaml.cs deleted file mode 100644 index d777b3137cb..00000000000 --- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorPage.xaml.cs +++ /dev/null @@ -1,16 +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. - -using Windows.UI.Xaml.Controls; - -namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages -{ - /// - /// A page that shows how to use the AutoFocusBehavior - /// - public sealed partial class KeyDownTriggerBehaviorPage : Page - { - public KeyDownTriggerBehaviorPage() => InitializeComponent(); - } -} \ No newline at end of file diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorXaml.bind b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorXaml.bind index 0fc18f48c5e..b24f77335be 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorXaml.bind +++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorXaml.bind @@ -1,5 +1,6 @@ - +--> + + + + \ No newline at end of file diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/XamlOnlyPage.xaml b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/XamlOnlyPage.xaml index 631cf5e5c95..780f14479e8 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/XamlOnlyPage.xaml +++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/XamlOnlyPage.xaml @@ -32,6 +32,7 @@ + diff --git a/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs b/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs index 367f1ba8cf8..9eb1afc8766 100644 --- a/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs +++ b/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs @@ -1,4 +1,3 @@ -using System.Windows.Input; using Microsoft.Xaml.Interactivity; using Windows.System; using Windows.UI.Xaml; @@ -10,7 +9,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Behaviors /// This behavior listens to a key down event on the associated when it is loaded and executes an action. /// [TypeConstraint(typeof(FrameworkElement))] - public class KeyDownTriggerBehavior : Trigger + public class KeyDownTriggerBehavior : Trigger { /// @@ -31,12 +30,6 @@ public VirtualKey Key set => SetValue(KeyProperty, value); } - public static readonly DependencyProperty CommandProperty = DependencyProperty.Register( - "Command", - typeof(ICommand), - typeof(KeyDownTriggerBehavior), - new PropertyMetadata(null)); - /// protected override void OnAttached() { From b1905cec8fa44fcdfcb6cba811949066d3cec885 Mon Sep 17 00:00:00 2001 From: ArchieCoder Date: Fri, 6 Aug 2021 09:02:17 -0400 Subject: [PATCH 5/9] Update Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json Co-authored-by: Michael Hawker MSFT (XAML Llama) <24302614+michael-hawker@users.noreply.github.com> --- Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json index 1a4ccac2cd9..23dce0a4336 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json +++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json @@ -841,11 +841,10 @@ }, { "Name": "KeyDownTriggerBehavior", - "Type": "KeyDownTriggerBehaviorPage", "Subcategory": "Systems", "About": "Behavior to listen to a key press on a control and executes actions", "CodeUrl": "https://github.com/CommunityToolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs", - "XamlCodeFile": "KeyDownTriggerBehaviorXaml.bind", + "XamlCodeFile": "/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorXaml.bind", "Icon": "/Assets/Helpers.png", "DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/behaviors/KeyboardBehaviors.md" }, From 3f0df53a80871c1901b5cd8edcd5fcaf0fc760ce Mon Sep 17 00:00:00 2001 From: ArchieCoder Date: Fri, 6 Aug 2021 09:05:54 -0400 Subject: [PATCH 6/9] Fix --- .../KeyDownTriggerBehaviorXaml.bind | 55 +------------------ 1 file changed, 2 insertions(+), 53 deletions(-) diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorXaml.bind b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorXaml.bind index b24f77335be..25535c04303 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorXaml.bind +++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorXaml.bind @@ -1,4 +1,4 @@ - - - - - \ No newline at end of file From e2e5a658d5b0732276b1ad449a3f867687134f9b Mon Sep 17 00:00:00 2001 From: ArchieCoder Date: Fri, 6 Aug 2021 16:54:00 -0400 Subject: [PATCH 7/9] Added license --- .../Keyboard/KeyDownTriggerBehavior.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs b/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs index 64e0832def9..0480e7895e2 100644 --- a/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs +++ b/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs @@ -1,3 +1,7 @@ +// 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. + using Microsoft.Xaml.Interactivity; using Windows.System; using Windows.UI.Xaml; From 8b3be50b339d2a157a95287be3d2a1b4820b8a42 Mon Sep 17 00:00:00 2001 From: ArchieCoder Date: Tue, 10 Aug 2021 16:29:37 -0400 Subject: [PATCH 8/9] Fix StyleCop --- .../Keyboard/KeyDownTriggerBehavior.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs b/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs index 0480e7895e2..e0266db4556 100644 --- a/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs +++ b/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs @@ -15,7 +15,6 @@ namespace Microsoft.Toolkit.Uwp.UI.Behaviors [TypeConstraint(typeof(FrameworkElement))] public class KeyDownTriggerBehavior : Trigger { - /// /// Identifies the property. /// From eab041e042d26497d774b01e8ab973b0fd9e7300 Mon Sep 17 00:00:00 2001 From: Darren Batchelor Date: Fri, 13 Aug 2021 13:51:47 -0700 Subject: [PATCH 9/9] Updated doc URL to more relevant filename --- Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json index 23dce0a4336..2447ae36db2 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json +++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json @@ -846,7 +846,7 @@ "CodeUrl": "https://github.com/CommunityToolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs", "XamlCodeFile": "/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorXaml.bind", "Icon": "/Assets/Helpers.png", - "DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/behaviors/KeyboardBehaviors.md" + "DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/behaviors/KeyDownTriggerBehavior.md" }, { "Name": "Win2d Path Mini Language Parser",