Download Microsoft Silverlight 4 for Dummies (ISBN - 0470524650) PDF

TitleMicrosoft Silverlight 4 for Dummies (ISBN - 0470524650)
TagsFor Dummies
LanguageEnglish
File Size5.6 MB
Total Pages387
Table of Contents
                            Microsoft® Silverlight™ 4 For Dummies®
	About the Authors
	Dedication
	Acknowledgements
	Contents at a Glance
	Table of Contents
	Introduction
	Part I: Illuminating Silverlight
		Chapter 1: Adding Silverlight to Your Web Development Toolkit
			Obtaining and Running Silverlight
			Checking Out Some Silverlight-Enhanced Sites
			Grasping the Potential of Silverlight
			Hosting a Silverlight Application in a Web Page
			All the Stuff You Need to Create Silverlight Applications
			Creating Rich User Experiences in Silverlight
			Silverlight Plays Well with Others
			Silverlight Has More to Offer Than Just a Pretty Face
		Chapter 2: Getting Started in Silverlight
			Getting Started in Silverlight with Expression Blend
			Introducing the Basics of the Extensible Application Markup Language
			Firing Up Visual Studio to Create a Silverlight Application
			Using Expression Blend and Visual Studio in Tandem
		Chapter 3: Enhancing the User Interface
			Getting to Know the Properties Panel
			Drawing Shapes on the Artboard
			Shaping, Sizing, and Positioning Your Object
			Rotating, Projecting in 3-D, and Doing Other Funky Things with Shapes
			Painting Colors with Brushes in the Properties panel
			Playing Around with Some Special Effects
			Adding Video and Audio to Your Pages
	Part II: Managing Your Silverlight Controls
		Chapter 4: Working with Controls for UI Interactions
			Exploring the Text-Related Tools
			Using Buttons in Your Application
			Jumping to Another Web Page Using HyperlinkButton
			Using RadioButtons to Present Options
			Using the ListBox and ComboBox to present a large number of options
			Entering Rich Text into a RichTextBox Control
		Chapter 5: Laying Out Controls
			Understanding Layout Containers
			Laying Out Controls in Rows and Columns
			Stacking Controls Horizontally and Vertically
			Wrapping Controls
			Arranging Controls by Absolute Positioning Using the Canvas Control
			Using the ScrollViewer to Scroll Through the Contents
			Using the Viewbox to Fit the Contents Snugly
			Grouping Controls into a Tabbed Page
			Docking Controls
		Chapter 6: Styling and Skinning Controls
			Applying Styles to Controls
			Skinning a Control
			Using Themes to Change the Look of All Controls
		Chapter 7: Creating Your Own Controls
			Grouping Controls to Create a UserControl
			Creating a Smiley Custom Control
			Controlling the Behavior of Controls without Writing Code
		Chapter 8: Creating Animations in Silverlight
			Creating a Simple Bouncing Ball Animation
			Running the Animations You Create
			Animating States of Controls
		Chapter 9: Updating Data the Easy Way with Data Binding
			Binding Controls to Each Other
			Binding to a Data Object
			Binding to Sample Data
	Part III: Connecting with Data
		Chapter 10: Accessing Data in Silverlight
			Downloading Files to Your Silverlight Application
			Talking to Web Services
			Understanding Cross-Domain Security
			Authenticating Users
		Chapter 11: Using WCF Data Services to Store and Manage Data
			Getting Started with WCF Data Services
			What, Exactly, Is WCF Data Services?
			Creating a WCF Data Service
			Using the WCF Data Service in a Silverlight Application
			Handling Data Concurrency
			Using Query and Change Interceptors to Control Data Querying and Updates
			Controlling Access to Entity Sets
		Chapter 12: Using WCF RIA Services in Silverlight
			Getting Started with WCF RIA Services
			Authenticating Your Users
			Creating a Custom Authentication System
		Chapter 13: Accessing Data with WCF RIA Services
			Creating the Domain Data Service
			Writing Your Own Service Methods — LINQ to Entity Framework
			Writing Your Own Service Methods — LINQ to SQL
			Validating Data on the Client and Server Sides
			Securing Your WCF RIA Service
	Part IV: The Part of Tens
		Chapter 14: Ten Cool Controls for Collecting and Displaying Data
			ListBox
			DataGrid
			DataForm
			Expander
			Chart
			DatePicker
			ProgressBar
			TreeView
			Rating
			AutoCompleteBox
		Chapter 15: Ten Ways to Get More Out of Silverlight
			Using SketchFlow to Prototype Your Application
			Using Deep Zoom Composer
			Creating Designs Using Expression Design
			Importing Designs from Other Applications
			Creating Your Own Behaviors
			Running Silverlight Out of the Browser
			Calling Silverlight code via JavaScript
			Accessing HTML from Silverlight
			Storing Data Locally in the Client
		Chapter 16: Ten Handy Tips for Writing Silverlight Applications
			Resources about Silverlight Beyond This Book
			Ten Handy Expression Blend Shortcuts
			Ten Handy Visual Studio Shortcuts
			Debugging Silverlight Applications
			Looking Out for Performance Pitfalls
			Building for Accessibility
			Internationalization and Localization
			Build Composite Applications Using Prism
			Use the Model-View-ViewModel (MVVM) Pattern to Manage Large Applications
			Handy Tools
	Index
                        
Document Text Contents
Page 1

97804705246552999.eps


Mahesh Krishnan
Philip Beadle

Learn to:
• Develop seamless cross-platform,

cross-browser Web applications

• Design visually rich user interfaces
with ease

• Use Expression Blend™ and Visual
Studio® with Silverlight

• Deliver application data efficiently
with WCF RIA Services and ADO.NET

Silverlight


4
Making Everythin

g Easier!


Visit the companion Web site at www.dummies.com/go/

silverlight4fd to find all the code used in this book and

save yourself time and effort

Open the book and find:

• How Silverlight delivers a rich user
experience

• Clear examples of XAML

• Tips on drawing shapes and doing
animation

• Advice on the best tools to use
with Silverlight

• Effective ways to work with
controls

• How to customize controls and
create your own

• Ten ways to get more from
Silverlight

• How to connect to your data on
demand

Mahesh Krishnan develops Web applications using Microsoft technologies

and speaks regularly at conferences. He is very active within the .NET

and Silverlight communities. Philip Beadle is a Senior Developer at

DotNetNuke and speaks at numerous conferences. He is a coauthor of

DotNetNuke For Dummies and has contributed to other books. Both are

senior consultants at Readify.

$29.99 US / $35.99 CN / £21.99 UK

ISBN 978-0-470-52465-7

Technology/Graphics Programming

Go to Dummies.com®
for videos, step-by-step examples,

how-to articles, or to shop!

Make your rich Internet
applications shine on multiple
browsers and platforms
Silverlight makes stunning Web effects — animation,
streaming media, audiovisual playback — easier than you
could have imagined. Whether you’re new to Web design
or just to Silverlight, this book is packed with all the info you
need to start creating applications using Visual Studio and
Expression Blend.

• Getting started — find out what you need to get started with
Silverlight and download the necessary tools

• Gain control — style and manipulate Silverlight controls such as
text boxes and buttons, and create your own

• Make it move — enrich your user interface with animations that
upload fast and don’t devour bandwidth

• Stick things together — understand data binding and how it
supports your applications and streamlines programming

• Much ADO about data — work with ADO.NET Data Services and
WCF RIA Services to create versatile business applications

Krishnan
Beadle

spine=.768”

Microsoft
®

Silverlig
h

t
™ 4

M
icro

so
ft

®

Page 2

Mobile Apps

There’s a Dummies App for This and That
With more than 200 million books in print and over 1,600 unique
titles, Dummies is a global leader in how-to information. Now
you can get the same great Dummies information in an App. With
topics such as Wine, Spanish, Digital Photography, Certification,
and more, you’ll have instant access to the topics you need to
know in a format you can trust.

To get information on all our Dummies apps, visit the following:

www.Dummies.com/go/mobile from your computer.

www.Dummies.com/go/iphone/apps from your phone.

spine=.768”

Start with FREE Cheat Sheets
Cheat Sheets include
• Checklists
• Charts
• Common Instructions
• And Other Good Stuff!

Get Smart at Dummies.com
Dummies.com makes your life easier with 1,000s
of answers on everything from removing wallpaper
to using the latest version of Windows.

Check out our
• Videos
• Illustrated Articles
• Step-by-Step Instructions

Plus, each month you can win valuable prizes by entering
our Dummies.com sweepstakes. *

Want a weekly dose of Dummies? Sign up for Newsletters on
• Digital Photography
• Microsoft Windows & Office
• Personal Finance & Investing
• Health & Wellness
• Computing, iPods & Cell Phones
• eBay
• Internet
• Food, Home & Garden

Find out “HOW” at Dummies.com

*Sweepstakes not currently available in all countries; visit Dummies.com for official rules.

Get More and Do More at Dummies.com®

To access the Cheat Sheet created specifically for this book, go to
www.dummies.com/cheatsheet/silverlight4

www.dummies.com/cheatsheet/silverlight4
www.dummies.com
www.dummies.com
www.dummies.com
www.dummies.com
www.dummies.com

Page 193

175 Chapter 8: Creating Animations in Silverlight

Animating the ball
The Objects and Timeline panel contains a timeline on which you can define
keyframes. In Silverlight, a keyframe is the set of visual properties at a given
point in time.

You specify what these properties should be at specified time intervals, and
Silverlight automatically calculates and transitions the property values to
create an animation.

To create an animation of a bouncing ball, follow these steps:

1. Click the Selection tool from the Tools panel and click the ellipse you
just created (if you did the steps in the earlier section, “Create the ball
and set the timeline in motion”) to select it.

2. In the Objects and Timeline panel, click the Record Keyframe button
(shown here in the margin).

An oval appears in the timeline in the same row as the selected object.
The oval indicates that a keyframe has been created at that point in the
timeline.

3. To specify what the properties should be after a period of time — say,
four seconds — click 4 on the Objects and Timeline panel, as shown in
Figure 8-4.

This places a yellow line at the 4-second mark, as shown in Figure 8-4, and
you can now specify what the properties of the selected object should
be at the 4-second mark. You can not only change the properties via the
Properties panel but also manipulate the object directly on the Artboard.

4. Drag the ball to the right side of the screen boundary on the Artboard,
as shown in Figure 8-5.

Expression Blend automatically creates a keyframe for you at the
4-second mark and shows a dotted line to indicate the path in which the
ellipse will move.



Figure 8-4:
The

Objects and
Timeline

panel at the
4-second

mark.


13_524657-ch08.indd 17513_524657-ch08.indd 175 3/31/10 11:42 AM3/31/10 11:42 AM

Page 194

176 Part II: Managing Your Silverlight Controls



Figure 8-5:
The ball

moved to
the right

side of the
screen
during

animation.


5. Now click the 6-second mark in the Objects and Timeline panel and
move the ball to the left side to mimic a bounce motion.

Expression Blend creates another keyframe at the 6-second mark and
visually shows the bouncing path of the ball. You can also manipulate
the height and width of the button at these keyframes to simulate the
ball’s getting compressed at the point of impact, or you can do other
funky things such as change the fill brush at different keyframes to ani-
mate the changing of colors.

6. Click the Play button in the Objects and Timeline panel to see a pre-
view of the animation.

The animation gets played and the ball appears to fall down, bounce,
and go up again.

One thing to keep in mind as you watch the animation is that you created
just two keyframes — one at the 4-second mark and the other at the 6-second
mark; Silverlight takes care of the rest by automatically calculating the posi-
tion (and possibly other property values) of the control for the time between
these keyframes.

You can experiment further by adding keyframes and changing more proper-
ties to see how these properties are animated.

13_524657-ch08.indd 17613_524657-ch08.indd 176 3/31/10 11:42 AM3/31/10 11:42 AM

Page 386

Mobile Apps

There’s a Dummies App for This and That
With more than 200 million books in print and over 1,600 unique
titles, Dummies is a global leader in how-to information. Now
you can get the same great Dummies information in an App. With
topics such as Wine, Spanish, Digital Photography, Certification,
and more, you’ll have instant access to the topics you need to
know in a format you can trust.

To get information on all our Dummies apps, visit the following:

www.Dummies.com/go/mobile from your computer.

www.Dummies.com/go/iphone/apps from your phone.

spine=.768”

Start with FREE Cheat Sheets
Cheat Sheets include
• Checklists
• Charts
• Common Instructions
• And Other Good Stuff!

Get Smart at Dummies.com
Dummies.com makes your life easier with 1,000s
of answers on everything from removing wallpaper
to using the latest version of Windows.

Check out our
• Videos
• Illustrated Articles
• Step-by-Step Instructions

Plus, each month you can win valuable prizes by entering
our Dummies.com sweepstakes. *

Want a weekly dose of Dummies? Sign up for Newsletters on
• Digital Photography
• Microsoft Windows & Office
• Personal Finance & Investing
• Health & Wellness
• Computing, iPods & Cell Phones
• eBay
• Internet
• Food, Home & Garden

Find out “HOW” at Dummies.com

*Sweepstakes not currently available in all countries; visit Dummies.com for official rules.

Get More and Do More at Dummies.com®

To access the Cheat Sheet created specifically for this book, go to
www.dummies.com/cheatsheet/silverlight4

www.dummies.com/go/mobile
www.dummies.com/go/iphone/apps

Page 387

97804705246552999.eps


Mahesh Krishnan
Philip Beadle

Learn to:
• Develop seamless cross-platform,

cross-browser Web applications

• Design visually rich user interfaces
with ease

• Use Expression Blend™ and Visual
Studio® with Silverlight

• Deliver application data efficiently
with WCF RIA Services and ADO.NET

Silverlight


4
Making Everythin

g Easier!


Visit the companion Web site at www.dummies.com/go/

silverlight4fd to find all the code used in this book and

save yourself time and effort

Open the book and find:

• How Silverlight delivers a rich user
experience

• Clear examples of XAML

• Tips on drawing shapes and doing
animation

• Advice on the best tools to use
with Silverlight

• Effective ways to work with
controls

• How to customize controls and
create your own

• Ten ways to get more from
Silverlight

• How to connect to your data on
demand

Mahesh Krishnan develops Web applications using Microsoft technologies

and speaks regularly at conferences. He is very active within the .NET

and Silverlight communities. Philip Beadle is a Senior Developer at

DotNetNuke and speaks at numerous conferences. He is a coauthor of

DotNetNuke For Dummies and has contributed to other books. Both are

senior consultants at Readify.

$29.99 US / $35.99 CN / £21.99 UK

ISBN 978-0-470-52465-7

Technology/Graphics Programming

Go to Dummies.com®
for videos, step-by-step examples,

how-to articles, or to shop!

Make your rich Internet
applications shine on multiple
browsers and platforms
Silverlight makes stunning Web effects — animation,
streaming media, audiovisual playback — easier than you
could have imagined. Whether you’re new to Web design
or just to Silverlight, this book is packed with all the info you
need to start creating applications using Visual Studio and
Expression Blend.

• Getting started — find out what you need to get started with
Silverlight and download the necessary tools

• Gain control — style and manipulate Silverlight controls such as
text boxes and buttons, and create your own

• Make it move — enrich your user interface with animations that
upload fast and don’t devour bandwidth

• Stick things together — understand data binding and how it
supports your applications and streamlines programming

• Much ADO about data — work with ADO.NET Data Services and
WCF RIA Services to create versatile business applications

Krishnan
Beadle

spine=.768”

Microsoft
®

Silverlig
h

t
™ 4

M
icro

so
ft

®

www.dummies.com
www.dummies.com/go/silverlight4fd
www.dummies.com/go/silverlight4fd

Similer Documents