2

当我尝试从http://caliburnmicro.codeplex.com构建 Caliburn.Micro 示例项目“Caliburn.Micro.HelloScreens”时出现此错误

错误:类型“TDocument”必须是引用类型才能将其用作泛型类型或方法“Caliburn.Micro.Conductor”中的参数“T”

TDocument 在类 DocumentWorkspace 中定义为

public abstract class DocumentWorkspace<TDocument> : Conductor<TDocument>.Collection.OneActive, IDocumentWorkspace where TDocument : INotifyPropertyChanged, IDeactivate, IHaveDisplayName 
{
4

1 回答 1

0

抽象中缺少class关键字,以告诉 DocumentWorkspace TDocument 是派生对象类。尝试

public abstract class DocumentWorkspace<TDocument> : Conductor<TDocument>.Collection.OneActive, IDocumentWorkspace where TDocument : class, INotifyPropertyChanged, IDeactivate, IHaveDisplayName { }
于 2016-02-09T22:10:52.607 回答