Logo
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
PREGNANCY
 
 
Windows Phone

Windows Phone 8 : Designing for the Phone - Blend Basics (part 4) - Working with Behaviors

4/24/2013 6:26:07 PM

4. Working with Behaviors

Although most of our discussion about design has focused on structure, some parts of a design should focus on performing actions. This is where behaviors come into play. A behavior is an object that can be activated based on an event in the design to perform some action. For example, you could have an animation fire when an item is acted upon. Figure 24 shows the various behaviors that ship with Blend.

Figure 24. Behaviors in the Assets panel

Image

Table 2 explains the built-in behaviors.

Table 2. Blend Behaviors

Image

To use behaviors, you simply drag them onto an object in the Objects and Timeline panel or onto the artboard. For example, if you drag a ControlStoryboardAction object onto the ellipse, it creates the new behavior on the ellipse, as shown in Figure 25.

Figure 25. Applying a behavior

Image

After the behavior is created, you’ll see the behavior properties in the Properties panel. The top half (the trigger) is where you can select the event that causes the behavior to fire. In this case we are executing it when the Tapped event is fired, which also happens when a user presses the screen of Windows Phone. The top half is the same for most behaviors.

The bottom half is different for different behaviors. In this case we are choosing what to do to a storyboard (for example, play, pause, and so on) and whichh storyboard to affect. The drop-down will show you all the animations you’ve created (as shown in Figure 26).

Figure 26. Changing behavior properties

Image

You can have multiple behaviors on objects in the Objects and Timeline panel. In fact, you can have multiple behaviors with the same trigger. You can see the behaviors directly in the object tree, as shown in Figure 27.

Figure 27. Multiple behaviors

Image

Behaviors do not replace the need for typical code, but they do represent a way to perform UI-specific operations (for example, actions). For instance, you might have a fly-out panel that is shown when a button is pressed. It is not necessary to get code involved to show and hide the panel because there is no logic in this operation. It’s purely a UI operation. Behaviors allow you to have XAML that represents a unit of the UI. Anytime you put real logic (for example, validation or other behavior) in the design, you’re probably making a mistake and should do that sort of work in code.

Other -----------------
- Windows Phone 8 : Designing for the Phone - Microsoft Expression Blend
- Windows Phone 7 Programming Model : Asynchronous Programming - Background Threads
- Windows Phone 8 : Designing for the Phone - Deciding on an Application Paradigm
- Windows Phone 8 : Designing for the Phone - The Third Screen
- Windows Phone 7 Programming Model : Web Browser Control
- Windows Phone 7 Programming Model : Tasks
- Windows Phone 7 Programming Model : Application Data Persistence
- Windows Phone 7 Programming Model : Device Information
- iphone Programming : Mixing OpenGL ES and UIKit, Rendering Confetti, Fireworks, and More: Point Sprites
- iphone Programming : Animation with Sprite Sheets, Image Composition and a Taste of Multitexturing
- XNA Game Studio 3.0 : Creating Game Components - Adding Game Sounds
- Iphone Application : Using Gesture Recognizers (part 4)
- Iphone Application : Using Gesture Recognizers (part 3)
- Iphone Application : Using Gesture Recognizers (part 2)
- Iphone Application : Using Gesture Recognizers (part 1)
- Handling Input on Windows Phone 7 : Microphone Input
- Handling Input on Windows Phone 7 : Accelerometer
- XNA Game Studio 4.0 : XNA Game Studio Storage (part 2) - Getting a Device
- XNA Game Studio 4.0 : XNA Game Studio Storage (part 1) - Recreating the Project on Xbox, Devices and Containers
- XNA Game Studio 4.0 : Storage - Isolated Storage
 
 
Most view of day
- Planning Deployment : Installing BDD 2007
- Troubleshooting Stop Messages : Common Stop Messages (part 1)
- Windows Server 2008 R2 : Creating and Administering Hyper-V Virtual Machines (part 1) - Virtual machine disk types
- Microsoft Visio 2010 : Working with Data - Creating Reports (part 1) - Introducing the Report Definition Wizard
- Windows Phone 8 : Working with File Explorer (part 2) - Removing Media from Your Phone
- Adobe Flash Catalyst CS5 : Convert Artwork to a Data List
- Editing Digital Video with Windows Live Movie Maker (part 6) - Editing Your Video - Trimming Video and Audio
- Sharing Your Computer with Others : Display User Accounts
- Microsoft Exchange Server 2007 : Consolidating a Windows 2000 Domain to a Windows Server 2003 Domain Using ADMT (part 4) - Migrating User Accounts
- Managing Client Protection : User Account Control (part 1) - UAC for Standard Users, UAC for Administrators
Top 10
- Integrating SharePoint 2013 with the Office Applications (part 10) - Microsoft Outlook - Lists and Libraries
- Integrating SharePoint 2013 with the Office Applications (part 9) - Microsoft InfoPath - Customizing the Document Information Panel and List Forms
- Integrating SharePoint 2013 with the Office Applications (part 8) - Microsoft InfoPath -Deploying a Form Via Central Administration, Rendering a Form Using the InfoPath Form Web Part
- Integrating SharePoint 2013 with the Office Applications (part 7) - Microsoft Access - Access Services
- Integrating SharePoint 2013 with the Office Applications (part 6) - Microsoft Access
- Integrating SharePoint 2013 with the Office Applications (part 5) - Microsoft OneNote
- Integrating SharePoint 2013 with the Office Applications (part 3) - Microsoft Excel
- Integrating SharePoint 2013 with the Office Applications (part 3) - Microsoft Excel
- Integrating SharePoint 2013 with the Office Applications (part 2) - Microsoft Word - Compare Document Versions, Quick Parts
- Integrating SharePoint 2013 with the Office Applications (part 1) - Microsoft Word - Writing Blog Posts
 
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro