O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Type Conversion of an Element’s Contents

Chapter 2, “Child Elements and Keywords,” listed three types of children for an object element: a value for a content property, collection items, and a value that can be type-converted to the object element. It’s now time to look at the third type of child.

Plain text can often be used as the child of an object element, as in the following XAML declaration of SolidColorBrush:

<SolidColorBrush>White</SolidColorBrush>

This is equivalent to the following:

<SolidColorBrush Color="White"/>

This seems normal, until you realize that Color has not been designated as SolidColorBrush’s content property. It has no content property. In this case, the first ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required