IXRInlineCollection (Windows Embedded CE 6.0)

1/6/2010

This class provides access to a collection of IXRInline objects.

Syntax

class IXRInlineCollection : public IXRCollection<IXRInline*, IXRDependencyObject*>

Methods

IXRInlineCollection inherits the methods from the template class IXRCollection<In_T, Out_T>. It uses In_T parameters of type IXRInline* and uses Out_T parameters of type IXRDependencyObject*.

Remarks

In Silverlight content model, IXRInlineCollection only exists as the type for a property value for an object that has a property that represents an inline collection, such as the value returned by IXRTextBlock::GetInlines. An IXRInlineCollection object cannot be instantiated directly (in XAML or in C++ code).

You can obtain a pointer to this collection by calling IXRTextBlock::GetInlines. Then, you can use the methods inherited from IXRCollection<In_T, Out_T> to add items, remove items, or retrieve items. You can also clear the complete collection by calling the inherited method IXRCollection<In_T, Out_T>::Clear.

You can also create a new inline collection. To do this, use the IXRApplication::CreateObject(IID,Object) method to create an empty IXRInlineCollection object. Then, you can use CreateObject to create multiple IXRInline objects that each define inline text content. Next, you can add each IXRInline object to the IXRInlineCollection by calling the inherited method IXRCollection<In_T, Out_T>::Add. And finally, you can set the new collection for an IXRTextBlock by calling IXRTextBlock::SetInlines.

In addition to the implicit collection syntax of InlineCollection, the TextBlock XAML element lets you specify content as inner text. Therefore, you can also set content by passing in a string to a call to IXRTextBlock::SetText. For more information, see IXRTextBlock.

Ee502128.collapse(en-US,WinEmbedded.60).gifXAML Usage

You can also create an inline collection in Microsoft Silverlight 2 XAML. For information about the differences between XAML in Silverlight for Windows Embedded and Silverlight 2, see Differences Between Silverlight for the Web and Silverlight for Windows Embedded. For more information about how to define this collection in the source XAML for your application, see this Microsoft Web site.

You cannot explicitly define an InlineCollection property element in XAML syntax, The XAML parser implicitly accesses a pre-existing IXRInlineCollection that is held by an IXRTextBlock. Then it adds any child elements found in the Inlines property to that existing collection.

In XAML, you include elements that represent one or more objects that derive from IXRInline, such as IXRRun and IXRLineBreak, as child elements of a TextBlock XAML element. The order of the Run and LineBreak XAML elements in the source XAML is significant because it defines the presentation order in which the elements are rendered in the text block. This is true also for the order of the IXRInlineCollection items if you access the collection items by using C++ code.

You do not have to specify a TextBlock.Inlines property element in XAML, because Inlines is the XAML content property for TextBlock.

Inheritance Hierarchy

IXRDependencyObject

    IXRCollection<In_T, Out_T>

        IXRInlineCollection

.NET Framework Equivalent

System.Windows.Documents.InlineCollection

Requirements

Header XamlRuntime.h
sysgen SYSGEN_XAML_RUNTIME
Windows Embedded CE Windows Embedded CE 6.0 R3

See Also

Reference

Classes for Collection Management