Cultivation of Windows Phone development: tip and skills

Source: Internet
Author: User

In blend, right-click phoneapplicationpage to add applicationbariconbutton. Select the desired button icon from the iconuri drop-down list.

In blend, right-click the text control, select Edit style, and click "Application resource" to select the built-in style.

You can right-click a control and select a page in the "navigation" project from the shortcut menu.

Textbox can specify the inputscope attribute to specify the type of data you want to enter. Different software disks are displayed on the mobile phone screen. The inputscopenamevalue enumeration in the system. Windows. Input namespace defines all the inputscope attributes that can be set.

<Application
X: class = "phoneapp7.app"
Xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml"
Xmlns: Phone = "CLR-namespace: Microsoft. Phone. controls; Assembly = Microsoft. Phone"
Xmlns: shell = "CLR-namespace: Microsoft. Phone. Shell; Assembly = Microsoft. Phone">

<! -- ApplicationProgramResource -->
<Application. Resources>
</Application. Resources>

<Application. applicationlifetimeobjects>
<! -- Objects required to process the Lifetime Events of an Application -->
<Shell: phoneapplicationservice
Launching = "application_launching" Closing = "application_closing"
Activated = "application_activated" Deactivated = "application_deactivated"/>
</Application. applicationlifetimeobjects>

</Application>
This is app. XAML.CodeThe main function is to initialize the applicationlifetimeobject attribute of the application and create a phoneapplicationservice object. The phoneapplicationservice class provides access to applications in different stages of life, including management of idle applications and Management of applications when they are in a valid or invalid state.

The rootframe attribute of the application class is the startup page that identifies the application. All winphone applications have a top-level window design element whose data type is phoneapplicationframe. This framework
It carries one or more phoneapplicationpage elements used to identify the application content, and also serves to process navigation switching between different pages.

 

Developers can process three different Manipulation events in the SL application to respond to single-point and multi-point touch, so as to move and scale objects. The three events are as follows:
1 \ manipulationstarted: this event is triggered when you touch the screen with one or more fingers.
2. manipulationdelta: this event is repeatedly triggered when one or more fingers move on the screen.
3. manipulationcompleted: this event is triggered when one or more fingers exit the screen.

 

Tip: When debugging an application in the simulator, you can use the computer keyboard for input. You can use the pause/Break Key or the Pageup/Pagedown key to switch between the screen virtual keyboard and the computer keyboard. After the input is switched to the computer keyboard, the mobile phone goes back and starts to search for three buttons, which are simulated using F1, F2, and F3.

When the application instantly changes to the background, it enters the sleep state. The application state can be saved to the State member attribute of the phoneapplicationservice class in the Microsoft. Phone. Shell namespace. When the application is sleep, the instant state in the state is saved to the memory by the operating system. When dormant applications recover, the operating system restores the content in the state to the state before hibernation. The State content is always stored in the memory, so the access speed is much faster than the permanent data stored in the independent external store. However, the instantaneous state in state is valid only when the application is sleeping. Once a dormant application is closed or a new instance is started, the State contains different data. If the sleep program occupies the resources required by the system, the sleep application is closed and the Instantaneous State stored in the state is released.

WP7 application lifecycle: launching, closing, deactivated, and activated ). They are all members of the phoneapplicationserrvie class.

1. Launching: when processing this event, be sure not to read all permanent data from the independent storage. Because the system displays the application homepage on the screen after processing this event. A reasonable method is to read only the permanent data used on the display homepage at startup, and load other permanent data asynchronously after the application starts.
When processing the launching event, the developer should not restore the instantaneous state of the previous instance of the application. Once an application is started, the user experience should be an instance from the beginning.
2. Closing: when processing this event, developers should save all permanent data to independent storage. During closing, development does not need to save the instantaneous status of the current instance, that is, the information only related to this operation.
3. the deactivated application is in sleep state. When processing this event, the instantaneous state of the program should be completely saved to the state attribute of the phoneapplicationservice class. Restore these transient states if necessary. When processing this event, you should also save the permanent data of the application to the independent storage. Otherwise, permanent data will not be lost when the suspended application is activated and restarted. All operations to handle this event must be completed within 10 seconds. Otherwise, the OS terminates the application.
4. Activate when an application is suspended or sleep, the application may no longer be activated. This may be because the user starts a new application instance from the homepage. When processing this event, you should read the instantaneous state of the program from the state attribute of the phoneapplicationservice class. At the same time, you should not read data stored independently in this event.

Sometimes, we need to save the user interface of the navigation before hibernation. The onnavigatedto and onnavigatedfrom member events of the phoneapplicationpage class can be used for this operation. To put it simply, developers only need to save the user interface in onnavigatedfrom and restore the user interface in onnavigatedto.

There are three types of push notifications: Tile notification (tile), pop-up notification toast, native notification raw

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.