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.
 
 
 

32 lines
1.1 KiB

// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
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));
}
}
}