ARTICLE

How to Launch Call Task From Secondary Tile in Windows Phone 7

Posted by Dhananjay Kumar Articles | Windows Phone 8 January 06, 2012
In this article we will learn how a call task is launching from Secondary Tile in Windows Phone 7.
Reader Level:

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. 

  1. On clicking of Secondary Tile user will get navigated to a blank page. Let us call that page as Page1.XAML
  2. On NavigatedTo method of the Page1.Xaml, we will instantiate Call Task and show call panel to user.
Let us create Secondary Tile on MainPage.Xaml. I have put a button on MainPage and on click event of the button Secondary Tile will get created. 

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

HOW TO LAUNCH.png

I hope this article was useful. Thanks for reading. 

Login to add your contents and source code to this article
post comment
     

Thanks for explaining this new functionality

Posted by Alec Stewart Jan 07, 2012

Really this article is very advantageous

Posted by Arjun Panwar Jan 07, 2012

this article is useable

Posted by Jimmy Underwood Jan 07, 2012
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
Join a Chapter
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Join a Chapter