InlineCollection Class
System.Windows.Documents::TextElementCollection<Inline>
System.Windows.Documents::InlineCollection
Assembly: PresentationFramework (in PresentationFramework.dll)
The InlineCollection type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Count | Gets the number of items currently in the collection. (Inherited from TextElementCollection<TextElementType>.) |
![]() | FirstInline | Gets the first Inline element within this instance of InlineCollection. |
![]() | IsReadOnly | Gets a value that indicates whether or not the collection is read-only. (Inherited from TextElementCollection<TextElementType>.) |
![]() | LastInline | Gets the last Inline element within this instance of InlineCollection. |
| Name | Description | |
|---|---|---|
![]() | Add(TextElementType) | Appends a specified item to the collection. (Inherited from TextElementCollection<TextElementType>.) |
![]() | Add(String) | Adds an implicit Run element with the given text, supplied as a String. |
![]() | Add(UIElement) | Adds an implicit InlineUIContainer with the supplied UIElement already in it. |
![]() | AddRange | Appends a specified range of items to the collection. (Inherited from TextElementCollection<TextElementType>.) |
![]() | Clear | Clears all items from the collection. (Inherited from TextElementCollection<TextElementType>.) |
![]() | Contains | Queries for the presence of a specified item in the collection. (Inherited from TextElementCollection<TextElementType>.) |
![]() | CopyTo | Copies the contents of the collection and inserts them into a specified array starting at a specified index position in the array. (Inherited from TextElementCollection<TextElementType>.) |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetEnumerator | Returns an enumerator for the contents of the collection. (Inherited from TextElementCollection<TextElementType>.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | InsertAfter | Inserts a specified item in the collection after a specified collection item. (Inherited from TextElementCollection<TextElementType>.) |
![]() | InsertBefore | Inserts a specified item in the collection before a specified collection item. (Inherited from TextElementCollection<TextElementType>.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | Remove | Removes a specified item from the collection. (Inherited from TextElementCollection<TextElementType>.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() | AsParallel | Enables parallelization of a query. (Defined by ParallelEnumerable.) |
![]() | AsQueryable | Converts an IEnumerable to an IQueryable. (Defined by Queryable.) |
![]() | Cast<TResult> | Casts the elements of an IEnumerable to the specified type. (Defined by Enumerable.) |
![]() | OfType<TResult> | Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.) |
| Name | Description | |
|---|---|---|
![]() ![]() | ICollection::CopyTo | Copies the elements of the ICollection to an Array, starting at a particular Array index.. Use the type-safe CopyTo method instead. (Inherited from TextElementCollection<TextElementType>.) |
![]() ![]() | ICollection::Count | Gets the number of elements contained in the ICollection. Use the type-safe Count property instead. (Inherited from TextElementCollection<TextElementType>.) |
![]() ![]() | ICollection::IsSynchronized | Gets a value indicating whether access to the ICollection is synchronized (thread safe). (Inherited from TextElementCollection<TextElementType>.) |
![]() ![]() | ICollection::SyncRoot | Gets an object that can be used to synchronize access to the ICollection. (Inherited from TextElementCollection<TextElementType>.) |
![]() ![]() | IEnumerable::GetEnumerator | Returns an enumerator that iterates through a collection. Use the type-safe GetEnumerator method instead. (Inherited from TextElementCollection<TextElementType>.) |
![]() ![]() | IList::Add | Adds an item to the IList. Use the type-safe Add method instead. (Inherited from TextElementCollection<TextElementType>.) |
![]() ![]() | IList::Clear | This type or member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. Use the type-safe Clear method instead. (Inherited from TextElementCollection<TextElementType>.) |
![]() ![]() | IList::Contains | Determines whether the IList contains a specific value.. Use the type-safe Contains method instead. (Inherited from TextElementCollection<TextElementType>.) |
![]() ![]() | IList::IndexOf | Determines the index of a specific item in the IList. (Inherited from TextElementCollection<TextElementType>.) |
![]() ![]() | IList::Insert | Inserts an item to the IList at the specified index. Use the type-safe InsertAfter or InsertBefore methods instead. (Inherited from TextElementCollection<TextElementType>.) |
![]() ![]() | IList::IsFixedSize | Gets a value indicating whether the IList has a fixed size. (Inherited from TextElementCollection<TextElementType>.) |
![]() ![]() | IList::IsReadOnly | Gets a value indicating whether the IList is read-only. (Inherited from TextElementCollection<TextElementType>.) |
![]() ![]() | IList::Item | Gets or sets the element at the specified index. (Inherited from TextElementCollection<TextElementType>.) |
![]() ![]() | IList::Remove | Removes the first occurrence of a specific object from the IList. Use the type-safe Remove method instead. (Inherited from TextElementCollection<TextElementType>.) |
![]() ![]() | IList::RemoveAt | Removes the IList item at the specified index. (Inherited from TextElementCollection<TextElementType>.) |
These examples demonstrate some of the more common operations that can be performed on inline flow content elements (and containers of such elements, such as TextBlock) through the Inlines property. This property is used to add and remove items from InlineCollection. Flow content elements that feature an Inlines property include:
These examples happen to use Span as the flow content element, but these techniques are applicable to all elements or controls that host an InlineCollection collection.
The following example creates a new Span object, and then uses the Add method to add two text runs as content children of the Span.
The following example creates a new Run element and inserts it at the beginning of the Span.
The following example gets the number of top-level Inline elements contained in the Span.
The following example deletes the last Inline element in the Span.
The following example clears all of the contents (Inline elements) from the Span.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

