To Create above confirmation dialogue just follow the below method
You need to add
using MahApps.Metro.Controls;
using MahApps.Metro.Controls.Dialogs;
then write the function as below
private async Task showConfirmation(string message)
{
MessageDialogResult result = await this.ShowMessageAsync(message, "", MessageDialogStyle.AffirmativeAndNegative);
if (result == MessageDialogResult.Affirmative)
{
//Do For ok Button
}
else
{
//Do For cancel Button
}
}
private async void removeGameButton_Click(object sender, RoutedEventArgs e)
{
await showConfirmation("Remove : " + GameName + "?");
}
You need to add
using MahApps.Metro.Controls;
using MahApps.Metro.Controls.Dialogs;
then write the function as below
private async Task showConfirmation(string message)
{
MessageDialogResult result = await this.ShowMessageAsync(message, "", MessageDialogStyle.AffirmativeAndNegative);
if (result == MessageDialogResult.Affirmative)
{
//Do For ok Button
}
else
{
//Do For cancel Button
}
}
private async void removeGameButton_Click(object sender, RoutedEventArgs e)
{
await showConfirmation("Remove : " + GameName + "?");
}
Ty, thats help me a lot ! :)
ReplyDeleteTy, thats help me a lot ! :)
ReplyDelete