I will assume that you have installed the tools for working like Visual Studio 2012 ( or 2013 ) and that you’re on Windows 8 at least ( or 8.1 ) .
You can use Launchers in your Windows Phone applications to enable users to perform common tasks. By using Launchers, you help provide a consistent user experience throughout the Windows Phone platform. At the same time, by using Launchers, you can distinguish your applications by providing additional functionality.
Let’s learn now how to use this great tool , Go ahead and create a new project , then follow these steps :
First thing that we will do is something that we’ve already done in the previous workshops ,let’s make our grid with 3 rows and 2 columns .
The Grid will look like this :
It’s time to add our buttons now just like how we did in a previous workshop , let’s follow some best practises and name them like this and add the event handlers :
We will add now the code behind for each event :
Let’s start with our first launcher : WebBrowserTask
This launcher will help us open the browser in the Windows Phone , but make sure to add the namespace Microsoft.Phone.Tasks; be fore starting
The code for the WebBrowserTask is :
Let’s move now for the PhoneCallTask which is a launcher to make a phone call from the application :
We need to check a capability for this in the Manifest file : Id_Cap_PhoneDialer
Now we can add some C# code for the event :
Let’s try now another launcher which is EmailComposeTask :
This launcher will help us send an email via the linked inbox in the Windows Phone through the application
You can see that I’ve added the reciever , subject and my other email , you can get these parameters from textboxes if you want in your application
What about getting ratings for your application ? Yes it matters , and therefore we can use a launcher to help the user rate our application inside it not forcing him to leave it .
We will use the MarketPlaceReviewTask :
And what if you want to promote your other applications in the store for your user ? In fact yes you can , just another launcher , as simple as that :
Let’s use the MarketPlaceSearchTask :
And if you’re using internet connection in your application and you want to redirect your user to the WiFi settings without leaving the application , just use another launcher which is : ConnectionSettingsTask
Let’s explore now some results of our launchers from these screen shots :
You can now save your work and run the project , please note that the EmailComposeTask and MarketPlace launchers won’t work on the Emulator
No comments:
Post a Comment