-
Notifications
You must be signed in to change notification settings - Fork 703
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
723ea79
commit 76cdc72
Showing
12 changed files
with
1,154 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/Uno.UI/Microsoft/UI/Xaml/Controls/PagerControl/PagerControl.Header.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// MUX reference PagerControl.cpp.h, commit a08f765 | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using Uno.Disposables; | ||
using Windows.Foundation.Collections; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
|
||
namespace Microsoft.UI.Xaml.Controls | ||
{ | ||
public partial class PagerControl | ||
{ | ||
private int m_lastSelectedPageIndex = -1; | ||
private int m_lastNumberOfPagesCount = 0; | ||
|
||
private ComboBox m_comboBox; | ||
private NumberBox m_numberBox; | ||
private ItemsRepeater m_numberPanelRepeater; | ||
private FrameworkElement m_selectedPageIndicator; | ||
|
||
private SerialDisposable m_rootGridKeyDownRevoker = new SerialDisposable(); | ||
private SerialDisposable m_comboBoxSelectionChangedRevoker = new SerialDisposable(); | ||
private SerialDisposable m_numberBoxValueChangedRevoker = new SerialDisposable(); | ||
private SerialDisposable m_firstPageButtonClickRevoker = new SerialDisposable(); | ||
private SerialDisposable m_previousPageButtonClickRevoker = new SerialDisposable(); | ||
private SerialDisposable m_nextPageButtonClickRevoker = new SerialDisposable(); | ||
private SerialDisposable m_lastPageButtonClickRevoker = new SerialDisposable(); | ||
|
||
IObservableVector<object> m_comboBoxEntries; | ||
IObservableVector<object> m_numberPanelElements; | ||
} | ||
} |
190 changes: 190 additions & 0 deletions
190
src/Uno.UI/Microsoft/UI/Xaml/Controls/PagerControl/PagerControl.Properties.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
// MUX reference PagerControl.properties.cpp, commit a08f765 | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using System.Windows.Input; | ||
using Windows.Foundation; | ||
using Windows.UI.Xaml; | ||
|
||
namespace Microsoft.UI.Xaml.Controls | ||
{ | ||
public partial class PagerControl | ||
{ | ||
public bool ButtonPanelAlwaysShowFirstLastPageIndex | ||
{ | ||
get => (bool)GetValue(ButtonPanelAlwaysShowFirstLastPageIndexProperty); | ||
set => SetValue(ButtonPanelAlwaysShowFirstLastPageIndexProperty, value); | ||
} | ||
|
||
public static DependencyProperty ButtonPanelAlwaysShowFirstLastPageIndexProperty { get; } = | ||
DependencyProperty.Register(nameof(ButtonPanelAlwaysShowFirstLastPageIndex), typeof(bool), typeof(PagerControl), new PropertyMetadata(true, OnPropertyChanged)); | ||
|
||
public PagerControlDisplayMode DisplayMode | ||
{ | ||
get => (PagerControlDisplayMode)GetValue(DisplayModeProperty); | ||
set => SetValue(DisplayModeProperty, value); | ||
} | ||
|
||
public static DependencyProperty DisplayModeProperty { get; } = | ||
DependencyProperty.Register(nameof(DisplayMode), typeof(PagerControlDisplayMode), typeof(PagerControl), new PropertyMetadata(default(PagerControlDisplayMode), OnPropertyChanged)); | ||
|
||
public ICommand FirstButtonCommand | ||
{ | ||
get => (ICommand)GetValue(FirstButtonCommandProperty); | ||
set => SetValue(FirstButtonCommandProperty, value); | ||
} | ||
|
||
public static DependencyProperty FirstButtonCommandProperty { get; } = | ||
DependencyProperty.Register(nameof(FirstButtonCommand), typeof(ICommand), typeof(PagerControl), new PropertyMetadata(null, OnPropertyChanged)); | ||
public Style FirstButtonStyle | ||
{ | ||
get => (Style)GetValue(FirstButtonStyleProperty); | ||
set => SetValue(FirstButtonStyleProperty, value); | ||
} | ||
|
||
public static DependencyProperty FirstButtonStyleProperty { get; } = | ||
DependencyProperty.Register(nameof(FirstButtonStyle), typeof(Style), typeof(PagerControl), new PropertyMetadata(null, OnPropertyChanged)); | ||
public PagerControlButtonVisibility FirstButtonVisibility | ||
{ | ||
get => (PagerControlButtonVisibility)GetValue(FirstButtonVisibilityProperty); | ||
set => SetValue(FirstButtonVisibilityProperty, value); | ||
} | ||
|
||
public static DependencyProperty FirstButtonVisibilityProperty { get; } = | ||
DependencyProperty.Register(nameof(FirstButtonVisibility), typeof(PagerControlButtonVisibility), typeof(PagerControl), new PropertyMetadata(default(PagerControlButtonVisibility), OnPropertyChanged)); | ||
|
||
public ICommand LastButtonCommand | ||
{ | ||
get => (ICommand)GetValue(LastButtonCommandProperty); | ||
set => SetValue(LastButtonCommandProperty, value); | ||
} | ||
|
||
public static DependencyProperty LastButtonCommandProperty { get; } = | ||
DependencyProperty.Register(nameof(LastButtonCommand), typeof(ICommand), typeof(PagerControl), new PropertyMetadata(null, OnPropertyChanged)); | ||
|
||
public Style LastButtonStyle | ||
{ | ||
get => (Style)GetValue(LastButtonStyleProperty); | ||
set => SetValue(LastButtonStyleProperty, value); | ||
} | ||
|
||
public static DependencyProperty LastButtonStyleProperty { get; } = | ||
DependencyProperty.Register(nameof(LastButtonStyle), typeof(Style), typeof(PagerControl), new PropertyMetadata(null, OnPropertyChanged)); | ||
|
||
public PagerControlButtonVisibility LastButtonVisibility | ||
{ | ||
get => (PagerControlButtonVisibility)GetValue(LastButtonVisibilityProperty); | ||
set => SetValue(LastButtonVisibilityProperty, value); | ||
} | ||
|
||
public static DependencyProperty LastButtonVisibilityProperty { get; } = | ||
DependencyProperty.Register(nameof(LastButtonVisibility), typeof(PagerControlButtonVisibility), typeof(PagerControl), new PropertyMetadata(default(PagerControlButtonVisibility), OnPropertyChanged)); | ||
|
||
public ICommand NextButtonCommand | ||
{ | ||
get => (ICommand)GetValue(NextButtonCommandProperty); | ||
set => SetValue(NextButtonCommandProperty, value); | ||
} | ||
|
||
public static DependencyProperty NextButtonCommandProperty { get; } = | ||
DependencyProperty.Register(nameof(NextButtonCommand), typeof(ICommand), typeof(PagerControl), new PropertyMetadata(null, OnPropertyChanged)); | ||
|
||
public Style NextButtonStyle | ||
{ | ||
get => (Style)GetValue(NextButtonStyleProperty); | ||
set => SetValue(NextButtonStyleProperty, value); | ||
} | ||
|
||
public static DependencyProperty NextButtonStyleProperty { get; } = | ||
DependencyProperty.Register(nameof(NextButtonStyle), typeof(Style), typeof(PagerControl), new PropertyMetadata(null, OnPropertyChanged)); | ||
|
||
public PagerControlButtonVisibility NextButtonVisibility | ||
{ | ||
get => (PagerControlButtonVisibility)GetValue(NextButtonVisibilityProperty); | ||
set => SetValue(NextButtonVisibilityProperty, value); | ||
} | ||
|
||
public static DependencyProperty NextButtonVisibilityProperty { get; } = | ||
DependencyProperty.Register(nameof(NextButtonVisibility), typeof(PagerControlButtonVisibility), typeof(PagerControl), new PropertyMetadata(default(PagerControlButtonVisibility), OnPropertyChanged)); | ||
|
||
public int NumberOfPages | ||
{ | ||
get => (int)GetValue(NumberOfPagesProperty); | ||
set => SetValue(NumberOfPagesProperty, value); | ||
} | ||
|
||
public static DependencyProperty NumberOfPagesProperty { get; } = | ||
DependencyProperty.Register(nameof(NumberOfPages), typeof(int), typeof(PagerControl), new PropertyMetadata(0, OnPropertyChanged)); | ||
|
||
public string PrefixText | ||
{ | ||
get => (string)GetValue(PrefixTextProperty); | ||
set => SetValue(PrefixTextProperty, value); | ||
} | ||
|
||
public static DependencyProperty PrefixTextProperty { get; } = | ||
DependencyProperty.Register(nameof(PrefixText), typeof(string), typeof(PagerControl), new PropertyMetadata(null, OnPropertyChanged)); | ||
|
||
public ICommand PreviousButtonCommand | ||
{ | ||
get => (ICommand)GetValue(PreviousButtonCommandProperty); | ||
set => SetValue(PreviousButtonCommandProperty, value); | ||
} | ||
|
||
public static DependencyProperty PreviousButtonCommandProperty { get; } = | ||
DependencyProperty.Register(nameof(PreviousButtonCommand), typeof(ICommand), typeof(PagerControl), new PropertyMetadata(null, OnPropertyChanged)); | ||
|
||
public Style PreviousButtonStyle | ||
{ | ||
get => (Style)GetValue(PreviousButtonStyleProperty); | ||
set => SetValue(PreviousButtonStyleProperty, value); | ||
} | ||
|
||
public static DependencyProperty PreviousButtonStyleProperty { get; } = | ||
DependencyProperty.Register(nameof(PreviousButtonStyle), typeof(Style), typeof(PagerControl), new PropertyMetadata(null, OnPropertyChanged)); | ||
|
||
public PagerControlButtonVisibility PreviousButtonVisibility | ||
{ | ||
get => (PagerControlButtonVisibility)GetValue(PreviousButtonVisibilityProperty); | ||
set => SetValue(PreviousButtonVisibilityProperty, value); | ||
} | ||
|
||
public static DependencyProperty PreviousButtonVisibilityProperty { get; } = | ||
DependencyProperty.Register(nameof(PreviousButtonVisibility), typeof(PagerControlButtonVisibility), typeof(PagerControl), new PropertyMetadata(default(PagerControlButtonVisibility), OnPropertyChanged)); | ||
|
||
public int SelectedPageIndex | ||
{ | ||
get => (int)GetValue(SelectedPageIndexProperty); | ||
set => SetValue(SelectedPageIndexProperty, value); | ||
} | ||
|
||
public static DependencyProperty SelectedPageIndexProperty { get; } = | ||
DependencyProperty.Register(nameof(SelectedPageIndex), typeof(int), typeof(PagerControl), new PropertyMetadata(0, OnPropertyChanged)); | ||
|
||
public string SuffixText | ||
{ | ||
get => (string)GetValue(SuffixTextProperty); | ||
set => SetValue(SuffixTextProperty, value); | ||
} | ||
|
||
public static DependencyProperty SuffixTextProperty { get; } = | ||
DependencyProperty.Register(nameof(SuffixText), typeof(string), typeof(PagerControl), new PropertyMetadata(null, OnPropertyChanged)); | ||
|
||
public PagerControlTemplateSettings TemplateSettings | ||
{ | ||
get => (PagerControlTemplateSettings)GetValue(TemplateSettingsProperty); | ||
set => SetValue(TemplateSettingsProperty, value); | ||
} | ||
|
||
public static DependencyProperty TemplateSettingsProperty { get; } = | ||
DependencyProperty.Register(nameof(TemplateSettings), typeof(PagerControlTemplateSettings), typeof(PagerControl), new PropertyMetadata(null, OnPropertyChanged)); | ||
|
||
private static void OnPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) | ||
{ | ||
var owner = (PagerControl)sender; | ||
owner.OnPropertyChanged(args); | ||
} | ||
|
||
public event TypedEventHandler<PagerControl, PagerControlSelectedIndexChangedEventArgs> SelectedIndexChanged; | ||
} | ||
} |
Oops, something went wrong.