July 2017
Beginner
466 pages
9h 37m
English
An XAML element can have content within it. It can be set as the value of child elements of root. Refer to the following code blocks. The first example shows how to set the text content property of a button instead of specifying it in an attribute syntax (<Button Content="Click Here" />):
<Button>
<Button.Content>
Click Here
</Button.Content>
</Button>
In the following example, when the Button element is wrapped by a Border panel, it is defined as element content of the said panel and omits the explicit definition of the content property:
<Border>
<Button Content="Click Here" />
</Border>
The preceding code can be rewritten with a Content property (Border.Child) having a single element in it:
<Border> <Border.Child> <Button ...
Read now
Unlock full access