Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Phone

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

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
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
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server