Recently I got a mail from one of the readers. She asked "How could be launch Call Task from Secondary Tile?" In this article I am going to show the way to do that. Before proceeding with this article, I strongly recommend reading the following three posts for more on Live Tiles and Call Task. Video on How to work with Live Tiles in Windows Phone 7 Live Tiles in Windows Phone 7.5 or Mango phone Code to make call in Windows Phone 7 Delete Secondary Tiles in Windows Phone 7.5 or Mango Phone The idea of launching a Call Task from Secondary Tiles is very simple.
private void btnCreateSecondaryTiles_Click(object sender, RoutedEventArgs e){ var newTile = new StandardTileData() { Title = "Blogs Update", BackgroundImage = new Uri("background.png", UriKind.Relative), Count = 42, }; var uri = "/Page1.xaml?state=Live Tile"; ShellTile.Create(new Uri(uri, UriKind.Relative), newTile); }
If you notice in the preceding code, I have set navigation to Page1.Xaml. Now on onNavigatedTo() method we need to write code to launch Call Task. protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e){ //base.OnNavigatedTo(e); PhoneCallTask callTask = new PhoneCallTask(); callTask.PhoneNumber = "999999"; callTask.DisplayName = "debugMode"; callTask.Show();} On running you should be getting following output I hope this article was useful. Thanks for reading.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: