private void AttachHandler() { #if SILVERLIGHT Application.Current.UnhandledException += OnGlobalException; #else AppDomain.CurrentDomain.UnhandledException+= OnGlobalException; #endif }