File tree Expand file tree Collapse file tree
WinUIGallery/Samples/ControlPages Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5151 </controls : ControlExample >
5252 <controls : ControlExample x : Name =" Example2" HeaderText =" PipsPager with options to change its orientation and button visibility." >
5353 <controls : ControlExample .Example>
54- <StackPanel >
55- <PipsPager
56- x : Name =" TestPipsPager2"
57- NumberOfPages =" 10"
58- SelectedIndexChanged =" TestPipsPager2_SelectedIndexChanged" />
59- <TextBlock
60- x : Name =" PageAnnouncementText"
61- Margin =" 0,12,0,0"
62- HorizontalAlignment =" Center"
63- AutomationProperties.LiveSetting=" Polite"
64- AutomationProperties.Name=" Current page"
65- Text =" Page 1 selected" />
66- </StackPanel >
54+ <PipsPager
55+ x : Name =" TestPipsPager2"
56+ NumberOfPages =" 10"
57+ SelectedIndexChanged =" TestPipsPager2_SelectedIndexChanged" />
6758 </controls : ControlExample .Example>
6859 <controls : ControlExample .Options>
6960 <StackPanel >
Original file line number Diff line number Diff line change 33
44using Microsoft . UI . Xaml . Controls ;
55using System . Collections . Generic ;
6+ using WinUIGallery . Helpers ;
67
78namespace WinUIGallery . ControlPages ;
89
@@ -26,11 +27,9 @@ public PipsPagerPage()
2627
2728 private void TestPipsPager2_SelectedIndexChanged ( PipsPager sender , PipsPagerSelectedIndexChangedEventArgs args )
2829 {
29- if ( PageAnnouncementText != null )
30- {
31- int pageNumber = sender . SelectedPageIndex + 1 ; // Convert 0-based index to 1-based page number
32- PageAnnouncementText . Text = $ "Page { pageNumber } selected";
33- }
30+ int pageNumber = sender . SelectedPageIndex + 1 ; // Convert 0-based index to 1-based page number
31+ string announcement = $ "Page { pageNumber } selected";
32+ UIHelper . AnnounceActionForAccessibility ( sender , announcement , "PipsPagerPageChangeNotificationId" ) ;
3433 }
3534
3635 private void OrientationComboBox_SelectionChanged ( object sender , SelectionChangedEventArgs e )
You can’t perform that action at this time.
0 commit comments