Skip to content

Commit

Permalink
Update infobadge samples to be more accessible (microsoft#1311)
Browse files Browse the repository at this point in the history
<!--- Provide a general summary of your changes in the Title above -->

## Description
<!--- Describe your changes in detail -->

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
Fixes microsoft#769
## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Screenshots (if appropriate):

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
  • Loading branch information
marcelwgn committed Oct 16, 2023
1 parent a735e50 commit 85d3945
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions WinUIGallery/ControlPages/InfoBadgePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<NavigationView.MenuItems>
<NavigationViewItem Content="Home" Icon="Home"/>
<NavigationViewItem Content="Account" Icon="Contact"/>
<NavigationViewItem x:Name="InboxPage" Content="Inbox" Icon="Mail">
<NavigationViewItem x:Name="InboxPage" Content="Inbox" Icon="Mail" AutomationProperties.Name="Inbox, 5 notifications">
<NavigationViewItem.InfoBadge>
<InfoBadge x:Name="infoBadge1" Value="5" Opacity="{x:Bind InfoBadgeOpacity, Mode=OneWay}"/>
</NavigationViewItem.InfoBadge>
Expand All @@ -55,7 +55,7 @@

<local:ControlExample.Xaml>
<x:String xml:space="preserve">
&lt;NavigationViewItem x:Name="InboxPage" Content="Inbox" Icon="Mail"&gt;
&lt;NavigationViewItem x:Name="InboxPage" Content="Inbox" Icon="Mail" AutomationProperties.Name="Inbox, 5 notifications"&gt;
&lt;NavigationViewItem.InfoBadge&gt;
&lt;InfoBadge x:Name="infoBadge1" Value="5" Opacity="{x:Bind InfoBadgeOpacity, Mode=OneWay}"/&gt;
&lt;/NavigationViewItem.InfoBadge&gt;
Expand All @@ -67,9 +67,11 @@
<local:ControlExample x:Name="Example2" HeaderText="Different InfoBadge Styles" HorizontalContentAlignment="Stretch" >
<local:ControlExample.Example>
<StackPanel Orientation="Horizontal" contract5Present:Spacing="20" HorizontalAlignment="Center">
<InfoBadge x:Name="infoBadge2" Style="{StaticResource AttentionIconInfoBadgeStyle}" HorizontalAlignment="Right"/>
<InfoBadge x:Name="infoBadge2" Style="{StaticResource AttentionIconInfoBadgeStyle}" HorizontalAlignment="Right"
AutomationProperties.Name="Warning badge" AutomationProperties.AutomationControlType="Image"/>
<InfoBadge x:Name="infoBadge3" Style="{StaticResource AttentionValueInfoBadgeStyle}" HorizontalAlignment="Right" Value="10"/>
<InfoBadge x:Name="infoBadge4" Style="{StaticResource AttentionDotInfoBadgeStyle}" VerticalAlignment="Center"/>
<InfoBadge x:Name="infoBadge4" Style="{StaticResource AttentionDotInfoBadgeStyle}" VerticalAlignment="Center"
AutomationProperties.Name="Notification badge" AutomationProperties.AutomationControlType="Image"/>
</StackPanel>

</local:ControlExample.Example>
Expand All @@ -86,9 +88,13 @@

<local:ControlExample.Xaml>
<x:String xml:space="preserve">
&lt;InfoBadge x:Name="infoBadge2" Style="{StaticResource $(Style)IconInfoBadgeStyle}" /&gt;
&lt;InfoBadge x:Name="infoBadge3" Style="{StaticResource $(Style)ValueInfoBadgeStyle}" Value="10" /&gt;
&lt;InfoBadge x:Name="infoBadge4" Style="{StaticResource $(Style)DotInfoBadgeStyle}" /&gt;
&lt;StackPanel Orientation="Horizontal" contract5Present:Spacing="20" HorizontalAlignment="Center"/&gt;
&lt;InfoBadge x:Name="infoBadge2" Style="{StaticResource $(Style)IconInfoBadgeStyle}" HorizontalAlignment="Right"
AutomationProperties.Name="Warning badge" AutomationProperties.AutomationControlType="Image"/&gt;
&lt;InfoBadge x:Name="infoBadge3" Style="{StaticResource $(Style)ValueInfoBadgeStyle}" HorizontalAlignment="Right" Value="10" /&gt;
&lt;InfoBadge x:Name="infoBadge4" Style="{StaticResource $(Style)DotInfoBadgeStyle}" VerticalAlignment="Center"
AutomationProperties.Name="Notification badge" AutomationProperties.AutomationControlType="Image"/&gt;
&lt;/StackPanel&gt;
</x:String>
</local:ControlExample.Xaml>

Expand Down

0 comments on commit 85d3945

Please sign in to comment.