The name ‘MessageBox’ does not exist in the current context for Universal App

In the earlier versions of Windows Phone , we could use the MessageBox.Show method to display message box within the Windows Phone app .

When tried to use the same within the Universal App , you might get an error.

The name ‘MessageBox’ does not exist in the current context

This is because , the Universal App / Windows Phone 8.1 XAML App has the new API defines in the Windows.UI.Popups name space which provides the MessageDialog class to display the messagebox with in the Universal App.

How to display MessageBox in Universal Apps ?

var dialog1 = new MessageDialog("Test Message from Ginktage");
await dialog1.ShowAsync();

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you will learn about sync provider notifications in Windows 11 and how to disable or enable it...
In this tutorial, let’s learn how to enable or disable the startup sound in Windows 11. By default, when Windows...
The CameraCaptureTask allows the Windows Phone 7 App to launch the Camera Application . This will be useful when the...