Skip to content

Implementation of InfoBadge component#869

Merged
pomianowski merged 6 commits intolepoco:developmentfrom
jbryknar:#798_Add_InfoBadge_for_NavigationViewItems
Dec 12, 2023
Merged

Implementation of InfoBadge component#869
pomianowski merged 6 commits intolepoco:developmentfrom
jbryknar:#798_Add_InfoBadge_for_NavigationViewItems

Conversation

@jbryknar
Copy link
Copy Markdown
Collaborator

@jbryknar jbryknar commented Dec 10, 2023

Pull request type

Please check the type of change your PR introduces:

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

Issue Number: #798

The current version of WpfUi does not have an InfoBadge implementation.

What is the new behavior?

Added implementation of InfoBadge component according to Win UI 3.

https://learn.microsoft.com/en-us/windows/apps/design/controls/info-badge

The component can be used as a standalone component:

<ui:InfoBadge Value="1" Severity="Attention" Opacity="1" Style="{DynamicResource ValueInfoBadgeStyle}>`

Supported PaneDisplayMode:

  • Left (open and unopened panel, missing support for subitems in MenuItems yet)
  • LeftMinimal (open and unopened panel)
  • Fluent
  • Top
  • Bottom
  • The component is implented into NavigationView, so it can be used in NavigationViewItem:
<ui:NavigationViewItem Content="Items" Icon="{ui:SymbolIcon Library24}">
     <ui:NavigationViewItem.InfoBadge>
         <ui:InfoBadge Severity="Attention" Value="{Binding ViewModel.Value, Mode=OneWay}" Style="{DynamicResource ValueInfoBadgeStyle}" />
     </ui:NavigationViewItem.InfoBadge>
</ui:NavigationViewItem>

Added InfoBadge page to Status & info section for component demonstration

Snímek obrazovky 2023-12-09 203316

Other information

Basic parameters

  • Value (Gets or sets the string to be displayed in an InfoBadge)
  • Icon (Gets or sets the icon to be used in an InfoBadge). Primarily set for use with ui:SymbolIcon.
  • Severity (Gets or sets the severity to be used in an InfoBadge)
  • Opacity
  • Style (Gets or sets the style of component, options are available as listed below)

Severity

Severity Name Brush Name Light Dark
Attention SystemFillColorAttention #0078d4 #4cc2ff
Informational SystemFillColorInformational #8a8a8a #9d9d9d
Success SystemFillColorSuccess #0f7b0f #6ccb5f
Caution SystemFillColorCaution #9d5d00 #fce100
Critical SystemFillColorCritical #c42b1c #ff99a4

Styles

  • IconInfoBadgeStyle (Icon is required parameter)
  • ValueInfoBadgeStyle (Value is required parameter)
  • DotInfoBadgeStyle

Preview

Animace

The component can definitely be implemented better and more happily, so I'll be glad for the review and any comments. The goal was to help the author of the project and to contribute a bit to the development of the component.

@jbryknar jbryknar changed the title #798 add info badge for navigation view items Implementation of InfoBadge component Dec 10, 2023
Comment thread src/Wpf.Ui/Resources/Theme/HC1.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HC2.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HCBlack.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HCWhite.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HCWhite.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HCWhite.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HCWhite.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HCWhite.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HCWhite.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HCBlack.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HCBlack.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HCBlack.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HCBlack.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HCBlack.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HC2.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HC2.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HC2.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HC2.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HC2.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HC1.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HC1.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HC1.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HC1.xaml Outdated
Comment thread src/Wpf.Ui/Resources/Theme/HC1.xaml Outdated
@jbryknar jbryknar requested a review from niels9001 December 11, 2023 12:28
@jbryknar
Copy link
Copy Markdown
Collaborator Author

jbryknar commented Dec 11, 2023

@niels9001 Thanks for the code review, theme files are not my cup of tea. 😁

@jbryknar jbryknar changed the base branch from main to development December 11, 2023 12:45
@pomianowski pomianowski self-assigned this Dec 12, 2023
@pomianowski
Copy link
Copy Markdown
Member

Hey @jbryknar, thanks for your work and contribution to the project, the InfoBadge looks great

@pomianowski pomianowski merged commit 5b3b40e into lepoco:development Dec 12, 2023
@jbryknar jbryknar deleted the #798_Add_InfoBadge_for_NavigationViewItems branch December 19, 2023 17:08
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants