我使用Prism和VB.NET,尽管所有Prism 5文档都在C#中。我已翻译了我需要的大部分代码,但现在我无法翻译确认请求代码。这是Prism文档中出现的C#代码:
private void RaiseConfirmation()
{
this.ConfirmationRequest.Raise(
new Confirmation { Content = "Confirmation Message", Title = "Confirmation" },
c => { InteractionResultMessage = c.Confirmed ? "The user accepted." : "The user cancelled."; });
}
有人可以帮我翻译成VB.NET吗?
谢谢
答案 0 :(得分:1)
这是我的尝试,完全未经测试,可能还有一些错别字:
Private Sub RaiseConfirmation()
Me.ConfirmationRequest.Raise(
New Confirmation() With {
.Content = "Confirmation Message", .Title = "Confirmation"
},
Sub(c)
InteractionResultMessage =
If(c.Confirmed, "The user accepted.", "The user cancelled.")
End Sub
)
End Sub