wpfui icon indicating copy to clipboard operation
wpfui copied to clipboard

Add InfoBadge for NavigationViewItems

Open Porterbg opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe

Could you implement InfoBadge in buttons for NavigationViewItems? You can find it in the WinUI 3 sample app.

Describe the solution you'd like

Example usage

<NavigationViewItem x:Name="InboxPage" Content="Inbox" Icon="Mail">
    <NavigationViewItem.InfoBadge>
        <InfoBadge x:Name="infoBadge1" Value="5" Opacity="{x:Bind InfoBadgeOpacity, Mode=OneWay}"/>
    </NavigationViewItem.InfoBadge>
</NavigationViewItem>

Describe alternatives you've considered

No response

Additional context

No response

Porterbg avatar Oct 24 '23 10:10 Porterbg

That sounds good, and I don't know how the author of the project is doing with the implementation, but I decided to implement this feature myself to contribute to the development. In the code there is only preparation in the form of pre-created files for the component. When I'm done, I'll make a Pull Request. I am now implementing IconBadge in NavigationView so that it works for all Menu types (compact, minimal, fluent, expanded ...).

Note: I implemented it according to https://learn.microsoft.com/en-us/windows/apps/design/controls/info-badge, where I kept the WinUI colors, brushes and styles.

Snímek obrazovky 2023-12-09 203316

jbryknar avatar Dec 09 '23 19:12 jbryknar

Implementation complete, just checking all styles and details to match 1:1 with WinUI. Animace

jbryknar avatar Dec 09 '23 20:12 jbryknar

Already merged into the develpment branch in PR: #869.

jbryknar avatar Dec 12 '23 15:12 jbryknar