Advertisement
Guest User

Untitled

a guest
May 24th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. public partial class App : Application
  2. {
  3. /// <summary>
  4. /// WPF bug or smth else... Fixed in net fx 4.5 but in 4.6.1 not o_O
  5. /// COM exception in datagrid copypaste
  6. /// </summary>
  7. /// <param name="sender"></param>
  8. /// <param name="e"></param>
  9. private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
  10. {
  11. var comException = e.Exception as System.Runtime.InteropServices.COMException;
  12.  
  13. if (comException != null && comException.ErrorCode == -2147221040)
  14. e.Handled = true;
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement