-
Notifications
You must be signed in to change notification settings - Fork 703
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
Unable to change background color of NavigationView when PaneDisplayMode is set to top #3299
Comments
sounds like we may have missed a template binding. |
I would like to look into this issue. |
For DisplayMode top, NavigationView uses the "NavigationViewTopPaneBackground" resource to allow lightweight styling of the background of the background. I am not sure if changing the theme resource binding here is a good idea as this might break existing apps. |
@chingucoding using |
The big question is how you would achieve this. We can certainly not introduce an API to switch between the resources for the background DisplayMode.Top. You can't bind the background of a control to both resources. We could make the NavigationViewTopPaneBackground reference the NavigationViewDefaultPaneBackground resource, not sure how good of a solution that is though. |
Note that resource referencing is not working as expected right now: #2913 |
Oh right, guess that option is off the table then. Thanks for linking that issue @Felix-Dev ! |
Yes, was about to link the same issue, when #2913 is resolved this should be easy. In the mean time we don't really have a good way of doing the fallback color proposed. |
Is this a "needs-winui-3" issue then @StephenLPeters ? |
Is there a reason why there isn't a TopPaneBackground property or something? I'm making a templated control that uses a NavigationView internally and I need to use a TemplateBinding on the background |
This is because that would be a property which would only be relevant in some scenarios but not in all scenarios. Such kind of API is not ideal and the API surface of NavigationView is already fairly complex, having a property for the TopPaneBackground does not make this easier. Also when this kind of property would be introduced, we would also need to introduce a new property for the left panebackground for completeness sake. That's one of the reasons why this is done through lightweight styling. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Describe the bug
Overriding the default background color of the pane using
NavigationViewExpandedPaneBackground
andNavigationViewDefaultPaneBackground
doesn't work ifPaneDisplayMode
is set toTop
. Everything works fine ifPaneDisplayMode
is set toLeft
.Steps to reproduce the bug
Inside an empty page:
Expected behavior
Background color should change
Screenshots
Version Info
NuGet package version:
[Microsoft.UI.Xaml 2.4.3]
Additional context
The text was updated successfully, but these errors were encountered: