MessageBoxes in Windows Phone 8.1

If you want to use MessageBoxes with your Windows Phone 8.1 Applications instead of using MessageBox you’ll need to use MessageDialog.

Make sure to include the following using statement:

using Windows.UI.Popups;

The code to launch a message box is as follows:

MessageDialog msgDialog = new MessageDialog("Works in Windows Phone 8.1");
//launch the dialog
await dialog.ShowAsync();

Hope that helps.

Opening Settings in Windows Phone 8.1 Runtime XAML

I've been frustrated to find that as a result of Microsoft.Phone (and more importantly Microsoft.Phone.Tasks) not being supported in Windows Phone 8.1 XAML launching a specific phone setting from your application has changed. It is however supported in Windows Phone Silverlight 8 and 8.1.

Previously the code for opening a settings page (in this example the Bluetooth Settings Page) would have followed:

ConnectionSettingsTask connectionSettingsTask = new ConnectionSettingsTask();
connectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.Bluetooth; 
connectionSettingsTask.Show();

or alternatively:

Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-bluetooth"));

 

The new syntax for opening a settings page (again in this example Bluetooth) in Windows 8.1 Phone XAML is as follows:

Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-bluetooth:///"));

*Notice the addition of the :/// (makes all the difference in the world)

 

Hopefully that saves you some time searching because it took me a while before i found anything remotely useful for Windows Phone 8.1.