MessageDialogViewModel.cs 536 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. this.DisplayName = "Dialog Box";
  11. }
  12. public void OnButtonClick(object sender)
  13. {
  14. Button m_btn = sender as Button;
  15. DialogResult = (DialogButton)Enum.Parse(typeof(DialogButton), m_btn.Content.ToString());
  16. TryClose();
  17. }
  18. }
  19. }