first commit
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace ClassicAssist.Data.Scavenger
|
||||
{
|
||||
public class ScavengerEntry : INotifyPropertyChanged
|
||||
{
|
||||
private bool _enabled;
|
||||
private int _graphic;
|
||||
private int _hue;
|
||||
private string _name;
|
||||
|
||||
public bool Enabled
|
||||
{
|
||||
get => _enabled;
|
||||
set => SetProperty( ref _enabled, value );
|
||||
}
|
||||
|
||||
public int Graphic
|
||||
{
|
||||
get => _graphic;
|
||||
set => SetProperty( ref _graphic, value );
|
||||
}
|
||||
|
||||
public int Hue
|
||||
{
|
||||
get => _hue;
|
||||
set => SetProperty( ref _hue, value );
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get => _name;
|
||||
set => SetProperty( ref _name, value );
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void OnPropertyChanged( [CallerMemberName] string propertyName = null )
|
||||
{
|
||||
PropertyChanged?.Invoke( this, new PropertyChangedEventArgs( propertyName ) );
|
||||
}
|
||||
|
||||
// ReSharper disable once RedundantAssignment
|
||||
public void SetProperty<T>( ref T field, T value, [CallerMemberName] string propertyName = null )
|
||||
{
|
||||
field = value;
|
||||
OnPropertyChanged( propertyName );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user