using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.SharedUI; namespace Tango.MachineStudio.DB.ViewModels { public class MultiComboVM : EntityViewModel { private Action _onSelectionChanged; public event EventHandler SelectionChanged; public MultiComboVM(T entity) : base(entity) { } public MultiComboVM(T entity, Action onSelectionChanged) : this(entity) { _onSelectionChanged = onSelectionChanged; } private bool _isSelected; public bool IsSelected { get { return _isSelected; } set { _isSelected = value; RaisePropertyChangedAuto(); OnSelectionChanged(); } } protected virtual void OnSelectionChanged() { if (_onSelectionChanged != null) { _onSelectionChanged(); } SelectionChanged?.Invoke(this, new EventArgs()); } } }