first commit
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows.Input;
|
||||
using ClassicAssist.Annotations;
|
||||
|
||||
namespace ClassicAssist.Data.Autoloot
|
||||
{
|
||||
public class AutolootConstraintEntry : INotifyPropertyChanged
|
||||
{
|
||||
private AutolootOperator _operator = AutolootOperator.Equal;
|
||||
private PropertyEntry _property;
|
||||
private int _value;
|
||||
|
||||
public AutolootOperator Operator
|
||||
{
|
||||
get => _operator;
|
||||
set => SetProperty( ref _operator, value );
|
||||
}
|
||||
|
||||
public PropertyEntry Property
|
||||
{
|
||||
get => _property;
|
||||
set => SetProperty( ref _property, value );
|
||||
}
|
||||
|
||||
public int Value
|
||||
{
|
||||
get => _value;
|
||||
set => SetProperty( ref _value, value );
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged( [CallerMemberName] string propertyName = null )
|
||||
{
|
||||
PropertyChanged?.Invoke( this, new PropertyChangedEventArgs( propertyName ) );
|
||||
}
|
||||
|
||||
// ReSharper disable once RedundantAssignment
|
||||
public virtual void SetProperty<T>( ref T obj, T value, [CallerMemberName] string propertyName = "" )
|
||||
{
|
||||
obj = value;
|
||||
OnPropertyChanged( propertyName );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user