Windows Phone 7 tips (3)

Source: Internet
Author: User

1. Windows Phone 7 is a multitasking operating system, but only one third-party application is allowed.ProgramRun on the foreground

2. the initiator and Selector provide applications with indirect access to the built-in functions of the mobile phone.

Some built-in starters: emailcomposetask, marketplacedetailtask, marketplacehubtask, marketplacereviewtask, marketplacesearchtask, mediaplayerlauncher, phonecalltask, searchtask, smscomposetask, webbrowsertask.

Some built-in selectors: cameracapturetask, emailaddresschoosertask, phonenumberchoosertask, photochoosertask, saveemailaddresstask, and savephonenumbertask.

3. when the initiator or selector is started, the application enters the Deactivate state (note that it may not necessarily be tombstone). When the task is only written, the original application will be re-activated, the application calls the activated event, and the onnavigationto event is triggered on the page.

4. if the application in Windows Phone 7 is Tombstone, a new instance will be generated when the application is opened again, that is, the app and page constructor will be called, so our logicCodeDo not place it in the constructor, but write the code for restoring the status in application_activated and onnavigationto events.

5. Determine whether the network in Windows Phone 7 is available

If(Microsoft. Phone. net. networkinformation.Networkinterface. Getisnetworkavailable ()){// Code when the Network is available}Else{// Indicates that the network is unavailable.}
 
6. navigation class in Windows Phone 7:Phoneapplicationframe AndThe alias navigation in phoneapplicationpage. Windows Phone 7 supports the following
<NAV  :  Urimapper  X  :  Key  =  "Nav"  >  
< NAV : Urimapping Uri = "Home" Mappeduri = "/Pages/views/Default. XAML" />
< NAV : Urimapping Uri = "About-us" Mappeduri = "/Pages/views/MISC/about. XAML" />
< NAV : Urimapping Uri = "Page/{number }" Mappeduri = "/Pages/views/books/Page {number}. XAML" />
< NAV : Urimapping Uri = "MERs/{ID }" Mappeduri = "/Pages/views/data/page. XAML? Action = getcustomer & amp; id = {ID }" />
< NAV : Urimapping Uri = "Products/{ID }" Mappeduri = "/Pages/views/data/page. XAML? Action = getproduct & amp; id = {ID }" />
< NAV : Urimapping Uri = "Orders/{type} & amp; {ID} & amp; {date }" Mappeduri = "/Pages/views/data/page. XAML? Action = {type} & amp; orderid = {ID} & amp; orderdate = {number }" />
</ NAV : Urimapper >
7.Wmappmanifest. xml: A metadata file containing specific data of the application, including the title, icon location, and functions.
 
8. page navigation Solution
 (1 ) directly write The XAML file address in the XAML code, such as    hyperlinkbutton   content   =" Pasta "  navigateuri   ="/pasta. XAML "  height   =" 30 "  horizontalalignment   =" Left "  
margin =" 10, 10, 0, 0 " name =" hyperlinkbutton1 " verticalignment =" TOP " width =" 200 " />
(2) When using aliases for navigation in XAML code, you must configure them in APP. XAML.
 
(3) Use event processing, such as navigationservice. navigate (NewUri ("/Pasta. XAML", Urikind. Relative ));

 
9. Descriptions of various starters
  • Emailcomposetask-Allow users to send emails through their email accounts.
  • Marketplacedetailtask-Start Windows Phone marketplace to allow users to view a specific product.
  • Marketplacehubtask-Start Windows Phone marketplace, which allows you to display a certain type of applications by default.
  • Marketplacereviewtask-Take the user to the comment page of the current program in Windows Phone marketplace.
  • Marketplacesearchtask-Start the Windows Phone marketplace search result. The result is from the search item you enter (or the one you set ).
  • Mediaplayerlauncher-Start the built-in media player and play the specified media file.
  • Phonecalltask-Start the phone program and display the phone number and name. The call is only made after the user clicks "call.
  • Searchtask-You can regard this as a way to provide Bing search functions in your program.
  • Smscomposetask-Start the Information Program and display the function of sending information to users. You can specify the message recipient and information content, but only the user can send the message.
  • Webbrowsertask-OpenNetworkBrowser to jump to the specified URL.
  •  

     
    10. Descriptions of various selectors
  • Cameracapturetask-Provides users with the function of taking photos directly in the program.
  • Emailaddresschoosertask-In the program, you can select an email address from the contact.
  • Phonenumberchoosertask-In the program, you can select a phone number from the contact.
  • Photochoosertask-In the program, you can select a photo from the device.
  • As shown in the preceding example, offline File Download is provided.

    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.