July 2017
Beginner
466 pages
9h 37m
English
Sometimes it's required to define a collection of elements in the XAML. This is done using the Collection syntax to make it more readable. For example, a StackPanel can have multiple elements defined inside the Children property :
<StackPanel>
<StackPanel.Children>
<Button Content="1" />
<Button Content="2" />
</StackPanel.Children>
</StackPanel>
The preceding example can also be written as follows, where the parser knows how to create and assign it:
<StackPanel>
<Button Content="1" />
<Button Content="2" />
</StackPanel>
Read now
Unlock full access