Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Copy the program you built for this lesson's Try It and replace the StackPanel with a WrapPanel. (Hint: Instead of removing the StackPanel and all the controls that it contains and then rebuilding everything inside a WrapPanel, edit the XAML code and replace the StackPanel element with a WrapPanel element. Be sure to also change the closing </StackPanel> tag.) Run the program and see what happens if you make the program's window taller and narrower.
Make the program shown in Figure 40-5. Replace the initially created Grid with a UniformGrid. Set the new control's Rows property to 2 and its Columns property to 3.
Add a button to the UniformGrid. Then add a LayoutTransform property to it as shown in the following code:
<Button Content="Switch User" Height="23" Width="75">
<Button.LayoutTransform>
<RotateTransform Angle="-20"/>
</Button.LayoutTransform>
</Button>Copy and paste this button several times and edit each button's Content property to determine the text it displays.
If you like, experiment with the UniformGrid's background brush and move common properties into a style.
NOTE
You can download the solutions to these exercises from the book's web page at www.wrox.com or www.CSharpHelper.com/24hour.html. You can find them in the Lesson40 folder of the download.