About TabDragReordered event

Docking/MDI for WPF Forum

Posted 1 year ago by Albert Vishnevsky
Version: 23.1.0
Avatar

Hi!

You have a cool TabDragReordered event for AdvancedTabControl.
But I use the DocumentItems in DockSite and do not see this event.
Now, I use WindowsDragged event and reflection to get old and new indexes.
Maybe you have the similar event (TabDragReordered) for DocumentItems.
 
Could you provide the best solution to catch changing order of tabbed documets?

Thank you very much.
Albert

Comments (2)

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Albert,

DockSite doesn't expose its own similar event for a drag/reorder scenario.  Instead, a drag/reorder will raise the DockSite.WindowsDragging and WindowsDragged events in immediate sequence, specifying the docking window being dragged in the event args.  Any time these events occur, the docking windows in the event args should be moving to other locations than where they were originally, regardless of if it's in the same or a different container.  Therefore those events are good to handle logic that should execute on any drag and move.

While we don't have a specific flag in the event args to indicate a drag/reorder in the same container, you could watch for that scenario.  If you see a single docking window in the WindowsDragging event args, you could persist a reference to the docking window, its current container (via DockingWindow.ParentContainer), and index.  Then in a WindowsDragged event handler, if you see the same docking window and ParentContainer, you then know it was for a drag/reorder.

I hope that helps!


Actipro Software Support

Posted 1 year ago by Albert Vishnevsky
Avatar

Thank you very much.

The latest build of this product (v24.1.3) was released 27 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.