-4
我想在附加文件时添加说明,并使用MVVM模型。我创建一个commandHolder并从那里创建一个命令,我无法将Lazy<View>
转换为Lazy<RelayCommand>
我请求你在这里请帮助我。将Lazy懒惰<View>转换为Lazy <RelayCommand>并返回
this.fileAttachmentDescriptionCommandHolder = new Lazy<FileAttachmentDescriptionView>(() => new FileAttachmentDescriptionView { DataContext = this });
this.fileAttachmentDescriptionViewHolder = new Lazy<RelayCommand>(this.CreateFileAttachmentDescriptionCommand);
我得到的错误:
Error CS0029 Cannot implicitly convert type 'System.Lazy Path.RelayCommand' to 'System.Lazy path.View'
好像你正在给“commandHolder”分配一个视图,并向“viewHolder”分配一个命令。这没有多大意义。 – mechanic
感谢技工和凯文 –
@SanthoshRajoo可以自由地通过点击投票按钮下方的复选标记将答案标记为“答案”,如果它确实回答了您的问题。 – Kcvin