first commit
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using ClassicAssist.Annotations;
|
||||
|
||||
namespace ClassicAssist.Data.Organizer
|
||||
{
|
||||
public class OrganizerItem : INotifyPropertyChanged
|
||||
{
|
||||
private int _amount;
|
||||
private int _hue;
|
||||
private int _id;
|
||||
private string _item;
|
||||
|
||||
public int Amount
|
||||
{
|
||||
get => _amount;
|
||||
set => SetProperty( ref _amount, value );
|
||||
}
|
||||
|
||||
public int Hue
|
||||
{
|
||||
get => _hue;
|
||||
set => SetProperty( ref _hue, value );
|
||||
}
|
||||
|
||||
public int ID
|
||||
{
|
||||
get => _id;
|
||||
set => SetProperty( ref _id, value );
|
||||
}
|
||||
|
||||
public string Item
|
||||
{
|
||||
get => _item;
|
||||
set => SetProperty( ref _item, value );
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
// ReSharper disable once RedundantAssignment
|
||||
public void SetProperty<T>( ref T obj, T value, [CallerMemberName] string propertyName = "" )
|
||||
{
|
||||
obj = value;
|
||||
OnPropertyChanged( propertyName );
|
||||
}
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged( [CallerMemberName] string propertyName = null )
|
||||
{
|
||||
PropertyChanged?.Invoke( this, new PropertyChangedEventArgs( propertyName ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user