MobileServiceCollection<TTable,TCollection> Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An asynchronous data source that can wrap the results of a Mobile Services query in a way that's easily consumed by Xaml collection controls like ListView, GridView or ListBox.
public class MobileServiceCollection<TTable,TCollection> : System.Collections.ObjectModel.ObservableCollection<TCollection>, Microsoft.WindowsAzure.MobileServices.IQueryResultEnumerable<TCollection>, Microsoft.WindowsAzure.MobileServices.ITotalCountProvider, System.Collections.Generic.IEnumerable<TCollection>
type MobileServiceCollection<'able, 'Collection> = class
inherit ObservableCollection<'Collection>
interface ITotalCountProvider
interface IQueryResultEnumerable<'Collection>
interface seq<'Collection>
interface IEnumerable
Public Class MobileServiceCollection(Of TTable, TCollection)
Inherits ObservableCollection(Of TCollection)
Implements IEnumerable(Of TCollection), IQueryResultEnumerable(Of TCollection), ITotalCountProvider
Type Parameters
- TTable
Data source element type.
- TCollection
Type of elements ending up in the collection.
- Inheritance
-
ObservableCollection<TCollection>MobileServiceCollection<TTable,TCollection>
- Derived
- Implements
-
IQueryResultEnumerable<TCollection> ITotalCountProvider IEnumerable<T> IEnumerable<TCollection> IEnumerable
Remarks
Currently handles asynchronously loading the data, notifying the controls and paging. Use the MobileServiceCollection<T> class if the table and collection items are of the same type.
Constructors
MobileServiceCollection<TTable,TCollection>(IMobileServiceTableQuery<TTable>, Func<IEnumerable<TTable>,IEnumerable<TCollection>>, Int32) |
Initializes a new instance of the IncrementalLoadingMobileServiceCollection{TTable, TCollection} class. |
MobileServiceCollection<TTable,TCollection>(IMobileServiceTableQuery<TTable>, Func<TTable,TCollection>, Int32) |
Initializes a new instance of the IncrementalLoadingMobileServiceCollection{TTable, TCollection} class. |
MobileServiceCollection<TTable,TCollection>(IMobileServiceTableQuery<TTable>, Int32) |
Initializes a new instance of the IncrementalLoadingMobileServiceCollection{TTable, TCollection} class. This constructior should be used in cases where TTable and TCollection are the same type. |
Fields
selectorFunction |
A selector function which will be appied to the data when it comes back from the server. |
Properties
HasMoreItems |
Gets a value indicating whether there are more items that can be loaded incrementally. |
NextLink |
Gets the link to next page of result that is returned in response headers. |
PageSize |
The page size specified in the constructor. |
TotalCount |
Gets the total count for all the records that would have been returned ignoring any take paging/limit clause specified by client or server. |
Methods
LoadMoreItemsAsync(CancellationToken, Int32) |
Load more items asynchronously. Controls which support incremental loading on such as GridView on Windows 8 call this method automatically. In other cases you should call this method yourself. |
LoadMoreItemsAsync(Int32) |
Load more items asynchronously. Controls which support incremental loading on such as GridView on Windows 8 call this method automatically. In other cases you should call this method yourself. |
OnPropertyChanged(String) |
Invokes the PropertyChanged event for the |
PrepareDataForCollection(IEnumerable<TTable>) |
Transforms the data from the query into data for the collection using the provided selector function. |
PrepareDataForCollection(TTable) |
Transforms one item into an item for the collection using the provided selector function. |
ProcessQueryAsync(CancellationToken, IMobileServiceTableQuery<TTable>) |
Evaluates the query and adds the result to the collection. |
Events
LoadingComplete |
Occurs when finished loading items. Provides LoadingCompleteEventArgs with how many items were loaded. |
LoadingItems |
Occurs when LoadMoreItemsAsync(Int32) starting to load items. |
Extension Methods
ToCommaSeparatedString<T>(IEnumerable<T>) |
Converts the elements of a collection to strings and concatenates them into a comma-separated list, or returns null for null or empty collections. |
Applies to
Azure SDK for .NET