I am stuck on a small detail of XAML... Please help if you know the answer.
Environment: dotnet 7
Platform: X Platform Maui
I am trying to create a C# collection equivalent of the Xaml in my App for the Collection of Tabs. The Problem is the one c# equivalent line of the Xaml NavigationPage.HasNavigationBar="True"
FlyoutItems in AppShell.Xaml
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems" >
<Tab Title="Home" Icon="home.png" >
<ShellContent Title="Disclaimer"
ContentTemplate="{DataTemplate views:DisclaimerPage}"
NavigationPage.HasNavigationBar="True"
Route="MainPage" />
</Tab>
<Tab Title="Downloads" Icon="downloads.png">
<ShellContent Title="Downloads"
ContentTemplate="{DataTemplate views:DisclaimerPage}"
NavigationPage.HasNavigationBar="False"
Route="MainPage" />
</Tab>
<Tab Title="Search" Icon="search.png">
<ShellContent Title="Disclaimer"
ContentTemplate="{DataTemplate views:DisclaimerPage}"
NavigationPage.HasNavigationBar="False"
Route="MainPage" />
</Tab>
<Tab Title="About" Icon="info_circle.png">
<ShellContent Title="About"
ContentTemplate="{DataTemplate views:AboutPage}"
NavigationPage.HasNavigationBar="False"
Route="AboutView"/>
</Tab>
</FlyoutItem>
The Problem is compiling the NavigationPage.HasNavigationPage lines below!
Hello All: Environment: dotnet 7 Platform: X Platform Maui I am trying to create a C# collection equivalent of the Xaml in my App for the Collection of Tabs.
FlyoutItems in AppShell.Xaml
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems" >
<Tab Title="Home" Icon="home.png" >
<ShellContent Title="Disclaimer"
ContentTemplate="{DataTemplate views:DisclaimerPage}"
NavigationPage.HasNavigationBar="True"
Route="MainPage" />
</Tab>
<Tab Title="Downloads" Icon="downloads.png">
<ShellContent Title="Downloads"
ContentTemplate="{DataTemplate views:DisclaimerPage}"
Route="MainPage" />
</Tab>
<Tab Title="Search" Icon="search.png">
<ShellContent Title="Disclaimer"
ContentTemplate="{DataTemplate views:DisclaimerPage}"
Route="MainPage" />
</Tab>
<Tab Title="About" Icon="info_circle.png">
<ShellContent Title="About"
ContentTemplate="{DataTemplate views:AboutPage}"
Route="AboutView"/>
</Tab>
</FlyoutItem>
The Problem is compiling the NavigationPage.HasNavigationPage lines below!
_tabs = new ObservableCollection<Tab>()
{
new Tab
{
Title = "Home",
Icon = "home.png",
Items =
{
new ShellContent
{
ContentTemplate = new DataTemplate(typeof(DisclaimerPage)),
Route = nameof(DisclaimerPage),
NavigationPage.HasNavigationBar="False"
}
}
},
new Tab
{
Title = "Search",
Icon = "search.png",
Items =
{
new ShellContent
{
ContentTemplate = new DataTemplate(typeof(DisclaimerPage)),
Route = nameof(DisclaimerPage)
}
}
},
new Tab
{
Title = "About",
Icon = "info_circle.png",
Items =
{
new ShellContent
{
ContentTemplate = new DataTemplate(typeof(AboutPage)),
Route = nameof(AboutPage)
}
}
}
};
This is a XAML attached property