Book Image

Windows Phone 7 Silverlight Cookbook

By : Jonathan Marbutt, Robb Schiefer
Book Image

Windows Phone 7 Silverlight Cookbook

By: Jonathan Marbutt, Robb Schiefer

Overview of this book

Silverlight has revolutionized development using Microsoft technologies. It is an excellent tool for mobile application development. The XAML-based markup and familiar C# code are the perfect combination for building apps efficiently and with minimum hassle.Packed full of recipes containing comprehensive instructions for the tasks required to build modern compelling smartphone apps using Silverlight.Starting with application design and architecture, you will quickly move on to more technical features and APIs you can implement to make your app stand out. You will use the Camera API to scan barcode, location services to pinpoint the user’s GPS coordinates and accelerometer to provide feedback based on movement of the phone. All of these features can be provided in a slick user interface through the power of Silverlight. Animations, behaviors and XAML provide all you need and more.
Table of Contents (18 chapters)
Windows Phone 7 Silverlight Cookbook
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Understanding basic behaviors


As we have seen with the events handler example, you can assign event handling logic through XAML to associate the event handler as well as the ability to do it in your code behind. In this example, we will cover a very similar type of thing but with only XAML and in Blend. We will repeat the exact same example but with behaviors.

Getting ready

We will need to create a Windows Phone application, but this time in Expression Blend for easier drag-and-drop capabilities. So let's create the project in Blend using the following screenshot as a reference:

How to do it...

Now that we have our basic application that we can use for a test bed to use some built in behaviors by using tools built into Blend.

  1. 1. Let's drag-and-drop both a button and a textblock onto the design surface. We will have something that looks like this:

  2. 2. Instead of adding an event handler to change the text block, we are going to use a simple behavior that is called ChangePropertyAction, and you can...