NavigationBar XamlDefaultNavigationBar Style does not show a NavigationBar? #19019
-
Beta Was this translation helpful? Give feedback.
Answered by
morning4coffe-dev
Dec 7, 2024
Replies: 1 comment 6 replies
-
Hey @DevTKSS. Thank you! I’ve been taking a closer look and noticed slightly different behavior on my side. When I add <Page x:Class="UnoApp1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UnoApp1"
xmlns:utu="using:Uno.Toolkit.UI"
xmlns:um="using:Uno.Material"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:not_win="http://uno.ui/not_win"
mc:Ignorable="d not_win"
Background="{ThemeResource BackgroundBrush}">
<Page.Resources>
<not_win:Style TargetType="utu:NavigationBar"
BasedOn="{StaticResource XamlDefaultNavigationBar}" />
</Page.Resources>
<Grid utu:SafeArea.Insets="VisibleBounds">
<utu:NavigationBar Content="Test"
HorizontalAlignment="Stretch">
<utu:NavigationBar.PrimaryCommands>
<AppBarButton Icon="Home"
Label="Home" />
</utu:NavigationBar.PrimaryCommands>
</utu:NavigationBar>
<StackPanel HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock AutomationProperties.AutomationId="HelloTextBlock"
Text="Hello Uno Platform!"
HorizontalAlignment="Center" />
</StackPanel>
</Grid>
</Page>
|
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
morning4coffe-dev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @DevTKSS.
Thank you! I’ve been taking a closer look and noticed slightly different behavior on my side. When I add
XamlDefaultNavigationBar
on WinUI, it throws the following error:But works as expected on other platforms (desktop and mobile targets). I will open an issue in Toolkit repo to discuss more details, in the meantime this sample should display the NavigationBar: