PrismNavigationPage doesn't allow you to change navbar title color
sact1909 opened this issue · comments
Description
in your documentation you said, PrismNavigationPage will be registered as the default navigation page in case we don't have a custom navigation page, but also you mention this
My current version (but it happen with any version not matter what)
.NET MAUI 8
Prism.DryIoC.Maui = 9.0.401-pre
that's why I would like to keep the PrismNavigationPage as default, but this doesn't allow you to change the navbar title color, no matter what you do, it will be black
this is how my PrismStartup,cs looks
this is how my Resources/Styles/Styles.xml looks (I'm forcing the bartextcolor to be red in any scenario)
Please download the Sample Project (is the same that I use for the images)
PrismNavigationPageBug.zip
Steps to Reproduce
- Create a New Project using the Prism Template Projects
- Go to Resources/Styles/Styles.xml
- Search for the style section with TargetType=NavigationPage
- Set the BarTextColor property to whatever color, in my case I use Red
- Run the Project (and the bartextcolor in the navbar will be still in color black)
Platform with bug
.NET MAUI
Affected platforms
Android
Did you find any workaround?
Obvious If register the NavigationPage in the PrismStartup.cs it will work,
but it is supposed to be there when you don't have any other custom NavigationPage, that what you say
Relevant log output
No response
Add Style.ApplyToDerivedTypes to your NavigationPage
style or just target the PrismNavigationPage
directly. I think that will solve your issue.
Also this is not specific to Prism. Any derived types will not have the styles applied without Style.ApplyToDerivedTypes.
Add Style.ApplyToDerivedTypes to your
NavigationPage
style or just target thePrismNavigationPage
directly. I think that will solve your issue.Also this is not specific to Prism. Any derived types will not have the styles applied without Style.ApplyToDerivedTypes.
@AmrAlSayed0
I never thought it was a prism problem, but is something that happens with a prism class, I think that there could exist a Prism solution for this, setting that property as default anywhere
but glad to see that property, never seen it before, really appreciate that info, it helped me a lot
note:
I tried to target the PrismNavigationPage directly but that doesn't work, maybe this could be another workaround for Prism if the allow to target the PrismNavigationPage
Thanks for the help