Sunday, May 1, 2016

Application Exit Script

如果有D野, 係想個 app 正常 exit 既時間會行既, 就可以加入 application exit script 了.
不過, 點先算係正常 exit 呢....理論上唔係中途 error 死左, 又或者比人直接 kill 既都得.


  1. 在 App.xaml 加入 Exit="<method>", 例如叫 "ApplicationExit" ....
  • 又或者開左之後, click 落 application, 在 Properties 既 Event Handler 果版,打個名都得.

  1. 之後, 在 Event Handler 果度, click 個 Exit event 既 script, 就會打開 App.xaml.cs 比你加 code 了.

想加乜就自己決定了.

No comments:

Post a Comment