Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Phone

Programming Windows Phone 7 : The Intricacies of Layout - Nested Panels

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
3/2/2011 10:56:26 PM
It’s possible to nest one StackPanel in another, which makes most sense if they’re of different orientations. Here’s a program with two verticals in one horizontal:
Example 1. Silverlight Project: StackPanelTable File: MainPage.xaml (excerpt)
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<StackPanel>
<TextBlock Text="Panel" FontWeight="Bold"
TextDecorations="Underline" />
<TextBlock Text="StackPanel" />
<TextBlock Text="Canvas" />
<TextBlock Text="Grid" />
</StackPanel>

<StackPanel Margin="12 0 0 0">
<TextBlock Text="Properties" FontWeight="Bold"
TextDecorations="Underline" />
<TextBlock Text="Orientation" />
<TextBlock Text="Left, Top, ZIndex" />
<TextBlock Text="RowDefinitions, ColumnDefinitions, etc" />
</StackPanel>
</StackPanel>
</Grid>

The single Margin setting serves to separate the two columns just a bit:



Notice that each vertical StackPanel is as wide as its widest child, and as tall as the sum of the heights of its children. The horizontal StackPanel is aligned in the center of the display and is as wide as the sum of its two children.

This is not the best way to make a table! It only seems to work reasonably well because the TextBlock elements are all of equal height. If they weren’t, then the rows would not line up as well as they do.

Other -----------------
- Programming Windows Phone 7 : The Intricacies of Layout - Text Concatenation with StackPanel
- Programming Windows Phone 7 : The Intricacies of Layout - The StackPanel Stack
- Programming Windows Phone 7 : The Intricacies of Layout - The Single-Cell Grid
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server