using Microsoft.Practices.Prism.ViewModel; namespace Common { /// <summary> /// 增加选择属性 /// </summary> /// <typeparam name="T"></typeparam> public class SelectableObject<T> : NotificationObject { public SelectableObject(T item) { Item = item; } /// <summary> /// 是否选中 /// </summary> private bool _isSelected; public bool IsSelected { get { return _isSelected; } set { if (_isSelected != value) { _isSelected = value; RaisePropertyChanged("IsSelected"); } } } /// <summary> /// 封装的对象 /// </summary> public T Item { get; set; } } }