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

Changing value of Shell.NavBarIsVisible should change visibility of toolbar (ShellToolbar) #17358

Merged
merged 2 commits into from
Sep 20, 2023

Conversation

spadapet
Copy link
Contributor

Description of Change

This change updates the visibility of the ShellToolbar as the value of Shell.NavBarIsVisible changes (either through XAML Hot Reload or through code).

For apps that use Shell: The Shell.NavBarIsVisible attached property can be set on any element from the root Shell down to the current Page. The value of Shell.NavBarIsVisible needs to act like its inherited down to the Page.

The old code would copy the value of Shell.NavBarIsVisible down through the element tree. Once it's copied, that's it, it won't be updated by inheritance again. I'm removing that inheritance copy, and instead have the ShellToolbar look for the value of Shell.NavBarIsVisible at the current Page, and go up through parents to the Shell.

ShellToolbar already listened for the PropertyChanged event on the Shell, so that event is being used to notify when any element has a change for Shell.NavBarIsVisible.

Issues Fixed

Fixes #7459 (Shell.NavBarIsVisible does not update on hot reload)

@spadapet spadapet added the partner/hot-reload-xaml Issues impacting XAML Hot Reload experiences label Sep 13, 2023
@spadapet spadapet self-assigned this Sep 13, 2023
@spadapet spadapet requested a review from a team as a code owner September 13, 2023 20:40
@samhouts samhouts added this to the Under Consideration milestone Sep 13, 2023
@spadapet spadapet enabled auto-merge (squash) September 13, 2023 22:12
@Eilon Eilon added the area-controls-shell Shell Navigation, Routes, Tabs, Flyout label Sep 14, 2023
@spadapet
Copy link
Contributor Author

Ping @PureWeen for review

@spadapet spadapet merged commit d54b778 into main Sep 20, 2023
39 checks passed
@spadapet spadapet deleted the dev/peterspa/NavBarIsVisibleChanges branch September 20, 2023 21:49
@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 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 partner/hot-reload-xaml Issues impacting XAML Hot Reload experiences
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shell.NavBarIsVisible does not update on hot reload on Android 8
4 participants