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

Deactivate widgets when Dashboard isn't displayed #2240

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

krschau
Copy link
Collaborator

@krschau krschau commented Feb 9, 2024

Summary of the pull request

After the user leaves the dashboard, the widgets are still there. By unsubscribing from the WidgetUpdated event, the widget manager "deactivates" the widget by telling it not to update until it is activated again. In our case, when we next navigate to the Dashboard we re-activate them when rebuilding the PinnedWidgets list.

References and relevant issues

#716

Detailed description of the pull request / Additional comments

OnNavigatingFrom is used rather than OnNavigatedFrom: "In addition to being invoked when navigating between pages, the OnNavigatedFrom method is invoked when Frame.GetNavigationState is called. To avoid any issues, you should use OnNavigatingFrom or the Unloaded event, which are only called on actual navigation, to unregister event handlers and do other cleanup."

Validation steps performed

PR checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated

@AmelBawa-msft AmelBawa-msft added the Needs-Second Pull request that needs another approval label Feb 9, 2024
@krschau krschau merged commit 3e22d5a into main Feb 9, 2024
4 checks passed
@krschau krschau removed the Needs-Second Pull request that needs another approval label Feb 9, 2024
@krschau krschau deleted the user/krschau/deactivate-widgets branch February 9, 2024 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants