Exemple #1
0
        public async Task <MessageDialogResult> ShowOkCancelDialogAsync(string text, string title)
        {
            MahApps.Metro.Controls.Dialogs.MessageDialogResult result = await MetroWindow.ShowMessageAsync(title, text, MessageDialogStyle.AffirmativeAndNegative);

            return(result == MahApps.Metro.Controls.Dialogs.MessageDialogResult.Affirmative
              ? MessageDialogResult.OK
              : MessageDialogResult.Cancel);
        }
        private async void Add_Student_Click(object sender, RoutedEventArgs e)
        {
            MahApps.Metro.Controls.Dialogs.MessageDialogResult result = await this.ShowMessageAsync("Confirmtion!", "Do You Want To Register This Student", MessageDialogStyle.AffirmativeAndNegative);

            StudentIntImplementation a = new StudentIntImplementation();

            if (a.addStudent(id.Text).Equals(true))
            {
                await this.ShowMessageAsync("Registration", "Student Added " + result);
            }
        }
        public static DialogResult ToAdapter(this Metro.MessageDialogResult result)
        {
            switch (result)
            {
            case Metro.MessageDialogResult.Canceled:
                return(DialogResult.Canceled);

            case Metro.MessageDialogResult.Negative:
                return(DialogResult.Negative);

            case Metro.MessageDialogResult.Affirmative:
                return(DialogResult.Affirmative);

            case Metro.MessageDialogResult.FirstAuxiliary:
                return(DialogResult.Canceled);

            default:
                return(DialogResult.Canceled);
            }
        }
Exemple #4
0
 private async void ShowMessageDialog(object sender, RoutedEventArgs e)
 {
     MahApps.Metro.Controls.Dialogs.MessageDialogResult result = await this.ShowMessageAsync("Information!", "You Selected " + SelectedTile, MessageDialogStyle.Affirmative);
 }