The Content Property
Many classes designed to be used in XAML designate a property (via a custom attribute) that should be set to whatever content is inside the XML element. This property is called the content property, and it is just a convenient shortcut to make the XAML representation more compact.
Button
’s Content
property is (appropriately) given this special designation, so the following Button
:
<Button xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Content="Stop"/>
could be rewritten as follows:
<Button xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> Stop </Button>
Or, more usefully, this Button
with more complex content:
Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.