I started a project in Blend for Visual Studio 2013 generating the message by dialog. On the home screen I put an unnamed button with the inscription "Test":
After that, I selected the button and searched the properties of the button for the events I can put on the button. Double-clicking on "Click", Blend created the event for me as shown below:
Finally, my source was like this:
Mainpage.xaml.Cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Windows.UI.Popups; // Não esqueça de adicionar este using
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
namespace App1
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
private async void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
// Aqui crio uma mensagem de dialog e a exibo.
MessageDialog dialog = new MessageDialog("Teste", "Teste Dialog");
await dialog.ShowAsync();
}
}
}
The result was this:
You already have some code started?
– Leonel Sanches da Silva
As a matter of fact, no. I start a project from the beginning, if I try to import that library: using Windows.UI, it says it did not find
– Emerson Moraes