ValidatableBindableBase是否未在Prism.Wpf中实现?为什么?

ValidatableBindableBase是否未在Prism.Wpf中实现?为什么?,wpf,prism,prism-6,Wpf,Prism,Prism 6,试图合并ValidatableBindableBase以便于验证实现,我注意到它在Prism.Wpf中不可用 它在Prism.Windows(Windows10UWP)中提供,但是 那么我会错过它吗(那么它在哪里) 或者它真的没有在WPF中实现(为什么)?在Prism中验证。WPF是通过实现IDataErrorInfo或INotifyDataErrorInfo接口来完成的。例如: public abstract class DomainObject : INotifyPropertyChange

试图合并
ValidatableBindableBase
以便于验证实现,我注意到它在
Prism.Wpf
中不可用

它在
Prism.Windows
(Windows10UWP)中提供,但是

那么我会错过它吗(那么它在哪里)


或者它真的没有在
WPF
中实现(为什么)?

在Prism中验证。WPF是通过实现
IDataErrorInfo
INotifyDataErrorInfo
接口来完成的。例如:

public abstract class DomainObject : INotifyPropertyChanged, INotifyDataErrorInfo
{
    private ErrorsContainer<ValidationResult> errorsContainer =
                    new ErrorsContainer<ValidationResult>(
                       pn => this.RaiseErrorsChanged( pn ) );

    public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged;

    public bool HasErrors
    {
        get { return this.ErrorsContainer.HasErrors; }
    }

    public IEnumerable GetErrors( string propertyName )
    {
        return this.errorsContainer.GetErrors( propertyName );
    }

    protected void RaiseErrorsChanged( string propertyName )
    {
        var handler = this.ErrorsChanged;
        if (handler != null)
        {
            handler(this, new DataErrorsChangedEventArgs(propertyName) );
        }
    }
   ...
}
公共抽象类DomainObject:INotifyPropertyChanged,INotifyDataErrorInfo
{
私人错误联系人错误联系人=
新错误容器(
pn=>this.RaiseErrorsChanged(pn));
公共事件事件处理程序错误更改;
公共布尔错误
{
获取{返回this.ErrorsContainer.HasErrors;}
}
公共IEnumerable GetErrors(字符串propertyName)
{
返回此.errorsContainer.GetErrors(propertyName);
}
受保护的无效RAISEERROSCHANGED(字符串属性名称)
{
var handler=this.ErrorsChanged;
if(处理程序!=null)
{
处理程序(这是新的DataErrorsChangedEventArgs(propertyName));
}
}
...
}
这一点在棱镜的定义中也有解释


那么为什么UWP不能这样工作呢?因为在UWP上,您无法访问这些接口,因此需要
ValidatableBindableBase
BindableValidator
类。如果出于某种原因,您喜欢这种方法,那么没有什么可以阻止您使用UWP类并将它们带到WPF解决方案中,所有代码都是。

BindableValidator的var resourceLoader=resourceLoader.GetForCurrentView(mapId);什么可以替代它?我使用注释,它是否比
IDataErrorInfo
/
INotifyDataErrorInfo
慢?因为注释使用反射