例如
Messenger.Default.Register<AboutToCloseMessage>(this, (msg) =>
{
if (msg.TheContainer == this.MyContainer) // only care if my container.
{
// decide whether or not we should cancel the Close
if (!(this.MyContainer.CanIClose))
{
msg.Execute(true); // indicate Cancel status via msg callback.
}
}
});
@Shakti辛格:你能告诉我们如何搜索'=>'符号? – BoltClock 2011-06-08 13:19:21
@Shakti Singh:如果Rdeluca知道'=>'的意思是“lambda表达式”,他首先不会问。 – BoltClock 2011-06-08 13:24:03
是啊..不知道它叫做lambda还是我会搜索它。谢谢! – Rdeluca 2011-06-08 13:46:50