Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add Property panel for ViewportBehavior #4320

Merged
merged 5 commits into from
Oct 15, 2021

Conversation

XAML-Knight
Copy link
Contributor

@XAML-Knight XAML-Knight commented Oct 14, 2021

Fixes #4193

PR Type

Bugfix

What is the current behavior?

No Properties panel appears when viewing the ViewportBehavior Sample Page, as well as the fact that the event logging (within the page) was not occurring as often as it should have been, if the IsAlwaysOn bool property was set to true.

What is the new behavior?

A Properties panel now appears for the ViewportBehavior Sample Page, with a toggle switch for IsAlwaysOn, and event logging occurs more frequently, as expected.

image

PR Checklist

Please check if your PR fulfills the following requirements:

  • 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

Attempted to properly address the following code, but ran into issues with the logging completely shutting down, regardless of setting the IsAlwaysOn property as true or not:
Interaction.GetBehaviors(obj.AssociatedObject).Remove(obj);

Even when trying to complete the pattern of adding or removing from the underlying BehaviorCollection, the associated event becomes unsubscribed, and then no more logging occurs, regardless.

@ghost
Copy link

ghost commented Oct 14, 2021

Thanks XAML-Knight 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 14, 2021 17:04
@ghost ghost added bug 🐛 An unexpected issue that highlights incorrect behavior sample bug 🐛 labels Oct 14, 2021
@@ -14,7 +14,7 @@
Height="200"
Background="Gray">
<interactivity:Interaction.Behaviors>
<behaviors:ViewportBehavior x:Name="ViewportBehavior" />
<behaviors:ViewportBehavior x:Name="ViewportBehavior" IsAlwaysOn="@[IsAlwaysOn:Bool:True]" />
Copy link
Member

Choose a reason for hiding this comment

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

Maybe rather than a toggle we just want this to be on by default (for the sample)?

@michael-hawker michael-hawker added this to the 7.1.1 milestone Oct 14, 2021
@XAML-Knight
Copy link
Contributor Author

Addressed requested changes during PR, which leads to Properties panel no longer being shown

@michael-hawker michael-hawker merged commit 3381011 into CommunityToolkit:main Oct 15, 2021
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 sample bug 🐛
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ViewportBehavior logging events only fire once
2 participants