Windows Phone camp in 6 cities of India from 17th Feb to 29th Feb

image

Windows Phone camp is coming to your city. Be ready to learn from experts and enhance your Windows Phone application creation skills.

City

Date

Register

Trivandrum

29th February

Register here

Ahmedabad

24th February

Register here

Indore

22nd February

Register here

Bangalore

20th February

Register here

Mumbai

27th February

Register here

Delhi

17th February

Register here

So what are you waiting for ? Go ahead and register for the great event. I am sure you are going to flood market place with yours great applications.

Wish you very good luck.

 

Code to send game invite to multiple user in Windows Phone

You can send game invite to multiple users in Windows Phone using GameInviteTask chooser.

GameInviteTask chooser is used to send invitation to other users in multi-player game. It provides an invite screen to user where they can configure Email address of other users to send game invitation. Invitation will be sent by GameInviteTask chooser is in asynchronous manner.

GameInviteTask will launch invite screen and when user will complete configuring Email address of other user then complete event will get fired.

To work with GameInviteTask, you need to follow below steps

Very first you need to declare variable globally on the page as below,

image

Then Create instance of GameInviteTask and attach completed event in the constructor of the page as below,

image

Next you need to call the show method to launch invite screen application as per your business requirement. It may be on click event of a button. Session Id is string identifying particular network session.

image

In completed event handle user action. On selection of user shown appropriate message as below,

image

User will configure Email Id as below,

image

On user selection cancel, message will be shown in message box as below.

image

For your reference full source code is as below,



public partial class MainPage : PhoneApplicationPage
{
GameInviteTask gameInviteTask;

public MainPage()
{
InitializeComponent();
gameInviteTask = new GameInviteTask();
gameInviteTask.Completed += new EventHandler<TaskEventArgs>(gameInviteTask_Completed);

}

private void Button_Click(object sender, RoutedEventArgs e)
{
gameInviteTask.SessionId = "your session id of the game";


}

void gameInviteTask_Completed(object sender, TaskEventArgs e)
{
switch (e.TaskResult)
{

case TaskResult.OK:
MessageBox.Show("Sent");
break;

case TaskResult.Cancel:
MessageBox.Show("Cancel");
break;

case TaskResult.None:
MessageBox.Show("Failed");
break;
}
}
}


In this way you can send game invitation to multiple users. I hope this post is useful. Thanks for reading.