This documentation is archived and is not being maintained.

TextElementCollection.InsertBefore Method

Inserts a specified item in the collection before a specified collection item.

Namespace: System.Windows.Documents
Assembly: PresentationFramework (in presentationframework.dll)

public void InsertBefore (
	TextElementType nextSibling,
	TextElementType newItem
)
public void InsertBefore (
	TextElementType nextSibling, 
	TextElementType newItem
)
public function InsertBefore (
	nextSibling : TextElementType, 
	newItem : TextElementType
)
You cannot use methods in XAML.

Parameters

nextSibling

An item in the collection before which the new item will be inserted.

newItem

An item to insert into the collection.

Exception typeCondition

ArgumentException

Raised when newItem already belongs to a collection.

ArgumentNullException

Raised when nextSibling or newItem is null.

InvalidOperationException

Raised when nextSibling does not belong to this collection.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Show: