Skip to content

Conversation

@michael-hawker
Copy link
Member

Fixes #4784

See issue for details, minor clean-ups/optimizations. And see MicrosoftDocs/WindowsCommunityToolkitDocs#262 (comment) for WeakEventListener pattern.

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

  • Keyboard handlers registered each time the control is loaded
  • Lambda handlers for Keyboard registration not static
  • Didn't unregister events in RadialGauge before registering
  • WeakEventListener pattern's not followed

What is the new behavior?

  • Keyboard handlers only registered once for the control
  • Keyboard handler Lambda's static
  • Events unregistered before registered
  • use new C# static lambda to help properly implement WeakEventListener patterns

PR Checklist

Please check if your PR fulfills the following requirements:

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • Tested code with current supported SDKs
  • New component
    • Pull Request has been submitted to the documentation repository instructions. Link:
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
    • If control, added to Visual Studio Design project
  • Sample in sample app has been added / updated (for bug fixes / features)
  • New major technical changes in the toolkit have or will be added to the Wiki e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes

Other information

@michael-hawker michael-hawker added the optimization ☄ Performance or memory usage improvements label Oct 18, 2022
@michael-hawker michael-hawker added this to the 7.1.3 milestone Oct 18, 2022
@ghost
Copy link

ghost commented Oct 18, 2022

Thanks michael-hawker 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 🙌

@ghost ghost requested a review from azchohfi October 18, 2022 08:09
@ghost ghost added bug 🐛 An unexpected issue that highlights incorrect behavior controls 🎛️ labels Oct 18, 2022
Copy link

@niels9001 niels9001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@michael-hawker michael-hawker merged commit acf30d6 into CommunityToolkit:main Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐛 An unexpected issue that highlights incorrect behavior controls 🎛️ optimization ☄ Performance or memory usage improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix/Optimization of RadialGauge event handlers

2 participants