You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While looking to see if this issue was addressed, I feel like I've seen similar issues with focusing or using Keyboard.Focus(). However most of those caused a NullReferenceException.
I am getting an InvalidOperationException when I drag the tab of a document to cause it to float. It seems to occur when the document contains a CustomControl which calls Focus() within it's OnApplyTemplate() method.
It seems to happen because when focusing I think the Dispatcher suspends messages but LayoutFloatingWindowControl sends a message in its OnActivated method.
I was running a local copy of AvalonDock when I encountered it and I changed the code to:
Application.Current.Dispatcher.BeginInvoke(()=> Win32Helper.SendMessage( windowHandle, Win32Helper.WM_NCLBUTTONDOWN, new IntPtr( Win32Helper.HT_CAPTION ), lParam ));
and it works for my purposes so far, although I have no idea if there will be any side effects?
It is extremely simple to reproduce. Attached is a folder containing the solution, a README explaining basically what I said here, and a file called "InvalidOperationException.txt" containing the exception info and CallStack of the error. AvalonDockError.zip
Also, I believe this is completely unrelated, but while looking into this issue, I found that Microsoft discourages the use of SendMessage without checking InSendMessage to avoid deadlocks. Messages are a little over my head though and again I believe this to be unrelated as I've tried this and InSendMessage returned false but the error still occurred.
The text was updated successfully, but these errors were encountered:
While looking to see if this issue was addressed, I feel like I've seen similar issues with focusing or using
Keyboard.Focus()
. However most of those caused aNullReferenceException
.I am getting an
InvalidOperationException
when I drag the tab of a document to cause it to float. It seems to occur when the document contains aCustomControl
which callsFocus()
within it'sOnApplyTemplate()
method.It seems to happen because when focusing I think the
Dispatcher
suspends messages butLayoutFloatingWindowControl
sends a message in itsOnActivated
method.I was running a local copy of AvalonDock when I encountered it and I changed the code to:
and it works for my purposes so far, although I have no idea if there will be any side effects?
It is extremely simple to reproduce. Attached is a folder containing the solution, a README explaining basically what I said here, and a file called "InvalidOperationException.txt" containing the exception info and CallStack of the error.
AvalonDockError.zip
Also, I believe this is completely unrelated, but while looking into this issue, I found that Microsoft discourages the use of
SendMessage
without checkingInSendMessage
to avoid deadlocks. Messages are a little over my head though and again I believe this to be unrelated as I've tried this andInSendMessage
returned false but the error still occurred.The text was updated successfully, but these errors were encountered: