using OpenSEMI.ClientBase; using System.Collections.ObjectModel; using System.Windows.Controls; namespace MECF.Framework.UI.Client.CenterViews.Dialogs { public class ListDialogViewModel:DialogViewModel { private string _CurrentValue; public ObservableCollection Items { get; set; } public string HeaderText { get { return "Permission Select"; } } public ListDialogViewModel() { Items = new ObservableCollection(); } 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); } } }