In this article we will see how to show message dialog in a Windows Store app.
Create a new Windows Store Blank Project with a proper name. Here I used “Message Dialog Demo” as shown in the following screen.
Now drag and drop one button from the toolbox to show the message dialog change the button content to Show Message Dialog. After completion the design part looks as in the following screen.
XAML Code
- <Page
- x:Class="Message_Dialog_Demo.MainPage"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="using:Message_Dialog_Demo"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d">
- <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
- <Button Content="Show Message Dialog" HorizontalAlignment="Left" Margin="308,197,0,0" VerticalAlignment="Top" Height="60" Width="138" Click="Button_Click"/>
- </Grid>
- </Page>
Now write the following code to show the message dialog as “Hi Message dialog”.
To show the message dialog include the namespace given below:
- Using Windows.UI.Popups;

Now write the following code in the button click event.
C# Code
- private async void Button_Click(object sender, RoutedEventArgs e)
- {
- MessageDialog message = new MessageDialog("Hi Message dialog");
- await message.ShowAsync();
- }

Run the application by pressing the F5 Key directly in your keyboard. Press the Show Message Dialog button and you will see the output as shown below.


Kumaresh RajalingamPosted Feb 19, 2016, 7:55 PM
good one
Kumaresh RajalingamPosted Feb 19, 2016, 7:55 PM
Nice explanation
Sr KarthigaPosted Feb 16, 2016, 9:57 PM
good one
Sr KarthigaPosted Feb 16, 2016, 9:56 PM
Nice explanation