CompositeCollection Classe
Définition
Permet d’afficher plusieurs collections et éléments sous forme de liste unique.Enables multiple collections and items to be displayed as a single list.
public ref class CompositeCollection : System::Collections::IList, System::Collections::Specialized::INotifyCollectionChanged, System::ComponentModel::ICollectionViewFactory, System::Windows::IWeakEventListener
[System.Windows.Localizability(System.Windows.LocalizationCategory.Ignore)]
public class CompositeCollection : System.Collections.IList, System.Collections.Specialized.INotifyCollectionChanged, System.ComponentModel.ICollectionViewFactory, System.Windows.IWeakEventListener
[<System.Windows.Localizability(System.Windows.LocalizationCategory.Ignore)>]
type CompositeCollection = class
interface ICollection
interface IEnumerable
interface IList
interface INotifyCollectionChanged
interface ICollectionViewFactory
interface IWeakEventListener
[<System.Windows.Localizability(System.Windows.LocalizationCategory.Ignore)>]
type CompositeCollection = class
interface IList
interface ICollection
interface IEnumerable
interface INotifyCollectionChanged
interface ICollectionViewFactory
interface IWeakEventListener
Public Class CompositeCollection
Implements ICollectionViewFactory, IList, INotifyCollectionChanged, IWeakEventListener
- Héritage
-
CompositeCollection
- Attributs
- Implémente
Remarques
CompositeCollection peut contenir des éléments tels que des chaînes, des objets, des XMLXML nœuds, des éléments, ainsi que d’autres collections.CompositeCollection can contain items such as strings, objects, XMLXML nodes, elements, as well as other collections. ItemsControlUtilise les données de CompositeCollection pour générer son contenu en fonction de son ItemTemplate .An ItemsControl uses the data in the CompositeCollection to generate its content according to its ItemTemplate. Pour plus d’informations sur l’utilisation d' ItemsControl objets pour la liaison aux collections, consultez la section liaison aux collections de la vue d’ensemblede la liaison de données.For more information about using ItemsControl objects to bind to collections, see the Binding to Collections section of the Data Binding Overview.
Constructeurs
CompositeCollection() |
Crée une instance de la classe CompositeCollection vide disposant de la capacité initiale par défaut.Creates a new instance of the CompositeCollection class that is empty and has default initial capacity. |
CompositeCollection(Int32) |
Crée une instance de la classe CompositeCollection vide disposant d'une capacité initiale spécifique.Creates a new instance of the CompositeCollection class that is empty and has a specified initial capacity. |
Propriétés
Count |
Obtient le nombre d'éléments stockés dans la collection.Gets the number of items stored in this collection. |
Item[Int32] |
Propriété d'indexeur qui récupère ou remplace l'élément à l'offset de base zéro spécifié dans la collection.Indexer property that retrieves or replaces the item at the given zero-based offset in the collection. |
Méthodes
Add(Object) |
Ajoute l'élément spécifié à la collection.Adds the specified item to this collection. |
Clear() |
Efface la collection.Clears the collection. |
Contains(Object) |
Vérifie si un élément donné se trouve dans la collection.Checks to see if a given item is in this collection. |
CopyTo(Array, Int32) |
Crée une copie superficielle de références d'objet de la collection dans le tableau spécifié.Makes a shallow copy of object references from this collection to the given array. |
Equals(Object) |
Détermine si l'objet spécifié est égal à l'objet actuel.Determines whether the specified object is equal to the current object. (Hérité de Object) |
GetHashCode() |
Fait office de fonction de hachage par défaut.Serves as the default hash function. (Hérité de Object) |
GetType() |
Obtient le Type de l'instance actuelle.Gets the Type of the current instance. (Hérité de Object) |
IndexOf(Object) |
Retourne l'index dans cette collection où se trouve l'élément spécifié.Returns the index in this collection where the given item is found. |
Insert(Int32, Object) |
Insère un élément dans la collection au niveau de l'index spécifié.Inserts an item in the collection at a given index. Tous les éléments situés après la position spécifiée sont décalés d'une ligne vers le bas.All items after the given position are moved down by one. |
MemberwiseClone() |
Crée une copie superficielle du Object actuel.Creates a shallow copy of the current Object. (Hérité de Object) |
ReceiveWeakEvent(Type, Object, EventArgs) |
Gère des événements de la table d'événements centralisée.Handles events from the centralized event table. |
Remove(Object) |
Supprime la référence d'élément spécifiée de la collection.Removes the given item reference from the collection. Les éléments restants sont décalés d'une ligne vers le haut.All remaining items move up by one. |
RemoveAt(Int32) |
Supprime un élément de la collection à l'index spécifié.Removes an item from the collection at the given index. Les éléments restants sont décalés d'une ligne vers le haut.All remaining items move up by one. |
ToString() |
Retourne une chaîne qui représente l'objet actuel.Returns a string that represents the current object. (Hérité de Object) |
Événements
CollectionChanged |
Se produit lorsque la collection est modifiée par l'ajout ou la suppression d'un élément.Occurs when the collection changes, either by adding or removing an item. |
Implémentations d’interfaces explicites
ICollection.IsSynchronized |
Ce membre prend en charge l’infrastructure Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) et n’est pas destiné à être directement utilisé à partir de votre code.This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. |
ICollection.SyncRoot |
Ce membre prend en charge l’infrastructure Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) et n’est pas destiné à être directement utilisé à partir de votre code.This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. |
ICollectionViewFactory.CreateView() |
Ce membre prend en charge l’infrastructure Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) et n’est pas destiné à être directement utilisé à partir de votre code.This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. |
IEnumerable.GetEnumerator() |
Retourne un énumérateur.Returns an enumerator. |
IList.IsFixedSize |
Ce membre prend en charge l’infrastructure Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) et n’est pas destiné à être directement utilisé à partir de votre code.This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. |
IList.IsReadOnly |
Ce membre prend en charge l’infrastructure Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) et n’est pas destiné à être directement utilisé à partir de votre code.This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. |
INotifyCollectionChanged.CollectionChanged |
Se produit lorsque la collection a été modifiée.Occurs when the collection has changed. |
IWeakEventListener.ReceiveWeakEvent(Type, Object, EventArgs) |
Ce membre prend en charge l’infrastructure Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) et n’est pas destiné à être directement utilisé à partir de votre code.This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. |
Méthodes d’extension
Cast<TResult>(IEnumerable) |
Effectue un cast des éléments d'un IEnumerable vers le type spécifié.Casts the elements of an IEnumerable to the specified type. |
OfType<TResult>(IEnumerable) |
Filtre les éléments d'un IEnumerable en fonction du type spécifié.Filters the elements of an IEnumerable based on a specified type. |
AsParallel(IEnumerable) |
Active la parallélisation d'une requête.Enables parallelization of a query. |
AsQueryable(IEnumerable) |
Convertit un IEnumerable en IQueryable.Converts an IEnumerable to an IQueryable. |