0

我有一个多目标域项目(SL 和 .Net 4.0),颜色等问题我正在使用#if SILVERLIGHT 构造,但现在我需要使用我的域项目的 SL 项目有几个实现 INotifyDataErrorInfo 的类不是在 .Net 4.0 站点上实施,我永远不会使用它。

我将不胜感激如何制作这样的东西

public class MyDomainClass: INotifyPropertyChanged, #IF Silverlight INotifyDataErrorInfo
{
4

1 回答 1

1

假设您可以在 silverlight 中使用 partial 关键字:

public partial class MyDomainClass: INotifyPropertyChanged 
{
 // implement everything on INotifyPropertChanged 
}


#IF Silverlight 
public partial class MyDomainClass:INotifyDataErrorInfo 
{
     // implement everything on INotifyDataErrorInfo 
     // if needed using the stuff from the 'shared' class
}
#ENDIF
于 2012-10-14T19:24:45.587 回答