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

Fix so updating FlyoutItemIsVisible hides/shows shell menu item #16942

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

BretJohnson
Copy link
Member

@BretJohnson BretJohnson commented Aug 22, 2023

MenuShellItem wraps a MenuItem. Shell related properties should be synchronized between the two objects, always the same values. Add code so that FlyoutItemIsVisible is also synchronized. Most properties are synchroned via bindings, but FlyoutItemIsVisible is an attached property so we need to have code that runs on property changes instead.

Fixes issue #10468

Note that normally the MenuItem is specified in XAML while MenuShellItem is accessed in code behind, thus the need to synchronize when FlyoutItemIsVisible is initialized in XAML then updated later via code behind, like in the bug.

MenuShellItem wraps a MenuItem. Shell related properties should be
synchronized between the two objects, always the same values.
Add code so that FlyoutItemIsVisible is also synchronized. Most properties are
synchroned via bindings, but FlyoutItemIsVisible is an attached property so
we need to have code that runs on property changes instead.

Fixes issue #16929

Note that normally the MenuItem is specified in XAML while MenuShellItem is accessed
in code behind, thus the need to synchronize when FlyoutItemIsVisible is initialized in XAML
then updated later via code behind, like in the bug.
@BretJohnson BretJohnson requested a review from a team as a code owner August 22, 2023 23:00
@BretJohnson BretJohnson linked an issue Aug 23, 2023 that may be closed by this pull request
@Eilon Eilon added the area-controls-shell Shell Navigation, Routes, Tabs, Flyout label Aug 24, 2023
@BretJohnson BretJohnson added this to the .NET 8 GA milestone Aug 24, 2023
@PureWeen PureWeen merged commit 108d1bc into main Aug 24, 2023
34 checks passed
@PureWeen PureWeen deleted the fix-shell-item-visibility branch August 24, 2023 21:31
@github-actions github-actions bot locked and limited conversation to collaborators Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flyout is not refreshing when item visibility is changed
3 participants