Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion WinUIGallery/Samples/ControlPages/PipsPagerPage.xaml

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@
</controls:ControlExample>
<controls:ControlExample x:Name="Example2" HeaderText="PipsPager with options to change its orientation and button visibility.">
<controls:ControlExample.Example>
<PipsPager x:Name="TestPipsPager2" />
<PipsPager
x:Name="TestPipsPager2"
NumberOfPages="10"
SelectedIndexChanged="TestPipsPager2_SelectedIndexChanged" />
</controls:ControlExample.Example>
<controls:ControlExample.Options>
<StackPanel>
Expand Down
11 changes: 11 additions & 0 deletions WinUIGallery/Samples/ControlPages/PipsPagerPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@

using Microsoft.UI.Xaml.Controls;
using System.Collections.Generic;
using WinUIGallery.Helpers;

namespace WinUIGallery.ControlPages;

public sealed partial class PipsPagerPage : Page
{
private const string PipsPagerPageChangeNotificationId = "PipsPagerPageChangeNotificationId";

public List<string> Pictures = new List<string>()
{
"ms-appx:///Assets/SampleMedia/LandscapeImage1.jpg",
Expand All @@ -24,6 +27,14 @@ public PipsPagerPage()
this.InitializeComponent();
}

private void TestPipsPager2_SelectedIndexChanged(PipsPager sender, PipsPagerSelectedIndexChangedEventArgs args)
Comment thread
marcelwgn marked this conversation as resolved.
{
int pageNumber = sender.SelectedPageIndex + 1; // Convert 0-based index to 1-based page number
int totalPages = sender.NumberOfPages;
string announcement = $"Page {pageNumber} of {totalPages} selected";
UIHelper.AnnounceActionForAccessibility(sender, announcement, PipsPagerPageChangeNotificationId);
}

private void OrientationComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
string? orientation = e.AddedItems[0].ToString();
Expand Down