Open UnreachableCode opened 1 week ago
I believe the desired behavior is to allow you to control it on a per page basis but you would need to clear it when navigating away from the page yourself. Or set it on the next page.
That being said I understand your expectation. The difficult thing would be to change this if we decided it was a bug as it could break developers. If we wanted to introduce a fix we could add a property to determine whether this is unset on navigating away.
It could work like that where I change it on entry and exit, but it's a lot of overhead. And that's on the presumption that the default light grey is fine for every other screen (that doesn't have the same entry/exit behavior).
I hear what you're saying about breaking changes. I'm not sure how people are currently using this and what their expectation is. But I would have thought that the point is that it can set in one ContentPage at a time, especially given you can do it in xaml.
Is there a way to access the default navbar color for when I revert it?
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
Setting the NavigationBar.Color in xaml or code sets it app wide. This is easy to do using Android styles.xml and colors.xml anyway.
Expected Behavior
I would expect the color to only be changed for the specifc ContentPage I was on, so that in my own applications I can set specific colours for specific screens for a specific look and feel.
Steps To Reproduce
Run the sample app on Android and navigate to Platform Specific -> NavigationBar.
Use the slider to set the NavigationBar color like so:
And then navigate away from this screen:
Link to public reproduction project repository
https://github.com/CommunityToolkit/Maui/tree/main/samples/CommunityToolkit.Maui.Sample/Pages/PlatformSpecific
Environment
Anything else?
Thanks!