1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using OpenSEMI.ClientBase;
- using System.Collections.ObjectModel;
- using System.Windows.Controls;
- namespace MECF.Framework.UI.Client.CenterViews.Dialogs
- {
- public class ListDialogViewModel:DialogViewModel<string>
- {
- private string _CurrentValue;
- public ObservableCollection<string> Items { get; set; }
- public string HeaderText
- {
- get { return "Permission Select"; }
- }
- public ListDialogViewModel()
- {
- Items = new ObservableCollection<string>();
- }
- public void SelectChanged(object item)
- {
- _CurrentValue = item.ToString();
- }
- public void DoubleClick(object item)
- {
- _CurrentValue = item.ToString();
- OK();
- }
- public void OK()
- {
- if (!string.IsNullOrEmpty(_CurrentValue))
- {
- this.DialogResult = _CurrentValue;
- IsCancel = false;
- TryClose(true);
-
- }
- }
- public void Cancel()
- {
- IsCancel = true;
- TryClose(false);
- }
- }
- }
|