例如
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