Skip to end of metadata
Go to start of metadata

Remarks

The UXDataPager control provides a configurable user interface for paging through a data collection. Similar to the other ClientUI data controls, UXDataPager supports both server side and client side operation.

Client Data Operation

Client data operation means that the data operation, in this case data paging, is executed in the client side against the data source provided to the UXDataPager. To use this operation, you set the QueryOperation property to Client.

You typically use a collection that implements IPagedCollectionView as the data source. The IPagedCollectionView provides paging support to the underlying collection. You can bind the UXDataPager to any IEnumerable collection; however, the UXDataPager will behave as if the data is all on a single page. To provide paging functionality for an IEnumerable collection, you can wrap the collection in a PagedCollectionView instance.

To learn how to implement data paging using UXDataPager, see How-to: Implement Data Paging using UXDataPager.

Server Data Operation

Server data operation means that data operation in this case data paging is processed in the server. This means that UXDataPager does not handle the paging operation by its own. Instead, UXDataPager provides the query information allowing you to process it further.

To use this mode, you set the QueryOperation property to Server. When this mode is selected, UXDataPager will not attempt to perform the data operation on the given data source. Instead, it will store and distribute the query information on certain properties such as PageIndexPageSize and TotalItemCount which are defined in the PageDescriptor property. When one of these properties change, the QueryChanged event of the associated QueryDescriptor will be raised. This allows you to streamline the query processing in a centralized function, which is one of the strong benefits of QueryDescriptor. For more information about QueryDescriptor, see QueryDescriptor Overview.

To learn how to implement data paging using PageDescriptor and UXDataPager, see How-to: Implement Data Paging using PageDescriptor and UXDataPager.

Example

The following illustration shows the UXDataPager configured to use different display mode.

XAML

Working with ResourceOverride Property

You can easily localize the textual content of UXDataPager by setting the ResourceOverride property to a UXDataPagerResource instance containing the customized textual content.

The default textual content are listed in the following table.

Resource KeyResource Value
AutoEllipsisString...
InvalidButtonPanelContentThe NumericButtonPanel contains invalid children.
InvalidTimeSpanThe {0} time span must be strictly positive.
PageIndexMustBeNegativeOneThe PageIndex property can only be set to -1 when the Source property is null or the PageSize property is 0.
Prefix_TotalPageCountKnownPage
Prefix_TotalPageCountUnknownPage
Suffix_TotalPageCountKnownof {0}
Suffix_TotalPageCountUnknown 
UnderlyingPropertyIsReadOnly{0} cannot be set because the underlying property is read only.
ValueMustBeGreaterThanOrEqualTo{0} must be greater than or equal to {1}.

The following examples show how to localize the textual content of a UXDataPager.

Example Title

Definition

public class UXDataPager : ISControl

Summary

The following table summarizes the members exposed in this class.

Public Constructors

UXDataPager Constructor()Initializes a new instance of the UXDataPager class.

Public Properties

AutoEllipsisGets or sets a value that indicates whether to use an ellipsis as the last numeric button.
CanChangePageGets a value that indicates whether the user can move to another page.
CanMoveToFirstPageGets a value that indicates whether the user can move to the first page.
CanMoveToLastPageGets a value that indicates whether the user can move to the last page.
CanMoveToNextPageGets a value that indicates whether the user can move to the next page.
CanMoveToPreviousPageGets a value that indicates whether the user can move to the previous page.
DisplayModeGets or sets a value that indicates how the UXDataPager user interface is displayed.
IsTotalItemCountFixedGets or sets a value that indicates whether the total number of items in the collection is fixed.
ItemCountGets the current number of known items in the source data collection.
NumericButtonCountGets or sets a value that indicates the number of page buttons shown on the UXDataPager user interface.
NumericButtonStyleGets or sets the style that will be used for the numeric buttons.
PageCountGets the current number of known pages if the source is an IPagedCollectionView.
PageDescriptorGets or sets the descriptor object that encapsulates the paging related information.
PageIndexGets or sets the index of the current page.
PageSizeGets or sets a value that indicates the number of items displayed on a page.
QueryOperationGets or sets a value that determines whether the paging operation should be performed in client-side or server-side.
ResourceOverrideGets or sets the individual resource object to override the existing localized resource.
SourceGets or sets the data collection that the UXDataPager controls paging for.

Protected Properties

ProductProduct Info.

Fields

AutoEllipsisPropertyIdentifies the AutoEllipsis dependency property.
CanChangePagePropertyIdentifies the CanChangePage dependency property.
CanMoveToFirstPagePropertyIdentifies the CanMoveToFirstPage dependency property.
CanMoveToLastPagePropertyIdentifies the CanMoveToLastPage dependency property.
CanMoveToNextPagePropertyIdentifies the CanMoveToNextPage dependency property.
CanMoveToPreviousPagePropertyIdentifies the CanMoveToPreviousPage dependency property.
DisplayModePropertyIdentifies the DisplayMode dependency property.
IsTotalItemCountFixedPropertyIdentifies the IsTotalItemCountFixed dependency property.
ItemCountPropertyIdentifies the ItemCount dependency property.
NumericButtonCountPropertyIdentifies the NumericButtonCount dependency property.
NumericButtonStylePropertyIdentifies the NumericButtonStyle dependency property.
PageCountPropertyIdentifies the PageCount dependency property.
PageDescriptorPropertyIdentifies the QueryDescriptor dependency property.
PageIndexPropertyIdentifies the PageIndex dependency property.
PageSizePropertyIdentifies the PageSize dependency property.
QueryOperationPropertyIdentifies the QueryOperation dependency property.
ResourceOverridePropertyIdentifies the ResourceOverride dependency property.
SourcePropertyIdentifies the Source dependency property.

Public Methods

InitializeTemplates()Initializes control templates.
OnApplyTemplate()Builds the visual tree for the UXDataPager control when a new template is applied.

Events

PageIndexChangedOccurs when the PageIndex has changed.
PageIndexChangingOccurs when the PageIndex is changing.

Public Constructors

public UXDataPager()

Initializes a new instance of the UXDataPager class.

Public Properties

public bool AutoEllipsis { get; set; }

Gets or sets a value that indicates whether to use an ellipsis as the last numeric button.

Remarks

You can also set the AutoEllipsis property to true to automatically display an ellipsis indicator when the control has more pages to show. You can also modify the appearance of the numeric button by specifying a custom UXDataPager.

 

public bool CanChangePage { get; }

Gets a value that indicates whether the user can move to another page.

public bool CanMoveToFirstPage { get; }

Gets a value that indicates whether the user can move to the first page.

public bool CanMoveToLastPage { get; }

Gets a value that indicates whether the user can move to the last page.

public bool CanMoveToNextPage { get; }

Gets a value that indicates whether the user can move to the next page.

public bool CanMoveToPreviousPage { get; }

Gets a value that indicates whether the user can move to the previous page.

public PagerDisplayMode DisplayMode { get; set; }

Gets or sets a value that indicates how the UXDataPager user interface is displayed.

Remarks

You can customize the appearance of the UXDataPager by setting the DisplayMode property. If you use a DisplayMode that displays numeric buttons, you can change the number of buttons displayed by setting the UXDataPager property.

 

public bool IsTotalItemCountFixed { get; set; }

Gets or sets a value that indicates whether the total number of items in the collection is fixed.

public int ItemCount { get; }

Gets the current number of known items in the source data collection.

public int NumericButtonCount { get; set; }

Gets or sets a value that indicates the number of page buttons shown on the UXDataPager user interface.

Remarks

You can customize the appearance of the UXDataPager by setting the UXDataPager property. If you use a UXDataPager that displays numeric buttons, you can change the number of buttons displayed by setting the NumericButtonCount property.

 

public Style NumericButtonStyle { get; set; }

Gets or sets the style that will be used for the numeric buttons.

public int PageCount { get; }

Gets the current number of known pages if the source is an IPagedCollectionView.

public PageDescriptor PageDescriptor { get; set; }

Gets or sets the descriptor object that encapsulates the paging related information.

Remarks

The UXDataPager control provides a configurable user interface for paging through a data collection. Similar to the other ClientUI data controls, UXDataPager supports both server side and client side operation.

Client Data Operation

Client data operation means that the data operation, in this case data paging, is executed in the client side against the data source provided to the UXDataPager. To use this operation, you set the UXDataPager property to Client. You typically use a collection that implements IPagedCollectionView as the data source. The IPagedCollectionView provides paging support to the underlying collection. You can bind the UXDataPager to any IEnumerable collection; however, the UXDataPager will behave as if the data is all on a single page. To provide paging functionality for an IEnumerable collection, you can wrap the collection in a PagedCollectionView instance. To learn how to implement data paging using UXDataPager, see How-to: Implement Data Paging using UXDataPager.

Server Data Operation

Server data operation means that data operation in this case data paging is processed in the server. This means that UXDataPager does not handle the paging operation by its own. Instead, UXDataPager provides the query information allowing you to process it further. To use this mode, you set the UXDataPager property to Server. When this mode is selected, UXDataPager will not attempt to perform the data operation on the given data source. Instead, it will store and distribute the query information on certain properties such as PageDescriptor, PageDescriptor and PageDescriptor which are defined in the PageDescriptor property. When one of these properties change, the QueryChanged event of the associated QueryDescriptor will be raised. This allows you to streamline the query processing in a centralized function, which is one of the strong benefits of QueryDescriptor. For more information about QueryDescriptor, see QueryDescriptor Overview. To learn how to implement data paging using UXDataPager and UXDataPager, see How-to: Implement Data Paging using PageDescriptor and UXDataPager.

 

public int PageIndex { get; set; }

Gets or sets the index of the current page.

Remarks

The UXDataPager control provides a configurable user interface for paging through a data collection. Similar to the other ClientUI data controls, UXDataPager supports both server side and client side operation.

Client Data Operation

Client data operation means that the data operation, in this case data paging, is executed in the client side against the data source provided to the UXDataPager. To use this operation, you set the UXDataPager property to Client. You typically use a collection that implements IPagedCollectionView as the data source. The IPagedCollectionView provides paging support to the underlying collection. You can bind the UXDataPager to any IEnumerable collection; however, the UXDataPager will behave as if the data is all on a single page. To provide paging functionality for an IEnumerable collection, you can wrap the collection in a PagedCollectionView instance. To learn how to implement data paging using UXDataPager, see How-to: Implement Data Paging using UXDataPager.

Server Data Operation

Server data operation means that data operation in this case data paging is processed in the server. This means that UXDataPager does not handle the paging operation by its own. Instead, UXDataPager provides the query information allowing you to process it further. To use this mode, you set the UXDataPager property to Server. When this mode is selected, UXDataPager will not attempt to perform the data operation on the given data source. Instead, it will store and distribute the query information on certain properties such as PageIndex, PageDescriptor and PageDescriptor which are defined in the UXDataPager property. When one of these properties change, the QueryChanged event of the associated QueryDescriptor will be raised. This allows you to streamline the query processing in a centralized function, which is one of the strong benefits of QueryDescriptor. For more information about QueryDescriptor, see QueryDescriptor Overview. To learn how to implement data paging using UXDataPager and UXDataPager, see How-to: Implement Data Paging using PageDescriptor and UXDataPager.

 

public int PageSize { get; set; }

Gets or sets a value that indicates the number of items displayed on a page.

public QueryOperation QueryOperation { get; set; }

Gets or sets a value that determines whether the paging operation should be performed in client-side or server-side.

Remarks

Using UXDataPager

The UXDataPager control provides a configurable user interface for paging through a data collection. Similar to the other ClientUI data controls, UXDataPager supports both server side and client side operation.

Client Data Operation

Client data operation means that the data operation, in this case data paging, is executed in the client side against the data source provided to the UXDataPager. To use this operation, you set the QueryOperation property to Client. You typically use a collection that implements IPagedCollectionView as the data source. The IPagedCollectionView provides paging support to the underlying collection. You can bind the UXDataPager to any IEnumerable collection; however, the UXDataPager will behave as if the data is all on a single page. To provide paging functionality for an IEnumerable collection, you can wrap the collection in a PagedCollectionView instance. To learn how to implement data paging using UXDataPager, see How-to: Implement Data Paging using UXDataPager.

Server Data Operation

Server data operation means that data operation in this case data paging is processed in the server. This means that UXDataPager does not handle the paging operation by its own. Instead, UXDataPager provides the query information allowing you to process it further. To use this mode, you set the QueryOperation property to Server. When this mode is selected, UXDataPager will not attempt to perform the data operation on the given data source. Instead, it will store and distribute the query information on certain properties such as PageDescriptor, PageDescriptor and PageDescriptor which are defined in the UXDataPager property. When one of these properties change, the QueryChanged event of the associated QueryDescriptor will be raised. This allows you to streamline the query processing in a centralized function, which is one of the strong benefits of QueryDescriptor. For more information about QueryDescriptor, see QueryDescriptor Overview. To learn how to implement data paging using UXDataPager and UXDataPager, see How-to: Implement Data Paging using PageDescriptor and UXDataPager.

 

public UXDataPagerResource ResourceOverride { get; set; }

Gets or sets the individual resource object to override the existing localized resource.

public IEnumerable Source { get; set; }

Gets or sets the data collection that the UXDataPager controls paging for.

Protected Properties

protected ProductInfo Product { get; }

Product Info.

Fields

public static readonly DependencyProperty AutoEllipsisProperty

Identifies the AutoEllipsis dependency property.

public static readonly DependencyProperty CanChangePageProperty

Identifies the CanChangePage dependency property.

public static readonly DependencyProperty CanMoveToFirstPageProperty

Identifies the CanMoveToFirstPage dependency property.

public static readonly DependencyProperty CanMoveToLastPageProperty

Identifies the CanMoveToLastPage dependency property.

public static readonly DependencyProperty CanMoveToNextPageProperty

Identifies the CanMoveToNextPage dependency property.

public static readonly DependencyProperty CanMoveToPreviousPageProperty

Identifies the CanMoveToPreviousPage dependency property.

public static readonly DependencyProperty DisplayModeProperty

Identifies the DisplayMode dependency property.

public static readonly DependencyProperty IsTotalItemCountFixedProperty

Identifies the IsTotalItemCountFixed dependency property.

public static readonly DependencyProperty ItemCountProperty

Identifies the ItemCount dependency property.

public static readonly DependencyProperty NumericButtonCountProperty

Identifies the NumericButtonCount dependency property.

public static readonly DependencyProperty NumericButtonStyleProperty

Identifies the NumericButtonStyle dependency property.

public static readonly DependencyProperty PageCountProperty

Identifies the PageCount dependency property.

public static readonly DependencyProperty PageDescriptorProperty

Identifies the QueryDescriptor dependency property.

public static readonly DependencyProperty PageIndexProperty

Identifies the PageIndex dependency property.

public static readonly DependencyProperty PageSizeProperty

Identifies the PageSize dependency property.

public static readonly DependencyProperty QueryOperationProperty

Identifies the QueryOperation dependency property.

public static readonly DependencyProperty ResourceOverrideProperty

Identifies the ResourceOverride dependency property.

public static readonly DependencyProperty SourceProperty

Identifies the Source dependency property.

Public Methods

public void InitializeTemplates()

Initializes control templates.

public void OnApplyTemplate()

Builds the visual tree for the UXDataPager control when a new template is applied.

Events

public event ISRoutedEventHandler PageIndexChanged

Occurs when the PageIndex has changed.

public event ISRoutedEventHandler PageIndexChanging

Occurs when the PageIndex is changing.

  • No labels