Share via


MobileServiceCollectionView<T> Class

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.

Inheritance Hierarchy

System.Object
  Microsoft.WindowsAzure.MobileServices.MobileServiceCollectionView<T>

Namespace:  Microsoft.WindowsAzure.MobileServices
Assembly:  Microsoft.WindowsAzure.MobileServices.Managed (in Microsoft.WindowsAzure.MobileServices.Managed.dll)

Syntax

'Declaration
Public NotInheritable Class MobileServiceCollectionView(Of T) _
    Implements ICollectionView, IObservableVector(Of Object),  _
    IList(Of Object), ICollection(Of Object), IEnumerable(Of Object),  _
    IList, ICollection, IEnumerable, INotifyPropertyChanged, INotifyCollectionChanged,  _
    ISupportIncrementalLoading, ITotalCountProvider
'Usage
Dim instance As MobileServiceCollectionView(Of T)
public sealed class MobileServiceCollectionView<T> : ICollectionView, 
    IObservableVector<Object>, IList<Object>, ICollection<Object>, 
    IEnumerable<Object>, IList, ICollection, IEnumerable, 
    INotifyPropertyChanged, INotifyCollectionChanged, ISupportIncrementalLoading, ITotalCountProvider
generic<typename T>
public ref class MobileServiceCollectionView sealed : ICollectionView, 
    IObservableVector<Object^>, IList<Object^>, ICollection<Object^>, 
    IEnumerable<Object^>, IList, ICollection, IEnumerable, 
    INotifyPropertyChanged, INotifyCollectionChanged, ISupportIncrementalLoading, ITotalCountProvider
[<SealedAttribute>]
type MobileServiceCollectionView<'T> =  
    class 
        interface ICollectionView 
        interface IObservableVector<Object>
        interface IList<Object>
        interface ICollection<Object>
        interface IEnumerable<Object>
        interface IList 
        interface ICollection 
        interface IEnumerable 
        interface INotifyPropertyChanged 
        interface INotifyCollectionChanged 
        interface ISupportIncrementalLoading 
        interface ITotalCountProvider 
    end
JScript does not support generic types and methods.

Type Parameters

  • T
    Data source element type.

The MobileServiceCollectionView<T> type exposes the following members.

Properties

  Name Description
Public property CollectionGroups Gets the collection groups associated with the collection view.
Public property Count Gets the number of elements contained in the collection.
Public property CurrentItem Gets the current item in the collection view.
Public property CurrentPosition Gets the position of the current item within the collection view.
Public property HasMoreItems Gets a value indicating whether there are more items that can be loaded incrementally.
Public property IsCurrentAfterLast Gets a value indicating whether the current item is after the end of the collection.
Public property IsCurrentBeforeFirst Gets a value indicating whether the current item is before the beginning of the collection.
Public property IsReadOnly Gets a value indicating whether the collection is read-only.
Public property Item Gets or sets the item at the specified index.

Top

Methods

  Name Description
Public method Add Adds an item to the collection.
Public method Clear Removes all items from the collection.
Public method Contains Determines whether the collection contains a given element.
Public method CopyTo Copies the elements of the collection to an array.
Public method Equals (Inherited from Object.)
Public method GetEnumerator Get an enumerator for the data source.
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Public method IndexOf Determines the index of a specific item in the list.
Public method Insert Insert an item into the collection at the specified index.
Public method LoadMoreItemsAsync Load more items asynchronously.
Public method MoveCurrentTo Sets the first instance of the specified item in our currentoy loaded data as the current item in the collection view.
Public method MoveCurrentToFirst Move the current item to the first item in the collection view.
Public method MoveCurrentToLast Move the current item to the last item in the collection view.
Public method MoveCurrentToNext Move the current item to the next item in the collection view.
Public method MoveCurrentToPosition Sets the specified position as the current item in the collection view.
Public method MoveCurrentToPrevious Move the current item to the previous item in the collection view.
Public method Remove Removes the first occurence of the specified item from the list.
Public method RemoveAt Removes the item at the specified index.
Public method ToString (Inherited from Object.)

Top

Events

  Name Description
Public event CollectionChanged Occurs when the collection changes.
Public event CurrentChanged Occurs after the current item has been changed.
Public event CurrentChanging Occurs before the current item is changed.
Public event PropertyChanged Occurs when a property value changes.
Public event VectorChanged Occurs then the collection changes.

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method ICollection<Object>.Add Adds an item to the collection.
Explicit interface implemetationPrivate method IList.Add Adds an item the collection.
Explicit interface implemetationPrivate method IList.Clear Removes all the items from the list.
Explicit interface implemetationPrivate method ICollection<Object>.Contains Determines whether the collection contains a specific value.
Explicit interface implemetationPrivate method IList.Contains Determines whether a list contains a specified value.
Explicit interface implemetationPrivate method ICollection<Object>.CopyTo Copies the elements of the collection to an array, starting at a particular array index.
Explicit interface implemetationPrivate method ICollection.CopyTo Copy the elements of the collection to an array.
Explicit interface implemetationPrivate property ICollection.Count Gets the number of items in the collection.
Explicit interface implemetationPrivate method IEnumerable<Object>.GetEnumerator Returns an enumerator that iterates through the collection.
Explicit interface implemetationPrivate method IEnumerable.GetEnumerator Enumerate the items in the collection.
Explicit interface implemetationPrivate method IList<Object>.IndexOf Determines the index of a specific item in the collection.
Explicit interface implemetationPrivate method IList.IndexOf Determines the index of a specified item in the list.
Explicit interface implemetationPrivate method IList<Object>.Insert Inserts an item to the collection at the specified index.
Explicit interface implemetationPrivate method IList.Insert Insert an item into the collection at the specified index.
Explicit interface implemetationPrivate property IList.IsFixedSize Gets a value indicating whether the list has a fixed size.
Explicit interface implemetationPrivate property IList.IsReadOnly Gets a value indicating whether the collection is readonly.
Explicit interface implemetationPrivate property ICollection.IsSynchronized Gets a value indicating whether the collection is synchronized.
Explicit interface implemetationPrivate property IList<Object>.Item Gets or sets the item at the specified index.
Explicit interface implemetationPrivate property IList.Item Gets or sets an element at a given index.
Explicit interface implemetationPrivate method ICollection<Object>.Remove Removes the first occurrence of a specific object from the collection.
Explicit interface implemetationPrivate method IList.Remove Removes the first occurence of the specified item from the list.
Explicit interface implemetationPrivate method IList.RemoveAt Removes the item at the specified index.
Explicit interface implemetationPrivate property ICollection.SyncRoot Gets an object used to synchronize the collection.
Explicit interface implemetationPrivate property ITotalCountProvider.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.

Top

Remarks

This currently just handles asynchronously loading the data and notifying the controls, but we'd eventually like to support paging, UI virtualization, and a host of other features.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.WindowsAzure.MobileServices Namespace