New Task in Windows Phone 7.1

Source: Internet
Author: User

In Wp7.1, multiple tasks are added to implement BingMap and bell sound operations. In addition, some functions of the original Task have been enhanced.

1. BingMapsTask: Used to call Bingmaps, and can mark the center point, search, and set the display ratio. Similar to the BingMaps control, but the available api functions are weak.

_ TskBingmap = new BingMapsTask ();

_ TskBingmap. Center = new GeoCoordinate (30.24, 120.123 );

_ TskBingmap. SearchTerm = "West Lake ";

_ TskBingmap. ZoomLevel = 10;

_ TskBingmap. Show ();

 

2. BingmapsDirectionsTask: Used to call BingMaps and can mark the travel direction between two points.

_ TskBMDirections ctions = new BingMapsDirectionsTask ();

_ TskBMDirections. Start = new LabeledMapLocation ("Start", new GeoCoordinate (30.24, 120.123 ));

_ TskBMDirections ctions. End = new LabeledMapLocation ("End", new GeoCoordinate (30.25, 120.223 ));

_ TskBMDirections. Show ();

3. GameInvite: You can open the game invitation interface to enable multiplayer games.

_ TskGame = new GameInviteTask ();

_ TskGame. Completed + = new EventHandler <TaskEventArgs> (_ tskGame_Completed );

_ TskGame. SessionId = "<my session id> ";

_ TskGame. Show ();

 

4. SaveRingToneTask: Save the audio file to the system's ringtone list, and select the ringtone.

There are certain requirements for the bell sound to be saved:

L only MP3 or WMA files

L playback Duration: 40 seconds

L files cannot be protected with digital Permissions

L The file size must be smaller than 1 MB

_ TskSaveRingTone = new SaveRingtoneTask ();

_ TskSaveRingTone. Completed + = new EventHandler <TaskEventArgs> (_ tskSaveRingTone_Completed );

_ TskSaveRingTone. DisplayName = "Tears of Love ";

_ TskSaveRingTone. IsoStorePath = new Uri ("appdata:/mytone.mp3", UriKind. Absolute );

_ TskSaveRingTone. isreceivable = true;

_ TskSaveRingTone. Show ();

 

 

 

Some other tasks also improve their functions. For example, both PhoneNumberChooserTask and EmailAddressChooserTask can obtain the corresponding person name through DisplayName.

Sample Code: http://www.52winphone.com/bbs/viewthread.php? Tid = 746 & extra = page % 3D1

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.