After updating the MvvmValidation NuGet package from version 2.0.2 to 3.1.0, I get the error:
The type or namespace name 'DataErrorInfoAdapter' could not be found (are you missing a using directive or an assembly reference?)
My ValidatableViewModelBase.cs looks like this:
public abstract class ValidatableViewModelBase : ViewModelBase, IDataErrorInfo
{
public ValidationHelper Validator { get; } = new ValidationHelper();
public DataErrorInfoAdapter DataErrorInfoAdapter { get; set; } // this type does not exist
[...]
protected ValidatableViewModelBase()
{
this.DataErrorInfoAdapter = new NotifyDataErrorInfoAdapter(this.Validator);
[...]
}
#region IDataErrorInfo
[Ignore]
public string Error => this.DataErrorInfoAdapter.Error;
[Ignore]
public string this[string columnName] => this.DataErrorInfoAdapter[columnName];
#endregion IDataErrorInfo
}
I was not able to find any migration guidelines on how to replace the deprecated DataErrorInfoAdapter. All I could find was some information about the NotifyDataErrorInfoAdapter, but I am not quite sure if I need to change my ValidatableViewModelBase to implement INotifyDataErrorInfo interface.
Do you have any advice or reference documentation for me?
Can someone explain to me, why they dropped DataErrorInfoAdapter but not IDataErrorInfo?
They actually seem to have dropped the support for the
IDataErrorInfointerface.The new
NotifyDataErrorInfoAdapterimplements theINotifyDataErrorInfothat has been around since .NET Framework 4.5 was released. Here is an example and more information about how to implement it.If you want to stick to
IDataErrorInfofor some reason, it makes no sense to upgradeMvvmValidationto the latest version.