Hey Everyone! The topic for today is Launchers and Choosers. So what are Launchers and choosers exactly what they do? Well Launchers are events defined in your app that are triggered upon users request for example if you want to share you blog post on some specific site through some app then this event would be said as Launcher event. On the other hand if you choose something like a photo in you Smartphone to be broadcast on Facebook or some other website than this is known as Chooser. First you select a specific material and then broadcast or send it to people.
So let’s begin with Launchers and Choosers:
- First of all open a Blank Windows Phone (SilverLight) application in Microsoft Visual Studio 2013.
- After that select Button control from the toolbox and drag and drop them on the MainPage.xaml.
- When you are done give buttons names and content.
- Double click on the button to create an event or create it by writing your own xaml.
- Download the code below paste it and see what happens against each operation.
Lets discuss what is running in code:
- So in review event handler you will see we are creating a new instance named as MarketPlaceReviewTask that is basically a type of method that will be called to give review to the app.
- In Share event handler you will see we are creating a new instance named as ShareLinkTask this will help you sharing the link like in this particular code we are trying to send the facebook link. You can share links on different site depending on your phone capabilities.
- In Photo Chooser event handler you will see we are creating a new instance named as PhotoChooserTask that will help you pick a photo and share it.
- In email event handler you will see we are creating a new instance named as EmailComposeTask here you will see we used some of the predefined functionality for our purpose like Email contain To whom you want to send, its Subject and the body of the email.
- Lastly in message event handler you will see we are creating a new instance named as SmsComposeTask by clicking this event you will be able to send text messages to any one you want.
- Well beside these we have functionality like to Call someone. You may use it too.
Download Sample Code from here