I created the simplest WPF project with a MVVM pattern. How can I call ShowMessageAsync from my viewModel?
if (DisciplineText!="")
{
Disciplines.Add(new Discipline(){ChairID = SelectedChair.ChairID,SemesterID = SelectedSemester.SemesterID,Discipline1 = DisciplineText});
Context.SaveChanges();
}
else
{
// ShowMessageAsync????????
}
MetroWindow metroWindow = Application.Current.MainWindow as MetroWindow;
metroWindow.MetroDialogOptions.ColorScheme = MetroDialogColorScheme.Accented; // set the theme
await MetroWindow.ShowMessageAsync("Title", "Message");
You need to use :
using MahApps.Metro.Controls;
using MahApps.Metro.Controls.Dialogs;
I hope it help :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With