Giter Club home page Giter Club logo

Comments (4)

ButchersBoy avatar ButchersBoy commented on July 21, 2024

Ideally an implementation of IInterTabClient client should give you a hook. Perhaps in your case you want to implement IManualInterTabClient. This would allow you to manually remove from one source and add to another. This is the preferred way to jump in and manage your source collections manually.

There are also several events on the items themselves:

  • DragablzItem.DragStarted
  • DragablzItem.PreviewDragDelta
  • DragablzItem.DragDelta
  • DragablzItem.DragCompleted

You might want to use EventManager.RegisterClassHandler to create a hook.

Also, have you seen this test project? https://github.com/tstephansen/PrismExample

See where you can get by implementing IManualInterTabClient and exposing it on the InterTabController. Then if you are still stuck if you can post a little test project on GitHub I'll see if I can help you get it running.

from dragablz.

svantreeck avatar svantreeck commented on July 21, 2024

Is there an example of the ManualInterTabClient? I tried looking at the examples to see if there was a sample implementation, because just implementing IManualInterTabClient, I started getting the exception below as soon as the tab was dragged out of the original Tab Control.

System.NullReferenceException: Object reference not set to an instance of an object.
   at Dragablz.DragablzItemsControl.InstigateDrag(Object item, Action`1 continuation) in c:\projects\dragablz\Dragablz\DragablzItemsControl.cs:line 185
   at Dragablz.TabablzControl.ReceiveDrag(InterTabTransfer interTabTransfer) in c:\projects\dragablz\Dragablz\TabablzControl.cs:line 970
   at Dragablz.TabablzControl.MonitorBreach(DragablzDragDeltaEventArgs e) in c:\projects\dragablz\Dragablz\TabablzControl.cs:line 939
   at Dragablz.TabablzControl.ItemDragDelta(Object sender, DragablzDragDeltaEventArgs e) in c:\projects\dragablz\Dragablz\TabablzControl.cs:line 859
   --- End of inner exception 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 493
   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.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)
   --- End of inner exception stack trace ---

from dragablz.

ButchersBoy avatar ButchersBoy commented on July 21, 2024

OK...can you send me a project? it's the quickest way for me to fix the bug and see where you're at.

from dragablz.

svantreeck avatar svantreeck commented on July 21, 2024

I created a sample project at https://github.com/svantreeck/DragablzPrism that I think I got working. I was originally using a Dictionary to map the region items to their owning TabablzControl, but now I'm keeping track of a list of open tab controls and looping through them. It's less efficient than I wanted it to be, but in reality, at most I see probably a dozen or so items open, so O(1) vs O(N) isn't a big deal for finding the proper tab control.

from dragablz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.