Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get an unhandled exception in Dragablz code when I tear off tab #98

Open
ghost opened this issue Apr 19, 2016 · 11 comments
Open

Get an unhandled exception in Dragablz code when I tear off tab #98

ghost opened this issue Apr 19, 2016 · 11 comments

Comments

@ghost
Copy link

ghost commented Apr 19, 2016

here is the stack trace

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Windows.RoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at Dragablz.DragablzItem.ThumbOnDragDelta(Object sender, DragDeltaEventArgs dragDeltaEventArgs) in C:\projects\dragablz\Dragablz\DragablzItem.cs:line 541
at System.Windows.Controls.Primitives.DragDeltaEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.Controls.Primitives.Thumb.OnMouseMove(MouseEventArgs e)
at System.Windows.UIElement.OnMouseMoveThunk(Object sender, MouseEventArgs e)
at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at obj\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

@ButchersBoy
Copy link
Owner

ButchersBoy commented Apr 19, 2016

Are you running inside a Layout? It's a null ref exc, right? Is this intermittent, or every time?

@creeves2
Copy link

Yes its a null reference. Not sure what you mean by layout. I have a bunch of user controls inside the tabcontrol. I am using the mhapps as well.

It only gives this error some of the time. It happens when I slowly drag the tab out. If I quickly move the tab it doesnt happen.

@ButchersBoy
Copy link
Owner

Can you visually see the new window get created before the crash? Or does it just seem to die immediately?

@creeves2
Copy link

I see the window get generated. But as I drag it out it freezes, and gives
this exception.

On Tue, Apr 19, 2016 at 9:02 AM, James Willock notifications@github.com
wrote:

Can you visually see the new window get created before the crash? Or does
it just seem to die immediately?


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#98 (comment)

@creeves2
Copy link

If I drag it out, by dragging it super quickly, not holding the mouse
button down for too long it will work

On Fri, Apr 22, 2016 at 9:19 PM, Christopher Reeves cjreeves01@gmail.com
wrote:

I see the window get generated. But as I drag it out it freezes, and gives
this exception.

On Tue, Apr 19, 2016 at 9:02 AM, James Willock notifications@github.com
wrote:

Can you visually see the new window get created before the crash? Or does
it just seem to die immediately?


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#98 (comment)

@SCKelemen
Copy link

I have the same issue. I can reorder fine, but if I leave the bounding tabheader area, it freezes and crashes.
image

@ghost
Copy link
Author

ghost commented Jun 23, 2016

This exception happens when I have a tabcontrol inside one of my tabs. I must first visit the tab that contains the tabcontrol, then I can drag them properly.

If I try to drag the tabs without first visiting the tabcontrol that contains sub-tabs it will give the exception.
Does the tabs do some initialization when they are displayed? Because if I just visit the tab with sub-tabs first, then everything works.

@SCKelemen
Copy link

@creeveshft I'll have to test that thought tomorrow.

@ButchersBoy
Copy link
Owner

@SCKelemen ...a lot is happening when you tear out; creating a new window & visual tree, moving the tab content to the new items source. This invariably involve executing some of your systems code too. You'll have to post a full stack trace, or even better post a demo repo.

@SCKelemen
Copy link

@ButchersBoy it started working again for me. It seems like it might be a race condition. I'll look into it more, when I can reliably reproduce the error.

@ghost
Copy link
Author

ghost commented Dec 1, 2016

I was able to fix this error by adding

<Window.Resources> <dragablz:InterTabController x:Key="InterTabController" x:Shared="False" /> <Style TargetType="dragablz:TabablzControl" BasedOn="{StaticResource {x:Type dragablz:TabablzControl}}"> <Setter Property="IsTabStop" Value="False" /> <Setter Property="Focusable" Value="False" /> <Setter Property="HeaderMemberPath" Value="Name" /> <Setter Property="BorderThickness" Value="0" /> <Setter Property="InterTabController" Value="{StaticResource InterTabController}" /> </Style> </Window.Resources>

x:Shared = false fixed the issue for me, also I updated to the latest NuGet package :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants