File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed
Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,9 @@ public App()
4141 /// <param name="args">Details about the launch request and process.</param>
4242 protected override void OnLaunched ( Microsoft . UI . Xaml . LaunchActivatedEventArgs args )
4343 {
44- m_window = new MainWindow ( ) ;
44+ m_window = new Window ( ) ;
4545 m_window . Activate ( ) ;
46+ m_window . Content = new MainPage ( ) ;
4647 }
4748
4849 private Window m_window ;
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
2- <Window
3- x : Class =" PagerControlPolyfill.TestApp.MainWindow "
2+ <Page
3+ x : Class =" PagerControlPolyfill.TestApp.MainPage "
44 xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
55 xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
66 xmlns : d =" http://schemas.microsoft.com/expression/blend/2008"
5959 DisplayMode =" ButtonPanel"
6060 ButtonPanelAlwaysShowFirstLastPageIndex =" True" />
6161
62+ <TextBlock Text =" Binding tester" />
63+ <pager : PagerControl SelectedPageIndex =" {x:Bind SelectedPageIndexBind, Mode=TwoWay}" NumberOfPages =" 20" />
64+
6265 </StackPanel >
6366
6467 <ScrollViewer Grid.Column=" 1" HorizontalScrollMode =" Enabled" HorizontalScrollBarVisibility =" Visible" >
257260 </Grid >
258261 </ScrollViewer >
259262 </Grid >
260- </Window >
263+ </Page >
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ namespace PagerControlPolyfill.TestApp
2222 /// <summary>
2323 /// An empty window that can be used on its own or navigated to within a Frame.
2424 /// </summary>
25- public sealed partial class MainWindow : Window
25+ public sealed partial class MainPage : Page
2626 {
27- public MainWindow ( )
27+ public MainPage ( )
2828 {
2929 this . InitializeComponent ( ) ;
3030 RootGrid . Loaded += OnLoad ;
@@ -38,6 +38,14 @@ public MainWindow()
3838 Button nextPageButton ;
3939 Button lastPageButton ;
4040
41+ public int SelectedPageIndexBind
42+ {
43+ get { return ( int ) GetValue ( SelectedPageIndexBindProperty ) ; }
44+ set { SetValue ( SelectedPageIndexBindProperty , value ) ; }
45+ }
46+ public static readonly DependencyProperty SelectedPageIndexBindProperty =
47+ DependencyProperty . Register ( "SelectedPageIndexBind" , typeof ( int ) , typeof ( MainPage ) , new PropertyMetadata ( 5 ) ) ;
48+
4149 private void OnLoad ( object sender , RoutedEventArgs args )
4250 {
4351 PagerDisplayModeComboBox . SelectionChanged += OnDisplayModeChanged ;
You can’t perform that action at this time.
0 commit comments