我有一类本身就是一个事件分配:析构函数的碰撞
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))