我正在开发一个 WPF 应用程序(MVVM)。我有一个来自单独程序集的类(Odata V4 Generated Proxy Class)。
public partial class Book : BaseEntityType, INotifyPropertyChanged
{
public string Title{get;set;}
...
}
现在我需要使用数据注释来装饰该类的属性,以便使用IDataErrorInfo
或INotifyDataErrorInfo
接口验证属性。前任:
[Required]
public string Title{get;set;}
问题:
由于此类在单独的程序集中,我无法创建部分类。此类的属性绑定到应用程序的 UI 元素。现在我需要在用户输入数据时验证属性。
我正在努力设计解决方案。任何人都可以帮助我实现这一目标吗?