void _sys_ErrorOccured(object sender, ErrorArgs e)
        {
            Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => {

            MessageDialog.Show(MessageType.Error, e.Message, e.Exception);

              }));
        }
        private void System_ErrorOccured(object sender, ErrorArgs e)
        {
            OnError(e);

              if( e.Fatal )
            Application.Current.Shutdown();
        }
        private void MessageMgr_ErrorOccured(object sender, ErrorArgs e)
        {
            MessageBox.Show(e.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);

              if( e.Fatal )
            Application.Current.Shutdown();
        }
 protected void OnError(ErrorArgs arg)
 {
     if( ErrorOccured != null )
     ErrorOccured(this, arg);
 }
 void _sys_ErrorOccured(object sender, ErrorArgs e)
 {
     MessageDialog.Show(MessageType.Error, e.Message, e.Exception);
 }