我有一類本身就是一個事件分配:析構函數的碰撞
public MainMenuButton()
{
this.DefaultStyleKey = typeof(MainMenuButton);
(App.Current as App).ApplicationLanguageChange += Localize;
}
而且在析構函數我這樣做:
~MainMenuButton()
{
(App.Current as App).ApplicationLanguageChange -= Localize;
}
當在模擬器我做了長按在後退按鈕和關閉應用程序 - 析構函數拋出一個錯誤:
An unhandled exception of type 'System.Exception' occurred in myapplication.WindowsPhone.exe
Additional information: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))