Windows Phone 7 tips (5)

Source: Internet
Author: User

1. Actions in Windows Phone 7 (Actions, triggers, and actions are collectively referred to as Actions)

Base Class Usage
Behavior <t> This is the simplest form of behavior in that it only exposes onattached and ondetaching methods that you can override. you 'd typically use these to wire up event handlers to the associatedobject (The XAML element that the behavior is attached ).
triggeraction one of the most common forms of behavior is the invocation of an action in response to an event. for example, you might want to navigate to a page when the user clicks a button. A triggeraction allows the designer to specify which event on the associated control the behavior shold observe. it then callthe overrideable invoke method whenever the event triggers.
Targettedtriggeraction <t> The last form of behavior is an extension of the triggeraction that allows the designer to specify the target element. within the invoke method you can reference the target element, which may not be the same element that the behavior is attached.

2. Enumeration value of orientation in Windows Phone 7

 

We can see the values of horizontal and vertical bars. You may wonder how the numbers are so irregular. Let's look at the binary values corresponding to these numbers.

 

Have you noticed that the lowest portrait-related values are 1?

3. For Windows Phone 7, horizontal or vertical la s must be considered during page layout design. Some orientation policies are: Fixed orientation, auto-layout, manual intervention, changing states, and smoothing transition.

4. In Windows Phone 7, click the soft Input Panel that pops up in the input box. We can use pause break to switch between the keyboard of the computer and the SIP.

5. The ApplicationBar exposes a statechanged event. In this event, you can check whether the ApplicationBar is displayed. Then, you can adjust the page layout.

6. In Windows Phone 7, the page layout can be as follows:

 

 7. Use VSM to jump to the specified state)

Visualstatemanager. gotostate (this. btntest, "pressed", true );

8. In Windows Phone 7, enableframeratecounter is monitoringProgramFrame Rate During Running

9. The templatevisualstate has a groupname attribute. The two statuses specified as the same name cannot reach the same value at the same time.

10. Differences between httpwebrequest and WebClient (from linzheng ):

1. httpwebrequest is an abstract class, so it cannot be new. You need to call httpwebrequest. Create ();
2. The method specifies the request type. Here, get and post are used. You can also specify the conenttype;
3. The requested URI must be an absolute address;
4. The request is asynchronous callback, starting from begingetresponse and specifying the callback method through asynccallback;
5. WebClient adopts the event-based asynchronous programming model. The WebClient callback triggered when an HTTP response is returned is called in the UI thread. Therefore, it can be used to update the attributes of the UI element, for example, bind the data in the HTTP Response to the specified control in the UI for display. Httpwebrequest is run based on background processes, and the callback is not a UI thread. Therefore, you cannot perform operations on the UI directly. Generally, dispatcher. begininvoke () is used to communicate with the interface.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.