Skip to content

Commit

Permalink
Fix a11y issue on InfoBadge sample (microsoft#1310)
Browse files Browse the repository at this point in the history
* Add tooltip to fix a11y issue

* Fix sample code

* Fix faulty formatting and icon
  • Loading branch information
marcelwgn authored Jul 12, 2023
1 parent f0825ac commit 9b0d8f6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions WinUIGallery/ControlPages/InfoBadgePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,13 @@

<local:ControlExample x:Name="Example3" HeaderText="Placing an InfoBadge Inside Another Control" HorizontalContentAlignment="Stretch" >
<local:ControlExample.Example>
<Button Padding="0" Width="200" Height="60" HorizontalAlignment="Center" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
<Button Padding="0" Width="200" Height="60" ToolTipService.ToolTip="Refresh required"
HorizontalAlignment="Center" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto">
<SymbolIcon Symbol="Sync" HorizontalAlignment="Center"/>
<InfoBadge Background="#C42B1C" HorizontalAlignment="Right" VerticalAlignment="Top">
<InfoBadge.IconSource>
<FontIconSource FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xF13C;"/>
<FontIconSource FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xF13C;" />
</InfoBadge.IconSource>
</InfoBadge>
</Grid>
Expand All @@ -114,12 +115,13 @@

<local:ControlExample.Xaml>
<x:String xml:space="preserve">
&lt;Button Padding="0" Width="200" Height="60" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"&gt;
&lt;Button Padding="0" Width="200" Height="60" ToolTipService.ToolTip="Refresh required"
HorizontalAlignment="Center" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"&gt;
&lt;Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto"&gt;
&lt;SymbolIcon Symbol="Sync" HorizontalAlignment="Center"/&gt;
&lt;InfoBadge Background="#C42B1C" HorizontalAlignment="Right" VerticalAlignment="Top"&gt;
&lt;InfoBadge.IconSource&gt;
&lt;FontIconSource FontFamily={StaticResource SymbolThemeFontFamily} Glyph="&#xF13C;" /&gt;
&lt;FontIconSource FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xF13C;" /&gt;
&lt;/InfoBadge.IconSource&gt;
&lt;/InfoBadge&gt;
&lt;/Grid&gt;
Expand Down

0 comments on commit 9b0d8f6

Please sign in to comment.