MessageDialogViewModel.cs 449 B

12345678910111213141516171819202122
  1. using System;
  2. using System.Windows.Controls;
  3. namespace OpenSEMI.ClientBase
  4. {
  5. public class MessageDialogViewModel : MessageDialog
  6. {
  7. protected override void OnInitialize()
  8. {
  9. base.OnInitialize();
  10. DisplayName = "Dialog Box";
  11. }
  12. public void OnButtonClick(object sender)
  13. {
  14. Button button = sender as Button;
  15. base.DialogResult = (DialogButton)Enum.Parse(typeof(DialogButton), button.Content.ToString());
  16. TryClose(null);
  17. }
  18. }
  19. }