Understanding Stack Panel Layout
1. Lays out element by stacking them one after the other.
2. Items can either be stacked vertically or horizontally.
3. By default items are stacked vertical.
4. Thus stack panel control is used in positioning control in either a row or column format.
5. They are mostly used to arrange a small subsection of UI.
Example of Stack Panel Layout
Note: By Default Items in Stack Panel are aligned Vertically
XAML Code:
<StackPanel>
<TextBlock Text="Stack Panel Demo"
FontSize="30" FontWeight="Bold"
Foreground="Red"/>
<TextBlock Text="QueryHome" FontSize="20" FontWeight="Bold" Height="70" />
<TextBlock Text="QueryHome" FontSize="25" FontWeight="Bold" Height="87" />
<TextBlock Text="QueryHome" FontSize="30" FontWeight="Bold" Height="104" />
</StackPanel>
OUTPUT: