Files
FeedCenter/Application/Options/CheckedListItem.cs
Chris Kaczor b5f570688d More modernization
- Split generic "common" libraries into specific libraries
- Use other packages in lieu of custom code
- General cleanup
2023-04-05 16:06:38 -04:00

41 lines
818 B
C#

using System.ComponentModel;
namespace FeedCenter.Options;
public class CheckedListItem<T> : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private bool _isChecked;
private readonly T _item;
public CheckedListItem() { }
public CheckedListItem(T item, bool isChecked = false)
{
_item = item;
_isChecked = isChecked;
}
public T Item
{
get => _item;
init
{
_item = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Item"));
}
}
public bool IsChecked
{
get => _isChecked;
set
{
_isChecked = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("IsChecked"));
}
}
}