XAML InfoBadge

Hey all,

Im trying to get an infobadge on my NavigationView using the below xaml,

<NavigationView
    IsTabStop="False"
    IsBackButtonVisible="Collapsed"
    IsPaneToggleButtonVisible="False"
    IsSettingsVisible="True"
    PaneDisplayMode="Left">

    <NavigationView.MenuItems>
        <NavigationViewItem Icon="Home" Content="Home" />
        <NavigationViewItemHeader Content="Browse Categories" />
        <NavigationViewItem Icon="Favorite" Content="Favourite" />
        <NavigationViewItem Icon="Cut" Content="Aid">

    <NavigationViewItem.InfoBadge>
        <InfoBadge x:Name="infoBadge1" Value="196"/>
    </NavigationViewItem.InfoBadge>
</NavigationViewItem>

<NavigationViewItemHeader Content="Search" />

   <NavigationViewItem Icon="Find" Content="Search" />
   <NavigationViewItem Icon="Refresh" Content="Clear" />
    </NavigationView.MenuItems>

    <Frame x:Name="contentFrame9" />

</NavigationView>

This code works perfectly outside xojo alltogether but when running in an xaml container i get the following error.

Screenshot 2024-07-06 113434

am i missing something or is this not possible to achieve?

Many thanks for any guidence

Robin

Hi Robin, it seems, InfoBadge elements are not supported yet. Others don‘t work, too, for example SelectorBar. I‘m surprised, may @William_Yu can shed some light into this.

1 Like

Thank you for the reply Thomas, I put in a feature request and hopefully something comes of it.

I love using XAML with xojo, but its starting to hurt my head with all the walls im running into with the unsupported XAML code :sob:

They should work, but some of these will require a winui: prefix so that we know to use the newer implementation. XAML InfoBadge (#76857) · Issues · Xojo Inc / Xojo · GitLab

3 Likes

Ah! Thank you William.