A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

29 lines
994 B

using System;
using System.Collections;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Avalonia.UnitTests;
namespace Avalonia.Base.UnitTests.Data.Core
{
internal abstract class IndeiBase : NotifyingBase, INotifyDataErrorInfo
{
private EventHandler<DataErrorsChangedEventArgs>? _errorsChanged;
public abstract bool HasErrors { get; }
public int ErrorsChangedSubscriptionCount { get; private set; }
public event EventHandler<DataErrorsChangedEventArgs>? ErrorsChanged
{
add { _errorsChanged += value; ++ErrorsChangedSubscriptionCount; }
remove { _errorsChanged -= value; --ErrorsChangedSubscriptionCount; }
}
public abstract IEnumerable GetErrors(string? propertyName);
protected void RaiseErrorsChanged([CallerMemberName] string propertyName = "")
{
_errorsChanged?.Invoke(this, new DataErrorsChangedEventArgs(propertyName));
}
}
}