-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New behavior KeyDownTriggerBehavior #4160
New behavior KeyDownTriggerBehavior #4160
Conversation
Thanks ArchieCoder for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
|
....Toolkit.Uwp.SampleApp/SamplePages/KeyDownTriggerBehavior/KeyDownTriggerBehaviorPage.xaml.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI.Behaviors/Keyboard/KeyDownTriggerBehavior.cs
Outdated
Show resolved
Hide resolved
…vior.cs Co-authored-by: Michael Hawker MSFT (XAML Llama) <[email protected]>
…vior.cs Co-authored-by: Michael Hawker MSFT (XAML Llama) <[email protected]>
@ArchieCoder did you forget to push? Looks like you replied to some comments, but I don't see the changes up here in the PR. |
…rchieCoder/WindowsCommunityToolkit into feature/KeyDownTriggerBehavior
Co-authored-by: Michael Hawker MSFT (XAML Llama) <[email protected]>
@michael-hawker One last thing, is the doc generated after the PR is merged? |
@ArchieCoder you need to manually submit a doc PR, though I don't think we have a base Behavior page in the docs, as we'd probably just want to point folks to general overview since they're pretty simple (vs. having a dedicated page for each one). @XAML-Knight this could be a good thing we could have you do to get familiar with the docs and the other behaviors. The API doc is auto-generated when we do the release as long as all the XML comments are there, which we enforce with Style-cop. Looks like the build is failing as the header is still missing on the new file. You can also run UpdateHeaders.bat or '.\build.ps1 -Target UpdateHeaders' to add it. |
@michael-hawker I ran the tool and submitted the header. I was just wondering about the doc because for example the other behavior has this file and it is nowhere in the solution. This is why I supposed it is generated with another system. "DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/behaviors/FocusBehaviors.md |
Hi @ArchieCoder , I've started a dev branch for this behavior's documentation; feel free to fork & embellish: https://github.com/XAML-Knight/WindowsCommunityToolkitDocs/tree/dev/KeyDownTriggerBehavior |
@michael-hawker Hi, is there any other steps that I need to do? |
@ArchieCoder the CI is still failing on a StyleCop issue:
Other than that though, I think it's all set to be tested and reviewed, so we'd just need to get sign-off from a couple of folks. I'll take another pass now, but I know it's been looking pretty good. Appreciate all your work on this! 🦙❤ |
Ok, I didn't notice the StyleCop. Fixed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code-side looks good to me. @XAML-Knight or @RosarioPulella feel like taking it for a spin? 🙂
@@ -1475,6 +1476,7 @@ | |||
<Name>Visual C++ 2015 Runtime for Universal Windows Platform Apps</Name> | |||
</SDKReference> | |||
</ItemGroup> | |||
<ItemGroup /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<ItemGroup /> |
We can remove this to minimize noise.
"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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure this DocumentationUrl property points to the correct markdown file, for the corresponding file in the
WindowsCommunityToolkitDocs repo. A markdown file doesn't exist in the Docs repo for this Keyboard behavior yet, of course, so we'll need to add it, as an additional PR to the Docs repo.
- @ArchieCoder are you planning on submitting a corresponding PR to the WindowsCommunityToolkitDocs repo, for the markdown file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@XAML-Knight can I just remove the DocumentationUrl? This behavior is so simple that the existing comments in the code is self-explanatory.
So far, it took me like 20 mins to do the behavior, but all the rest is many hours!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"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/KeyDownTriggerBehavior.md" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DocumentationUrl modified, to fit more descriptive markdown file name
Thanks @ArchieCoder for this contribution to the Toolkit! 🎉🎉🎉 |
Thanks you for your help @michael-hawker ! |
Fixes #4152
Discussion: #4152
Add a new behavior that listens to a key press event on the associated UIElement and triggers the set of actions.
PR Type
What kind of change does this PR introduce?
New behavior
What is the current behavior?
What is the new behavior?
New behavior is added.
PR Checklist
Please check if your PR fulfills the following requirements:
Other information