Book Image

Blend for Visual Studio 2012 by Example: Beginner's Guide

By : Abhishek Shukla
Book Image

Blend for Visual Studio 2012 by Example: Beginner's Guide

By: Abhishek Shukla

Overview of this book

<p>Creating applications with compelling graphics has been one of the main goals of client applications, and with the arrival of WPF, Silverlight, and HTML5 it is much easier than ever before to create interactive and rich user interfaces.</p> <p>Blend for Visual Studio 2012 by Example Beginner's Guide will give you a good grounding in creating Windows, Web, and Windows Phone applications. You will also look at the various layouts and controls available in Blend and how we can create animations and behaviors in Blend.</p> <p>Towards the end, you will be aware of the various capabilities that are available in Blend out of the box.</p>
Table of Contents (19 chapters)
Blend for Visual Studio 2012 by Example Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – using StackPanel


We will add a few buttons to StackPanel and learn how StackPanel works:

  1. To see how it works, let's go ahead and add a new window to our project, and let's name it StackPanelLayout.xaml. Go to the Assets panel and search for StackPanel. Then, drag and drop it onto LayoutRoot.

  2. Now, search for the buttons in the Assets panel, and drop three of them onto StackPanel. You will see that, as you add these buttons onto StackPanel, they are added vertically one after another. You can set a height, width, and color for these buttons. Make sure that your code looks similar to the one shown in the following screenshot:

  3. We can also arrange the elements with StackPanel horizontally by setting the Orientation property of StackPanel to Horizontal, as shown here:

What just happened?

We saw how StackPanel behaves and how we can use it. We also had a look at the orientation property of the StackPanel.