Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Windows Phone 7 Silverlight Cookbook
Windows Phone 7 Silverlight Cookbook

Windows Phone 7 Silverlight Cookbook: All the recipes you need to start creating apps and making money.

Arrow left icon
Profile Icon Jonathan Marbutt Profile Icon Robb Schiefer
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3 (4 Ratings)
Paperback Aug 2011 304 pages 1st Edition
eBook
$28.99 $32.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Jonathan Marbutt Profile Icon Robb Schiefer
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3 (4 Ratings)
Paperback Aug 2011 304 pages 1st Edition
eBook
$28.99 $32.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$28.99 $32.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Windows Phone 7 Silverlight Cookbook

Chapter 2. Creating Animation

In this chapter, we will cover:

  • Using ViewStateManager to create simple animations

  • The basics of timelines

  • Using timelines that change based on user interaction

Introduction


As we have seen in Chapter 1, Microsoft has provided a rich set of tools for creating Windows Phone applications and this chapter will take us beyond simply laying out controls by adding animation. For many developers, animation is an afterthought, but it can be an important part of any application, especially a Windows Phone 7 application by conveying the status of the application and things like loading, waiting, and connection status. Because of the disconnected nature of a Windows Phone 7 application when building applications that connect to services on the Internet, these connections may be slower than usual where the user is located.

Also, as animations become a more important part of our applications, it is a necessity for both developers and designers to have an understanding of how animations work, specifically on the windows phone. In this chapter, we will work entirely in Expression Blend to create our animations. This is due to the fact that Visual Studio does not...

Using ViewStateManager to create simple animations


As we have seen in the previous chapter, ViewStateManager allows us to create some simple animations. Now we want to take things a lot further by adding various animations to one control. We will be adding some simple animations to a list box to provide a much customized look and feel.

We will also begin to customize various levels of templates on a few controls to create something that doesn't even look remotely like the standard control.

Getting ready

Let's start by opening Expression Blend and creating a new Windows Phone Application. The other thing we want to go ahead and do is create some sample data for the project to simulate this application actually having some real world data in it. You can do this by navigating to the Data tab, clicking the first button with the plus sign, and then selecting New Sample Data. When it prompts you for the Data Source Name, simply set it to MySampleData:

Once you have created your sample data source...

The basics of timelines


While ViewStateManager is an outstanding way to create simple transitions for controls based on the current state of the control, sometimes you actually need more traditional animation techniques. If you have ever created a Flash application, then this will be very similar to what you are used to.

In this example, we will create a simple animation that will demonstrate animating various properties including position and brush settings. We will just be creating a simple one that could represent a loading animation.

Getting ready

To get started we simply need to open Expression Blend and start a new Windows Phone application. This will be our foundation for animation.

How to do it...

Create a circle in each corner of the screen as follows:

We are now going to animate each circle to move from one corner to the other.

  1. 1. To begin, let's create a blank storyboard by clicking on the plus sign in the Objects and Timeline window. As you will notice, this layout isn't ideal for...

Using timelines for feedback to users


As we have seen so far, animations are a simple way of adding some visual interest to your application. But we have only seen so far the ability to add animations in a non-user driven animation. With any application, most animations are going to be user driven or respond to users.

In this example, we will take our previous example on a timeline and another sample timeline and place buttons to react to each button.

Getting ready

Since we are using the existing timeline example, we are going to simply expand it by adding an additional storyboard that we can swap between. Open the existing application and go to your objects and timeline window. Click the plus button to add an additional storyboard.

This additional storyboard will be used to flip the individual circles using projection. Select all four circles and insert a keyframe at the zero timeframe and another keyframe at two second timeframe. While on the two second time slot, set the Projection settings...

Left arrow icon Right arrow icon

Key benefits

  • Build sophisticated Windows Phone apps with clean, optimized code.
  • Perform easy to follow recipes to create practical apps.
  • Master the entire workflow from designing your app to publishing it.

Description

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.

Who is this book for?

All levels of developers and designers will be able to utilize this book. The language and examples are written for beginners but there are plenty of deeper concepts to explore and code to master.

What you will learn

  • Use XAML and Blend along with animations to bring your user interfaces to life.
  • Utilize web services for all your data needs.
  • Learn how the process of sending Push notifications to users saves time and battery
  • Take the power of touch to a whole new level by creating unique touch gestures for your app.
  • Generate revenue and share your app with the world through the Windows Phone marketplace.

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Aug 25, 2011
Length: 304 pages
Edition : 1st
Language : English
ISBN-13 : 9781849691161
Vendor :
Microsoft
Category :
Languages :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Aug 25, 2011
Length: 304 pages
Edition : 1st
Language : English
ISBN-13 : 9781849691161
Vendor :
Microsoft
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 120.97
Windows Phone 7.5: Building Location-aware Applications
$21.99
Windows Phone 7 Silverlight Cookbook
$54.99
Windows Phone 7.5 Data Cookbook
$43.99
Total $ 120.97 Stars icon

Table of Contents

10 Chapters
Layout and Design Chevron down icon Chevron up icon
Creating Animation Chevron down icon Chevron up icon
Behaviors and Events Chevron down icon Chevron up icon
DataBinding 101/MVVM Chevron down icon Chevron up icon
Services, Data, and RSS Chevron down icon Chevron up icon
Location Services Chevron down icon Chevron up icon
Push Notifications to the Phone Chevron down icon Chevron up icon
Launchers and Choosers Chevron down icon Chevron up icon
Sensing with Sensors Chevron down icon Chevron up icon
Preparing Apps for the Marketplace Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3
(4 Ratings)
5 star 50%
4 star 25%
3 star 25%
2 star 0%
1 star 0%
P. Shrestha Apr 26, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I am a beginner in WP7 development. This book has helped me understand the basics with good step by step examples and recepies. I am reading this book and I am loving it. This book is a must for all WP7 beginners.
Amazon Verified review Amazon
Steve G Jan 19, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Having already written a couple of WP7 applications, I was after a book that didn't just concentrate on the general out the box WP7 features, books like those are one a penny, whereas where this book stood out for me was in the authors' abilities to include external components. For example there is a recipe on scanning barcodes using the camera, and converting the image to a numeric format. I wanted a book that could add that extra wow to my applications and this book certainly enables me to do that.The book has a great layout which takes a novice Windows Phone 7.0 developer from the basics of what is needed to get started, through laying out controls and animation, to Data binding and the MVVM Pattern followed by using the GPS, Push Notifications, Camera usage and concludes with a great chapter on publishing your application to the marketplace.One of the things I really liked about this book is the authors' take the reader out of Visual Studio and into Expression Blend at appropriate times and show off what Expression Blend is good at. The majority of the first three chapters are completed inside Expression Blend, showing off the power of animation events and behaviours whilst writing very little code.Another feature I liked was the authors' built up an application through several chapters, explaining to the reader how making certain design decision will affect the end user experience, for instance using an excessive amount of battery power. In the final chapter the authors' talk about submitting the application to the market place, walking the reader through the gotcha's of submission and explaining the unique trail version that is supported by Windows Phone.At the end of each recipe the book clearly explains how each application works and also provides links to other sites for additional learning. I thought this was a great idea as it allows the reader to further their learning.The authors' also explained issues with some of the out-the-box Microsoft controls, and provided the reader with good examples of how they could work around the problems and avoid the pitfalls.I would highly recommend this book to anyone starting out writing any Windows Phone 7.0 applications and WANT to get them published in the Windows Phone Market Place. Or to anyone who has experience of publishing applications but wants to broaden their horizons on third party controls and pick up some great advice on the way.
Amazon Verified review Amazon
Gifford Haynes Jan 11, 2012
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
I have finished two-thirds of the book and it has been great. I have a few applications in the WP7 Marketplace already, but I find this book to good place for new comers to WP7 development. It is well written, and the code is Marketplace ready. The negative I found is that there are a few typos and obvious misprints. Overall, I would recommend this book to any new WP7 dev.
Amazon Verified review Amazon
NJ Walters Oct 13, 2013
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Some good techniques shown, but tends to focus on use of blend rather than C#. Built several of the applications shown - but on several occasions, tried to compile only to find solution needed a 3rd party addition, without details of where to get it! Got frustrated with missing info after 3rd example and bought another book.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.