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 - DataBinding to one's own property


In this section, we will DataBind one property of the Rectangle shape to another one as follows:

  1. Create a new project in Blend and name it Chapter07. Drag and drop a Rectangle shape onto the art board. This is shown in the following screenshot:

  2. Now, we will go ahead and DataBind the Height property of the rectangle to itself. The way to assign the source property in DataBinding is to assign the source of the property and the property path. To do that, move to the Properties panel, left-click on the small white rectangle next to the Height property, and then select Create Data Binding…. This is shown in the following screenshot:

  3. Now, select the binding type as RelativeSource Self as we want to bind the rectangle with a property of its own. We will see a list of properties that the Height property can be bound to. Select Width: (Double) and click on OK. The following screenshot encapsulates this discussion:

  4. Once we do that, we will see that the...