mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-01-13 17:22:48 -05:00
More modernization
- Split generic "common" libraries into specific libraries - Use other packages in lieu of custom code - General cleanup
This commit is contained in:
41
Application/Options/CheckedListItem.cs
Normal file
41
Application/Options/CheckedListItem.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user