
TABLE 402
PROPERTY VALUE
Height
Auto
Orientation
Horizontal
Width
Auto
Add five
Image controls to the StackPanel.
Use the Properties window or the XAML code editor to give the
Image controls the property
values shown in Table 40-3:
TABLE 403
PROPERTY VALUE
HorizontalAlignment Center
Margin
4
Source
An appropriate picture
Stretch Uniform
VerticalAlignment Center
Width
100
Resize the
Window so it fits the images nicely.
Hints
Sometimes it’s easier to edit XAML code directly instead of using the designer to modify the
user interface. In this example, you can simply replace the Grid control with a StackPanel
in the XAML code if you like.
If you like, you can make a style to hold common properties.
Step-by-Step
The steps required for this Try It are all fairly straightforward exercises in using Visual Studio. If you
have trouble figuring out how to perform a step, skim this lesson again or watch the lesson’s screencast.
The basic steps are:
1. Create the new program.
2. Remove the initially created Grid control and replace it with a StackPanel. Set the
StackPanel’s properties. (In particular, set Orientation to Horizontal.)
596906c40.indd 459 4/7/10 12:35:21 PM