dotnet / MobileBlazorBindings

Experimental Mobile Blazor Bindings - Build native and hybrid mobile apps with Blazor
MIT License
1.2k stars 151 forks source link

Unable to customize TitleView of NavBar (add few elements) in Razor component - Shell / ContentPage #410

Open johnmangam opened 3 years ago

johnmangam commented 3 years ago

I would like to add a few more elements to the TitleView of NavBar.

I'm able to see this NavigationPage.TitleView in XAML https://github.com/xamarin/xamarin-forms-samples/blob/main/Navigation/TitleView/NavigationPageTitleView/NavigationPageTitleView/Views/AndroidExtendedTitleViewPage.xaml

I am not able to do the same in razor of Shell or a ContentPage. Please help, thank you.

Dreamescaper commented 3 years ago

Unfortunately, this property is not yet mapped in MBB.

johnmangam commented 3 years ago

Thank you @Dreamescaper I see that there is Shell.TitleView. Could we use it in a Razor component?

Dreamescaper commented 3 years ago

That one is not mapped either. If you really need to, you can access native Xamarin.Forms elements, and assign that property directly, but you'll need to build that TitleView using native XF elements, you won't be able to use razor there.

You can read about that here: https://docs.microsoft.com/en-us/mobile-blazor-bindings/advanced/access-native-controls#accessing-native-xamarinforms-controls-from-blazor-components

johnmangam commented 3 years ago

Thank you for the information, @Dreamescaper

Dreamescaper commented 3 years ago

I think you can leave it opened - as a request to map those properties in MBB.