ListDialogProViewModel.cs 942 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using OpenSEMI.ClientBase;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Collections.ObjectModel;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace MECF.Framework.UI.Client.CenterViews.Dialogs
  9. {
  10. public class ListDialogProViewModel : DialogViewModel<string>
  11. {
  12. private string _CurrentValue;
  13. public ObservableCollection<string> Items { get; set; }
  14. public string HeaderText { get; set; }
  15. public ListDialogProViewModel()
  16. {
  17. Items = new ObservableCollection<string>();
  18. }
  19. public void OK(string parameter)
  20. {
  21. _CurrentValue = parameter;
  22. if (!string.IsNullOrEmpty(_CurrentValue))
  23. {
  24. this.DialogResult = _CurrentValue;
  25. IsCancel = false;
  26. TryClose(true);
  27. }
  28. }
  29. }
  30. }