Skip to main content

2010 | Buch

Foundation Expression Blend 4 with Silverlight

verfasst von: Victor Gaudioso

herausgegeben von: Tracy Brown, Ben Renow-Clarke, Corbin Collins, Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Duncan Parkes, Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Dominic Shakeshaft, Matt Wade, Tom Welsh

Verlag: Apress

insite
SUCHEN

Über dieses Buch

Foundation Expression Blend 4 with Silverlight takes you through your first steps in creating rich Internet applications (RIAs) using the latest release of Microsoft’s technology. You’ll explore features such as custom user controls that you can reuse throughout your projects and the media element that allows you to easily add sound and video to your applications. Silverlight 4 enables you to rapidly develop compelling, cross-platform RIAs using the extensive .NET 4 libraries, the powerful, design friendly Blend 4 integrated development environment (IDE), and an enhanced workflow that allows designers and developers to work on the same set of files at the same time. At the end, you’ll put everything you have learned together to create a sample Silverlight 4 website.

Whether you’re an experienced .NET or web developer, or you’re just starting out, this book will provide you with all you need to create RIAs with Expression Blend 4.

Develop stunning RIAs in a short time using Blend 4 and Silverlight 4. Learn basic object-oriented programming principles. Get familiar with the Blend 4 development environment.

Inhaltsverzeichnis

Frontmatter
Chapter 1. Setting Up the Silverlight Development Environment
Abstract
Start by opening a web browser and navigating to http://silverlight.net/getstarted/. On the right side of the page you will see the Install Silverlight Runtime box. On the left side of the page, you will see a Start Learning Silverlight section. This contains videos, blogs, and tutorials that you will find helpful to return to and click through when you have some free time later. Particularly I encourage you to take advantage of the very good “how to” videos by Microsoft greats Tim Heuer, Adam Kinney, and Jesse Liberty. I myself took advantage of these videos when first starting with Silverlight 4 in November 2007 when it was still known as WPF/E (short for Windows Presentation Foundation Everywhere). That being said, let’s move on and start to install the tools we need to begin developing in Silverlight.
Victor Gaudioso
Chapter 2. The Blend Integrated Development Environment
Abstract
Now that you have your development environment set up and have had a taste of how fun and easy it is to create a cool-looking and interactive Silverlight application, we can take a step back, get to the basics, and discuss some of the major features of the Blend 4 integrated development environment (IDE). As we proceed, I will explain each major feature and then task you with little exercises to help you to familiarize yourself with these tools and features. Some of these tools and features I will discuss briefly here and in more depth in later chapters. Before we get started, I want to provide you with a quick list of features brand new to Blend 4.
Victor Gaudioso
Chapter 3. C#, XAML, and Object-Oriented Programming
Abstract
In this chapter, I am give an overview of the programming languages C# and XAML (Extensible Application Markup Language). I will give you a little bit of background on the origins of each language and then explain in more detail how they interact to create Silverlight applications. Finally, I have you create a new Silverlight application, and you do a little bit of basic Object-Oriented Programming (OOP). So with that, let’s get started and discuss the very robust language known as C# (pronounced see-sharp).
Victor Gaudioso
Chapter 4. Layout Controls: Including the New Silverlight 4 Controls: Viewbox, RichTextBox, FlowDirection Property, and Improved Data Binding
Abstract
As discussed in the previous chapter, layout controls (or layout elements as they are sometimes called) are a very important part of Silverlight, allowing you to arrange your content in your applications. Here I go over the most popular ones and the properties that make them unique. Then I over some new controls that have been added in Silverlight 4.
Victor Gaudioso
Chapter 5. Timed Storyboards: Creating a Newton Cradle Application
Abstract
You can use Storyboards to create all types of interactions with your user. For example, recently I made an information dropdown for a client. The dropdown had a paragraph or two of information, but the client didn’t want all the information to be displayed unless the user was interested in reading it. So we decided to put in a More Information button that when clicked would turn the snippet of information into the full paragraphs. Further, the dropdown itself had to grow in size to be able to fit all of the new information. To do this I created two Storyboards, one named ShowMoreInfoSB (SB standing for Storyboard) and ShowLessInfoSB. In the ShowMoreInfoSB Storyboard I made the TextBlock containing the information grow to show all of its text and made the dropdown background longer so the information would not extend pass the dropdown. I did the opposite for the ShowLessInfoSB. When the More Information button was clicked, I toggled between firing off one of the two Storyboards. The control worked as designed, and I had a very happy client.
Victor Gaudioso
Chapter 6. Using VSM and Blend 4’s State Panel to Create a Silverlight Media Player
Abstract
Silverlight 2 saw the addition of something called the Visual State Manager (VSM) that allows you to easily add States to any UIElement such as a Button, Rectangle, Ellipse, or even an entire UserControl. You can, of course, do this in code-behind, but it would be very tedious. For that reason Microsoft introduced the States panel. The States panel allows you to very easily and very quickly create States. Then all you need to do is wire up those States using Behaviors to trigger them in XAML with no codebehind whatsoever.
Victor Gaudioso
Chapter 7. Behaviors in Silverlight
Abstract
Behaviors were introduced with Blend 3 and have become an integral part of Silverlight development. Prior to Behaviors a developer or designer would have to switch over to Visual Studio to do things like control a MediaElement, hook up a Visual State of a Visual State Group, make an object draggable, change a property on the fly, or start a Storyboard. With the addition of Behaviors, that all changed. Now developers and designers can perform these actions by simply dragging a Behavior from the Asset Library right onto objects in either the artboard or the Objects and Timeline panel.
Victor Gaudioso
Chapter 8. The Silverlight MediaElement: Create a Video Player with a Custom UserControl, XML De-serialization, and Behaviors
Abstract
Because Silverlight 4 was designed to develop rich Internet applications (RIAs) with lots of embedded media such as video and audio, the MediaElement is a very important and useful tool, so I have decided to dedicate an entire chapter to it. The Silverlight MediaElement is a rectangular UserControl that can be used to play audio or video. In the current version of Silverlight, the MediaElement supports the following types of media
Victor Gaudioso
Chapter 9. Events and EventHandlers
Abstract
Most Silverlight objects have a set of events that fire when users interact with them. You have already seen some events in earlier chapters. You also know that any method or function that is called when an event is fired is called an EventHandler. In this chapter I discuss the many different events that objects have, from the Click event to the new Silverlight 4 MouseWheel event. You are going to create EventHandlers for all these different events as well, so let’s get started and create a new Silverlight project.
Victor Gaudioso
Chapter 10. Classes and Interfaces
Abstract
As I briefly discuss in Chapter 3, classes are a very important construct of Object-Oriented Programming and can be considered a blueprint for creating objects. Further, these classes encapsulate State and Behavior. Behavior is encapsulated into methods (sometimes referred to as functions), and State is encapsulated in data placeholders called member variables, also known as properties. There are different types of classes, and we will go over many of them in this chapter. Similar to classes are an Object- Oriented Programming construct called interfaces. I show you how you can use interfaces in order to create polymorphic classes. Finally I show you a typical scenario in which one would want to re-factor behaviors into a separate class object.
Victor Gaudioso
Chapter 11. Styles, Control Templates, and Custom UserControls
Abstract
A very important concept in Object-Oriented Programming (OOP) is that you should be able to create something once and use it over and over again. This generally means that you can reuse a Resource in one application, but Silverlight takes this concept even further and allows you to reuse a Resource across multiple applications. Styles, ControlTemplates, and UserControls allow you to do just that. I have been working with Silverlight since before it was officially released some years ago, and in that time I have been able to create my own libraries of Resources that I can now reuse in new applications that I create. This allows me to develop new applications faster because I do not have to create new Resources every time I need them. For example, say I have an application that requires a good video player. All I need to do it is to add the reference to my already existing video player in my new application, and voilà! I have a video player in my new application. In this chapter you are going to create a Style for a Silverlight Button that will contain a ControlTemplate that has the Button display an Image control. You are then going to create a Resource Dictionary and move the Button Style to it. Finally, you are going to take everything you have learned and create a custom UserControl.
Victor Gaudioso
Chapter 12. Writing a Custom Content Panel
Abstract
Recently I was tasked with creating an image viewer that held thumbnails of lots of images. The problem was that I had to at least partially show all the thumbnail images that were all held in an ObservableCollection. Further, because the images were held in an ObservableCollection of data, I could never know how many images would be in the collection at any one time. For this reason, it was an obvious choice to put the thumbnails into a StackPanel and let the StackPanel arrange its children.
Victor Gaudioso
Chapter 13. Writing ailverlight 4 Out-Of-Browser Application with Elevated Trust and the New Silverlight 4 COM API
Abstract
With Silverlight 4 it is very easy to make a normal online application or an Out-Of-Browser (OOB) application. Out-Of-Browser applications, as the name implies, allow your applications to be detached from the browser and run just like any other desktop application. Further, you can make a Silverlight application require Elevated Trust when running outside the browser. When this option is selected, your applications can do some very cool things which Silverlight applications without Elevated Trust cannot do. Here are some special things that Silverlight OOB applications running with Elevated Trust can do
Victor Gaudioso
Chapter 14. Creating a Photobooth Application with the Silverlight 4 Webcam API
Abstract
With the release of Silverlight 4, it is now easy to incorporate rich content such as webcam video right into your Silverlight applications. Prior to the release of Silverlight 4, doing this was a very difficult task because of the security restrictions in place and wasn’t possible at all without circumventing that security via some serious and hacking (bad practice).
Victor Gaudioso
Chapter 15. MVVM: Model-View-ViewModel
Abstract
The goal for this chapter is to provide an overview of MVVM and what new features in Blend 4 have been added to support developing applications using this software pattern. I first take a brief look at what a software pattern is and why it is useful. I then create a small sample application, leveraging the new project template and further clarifying the MVVM concept.
Victor Gaudioso
Chapter 16. SketchFlow Prototyping
Abstract
SketchFlow prototyping is a way for you to create an interactive version of an application that is meant to demonstrate the intended interaction, design intent, and screenflow. This SketchFlow prototype can then be delivered to the client for immediate feedback that can be integrated directly into the prototype and seen by the developer. This prototype can be made very quickly and easily in Blend 4 and thus is costeffective. This prototype is then used by the designers and developers as a roadmap for the application. Further, assets and/or functionality created in the prototype can be used in the actual application. To better illustrate what SketchFlow prototyping is, I lead you through an exercise that will show you how to build an application prototype. With that, let’s fire up Blend 4 and create a new SketchFlow prototype for a web application for a shopping web site.
Victor Gaudioso
Chapter 17. New Features of Silverlight 4
Abstract
In this book I have thus far covered many new features of Silverlight 4. Some of the features we have covered up until now are the COM API, Out-Of-Browser Experience, and the Webcam API, among others. However, this is just a fraction of the numerous new features of Silverlight 4. For this reason I wanted to dedicate a chapter to at least mention all of the new features of Silverlight 4. In this chapter I talk about all the new features of Silverlight 4 that I haven’t mentioned yet. I go over some of these features in depth, while just touching upon other, less important features. Let’s start off with the newly added mouse wheel and right-click support.
Victor Gaudioso
Backmatter
Metadaten
Titel
Foundation Expression Blend 4 with Silverlight
verfasst von
Victor Gaudioso
herausgegeben von
Tracy Brown
Ben Renow-Clarke
Corbin Collins
Clay Andres
Steve Anglin
Mark Beckner
Ewan Buckingham
Gary Cornell
Jonathan Gennick
Jonathan Hassell
Michelle Lowman
Matthew Moodie
Duncan Parkes
Jeffrey Pepper
Frank Pohlmann
Douglas Pundick
Dominic Shakeshaft
Matt Wade
Tom Welsh
Copyright-Jahr
2010
Verlag
Apress
Electronic ISBN
978-1-4302-2974-2
Print ISBN
978-1-4302-2973-5
DOI
https://doi.org/10.1007/978-1-4302-2974-2