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