Hi, Dear DevExpress Support:
Out team updated the version of DevExpress from 11.2.14 to 15.1.6.0, and we found a new problem in the DockLayoutManager.
Firstly, please check the ticket "T219581 The CPU usage is greater on mouse over if the DockLayoutManager is used". Finally , we got a workaround [dxSample.zip] from Andrey Marten, which resovled our problem successfully. But now, after updated to 15.1.6.0, a error happened when I want to drag and drop the top-left tab in the DockLayout.
The codes are:
C#void RootUIElementMouseMove(object sender, MouseEventArgs e) {
if(DockPane.GetHitTestType(e.OriginalSource as DependencyObject) != DevExpress.Xpf.Docking.Base.HitTestType.ControlBox) return;
OnMouseMove(EventArgsHelper.Convert(RootUIElement, e));
}
And the error info is:
System.NullReferenceException: Object reference not set to an instance of an object.
at DevExpress.Xpf.Docking.Platform.TabHeaderInsertHelper.GetIntervals(ILayoutContainer container)
at DevExpress.Xpf.Docking.Platform.TabHeaderInsertHelper…ctor(IDockLayoutContainer container, Point point, Boolean canInsertAfterAll)
at DevExpress.Xpf.Docking.Platform.LayoutViewReorderingListener.InsertionHelper.Update(DockLayoutElementDragInfo dragInfo, Boolean isStartedAsReordering)
at DevExpress.Xpf.Docking.Platform.LayoutViewReorderingListener.InsertTabPageCore(DockLayoutElementDragInfo dragInfo)
at DevExpress.Xpf.Docking.Platform.LayoutViewReorderingListener.OnDragging(Point point, ILayoutElement element)
at DevExpress.Xpf.Layout.Core.Dragging.DragServiceState.DoDragging(IView view, Point point, OperationType type)
at DevExpress.Xpf.Layout.Core.Dragging.DragServiceState.DoDragging(IView view, Point point)
at DevExpress.Xpf.Layout.Core.Dragging.ReorderingDragServiceState.ProcessMouseMove(IView view, Point point)
at DevExpress.Xpf.Layout.Core.Dragging.DragService.ProcessMouseCore(IView processor, Point screenPoint, MouseEventType eventType, MouseEventArgs e)
at DevExpress.Xpf.Layout.Core.Dragging.DragService.ProcessMouseOverride(IView view, MouseEventType eventType, MouseEventArgs ea)
at DevExpress.Xpf.Layout.Core.UIService.ProcessMouse(IView view, MouseEventType eventType, MouseEventArgs ea)
at DevExpress.Xpf.Layout.Core.Platform.ViewAdapter.ProcessMouseEvent(IView view, MouseEventType eventType, MouseEventArgs ea)
at DevExpress.Xpf.Layout.Core.Platform.BaseView.OnMouseMove(MouseEventArgs ea)
at CFETS.NTP.CLT.Infrastructure.Presentation.Workspace.Subscriber.RootUIElementMouseMove(Object sender, MouseEventArgs e)
Could you kindly check this for me? Thank you very much.
Hi,
I have tested the aforementioned sample and noticed that Drag & Drop doesn't work in 11.2.14 so I cannot drag the panel. When I run the sample in 15.1.6, the DockLayoutManager is not shown at all. Please review the attached screencast and let me know if I missed any important steps.
Hi,
I have changed my sample, Please check the attachment.
Thank you very much.
Hello
Thank you for providing the test project. However, I cannot replicate this issue on our side. I have attached a screencast illustrating my actions. Please take a moment to review it. Probably, I messed something essential.
Thanks,
Elliot
Hi
Thank you for the quick reply.
I'm sorry for my mistake. I checked my codes and found the right way to show the problem. Please check the new sample in the attachment.
Hi Li,
I've reproduced the exception on my side. In the meantime, it is not clear why you need to add/remove a panel in the DockItemEndDocking event handler (the exception vanishes if you comment out the code in the event handler). Would you please elaborate on this?
Thanks,
Alex
Hi, Alexander:
Thank you for the quick reply.
As you know, the "pnlNewPanel" is just a documentPage which is named as "+" and can't be floated or closed. In my project,
this "+" tab's function is , when click this tab header,a new documentPage will be added in its front. And the "+" tab page must be setted in the last position of the documentGroup. But beacause other documentpanels can be draged and dropped, sometimes the "+" tab page is not in the last position. So we added a method to "DockItemEndDocking" to remove the "+" tab page, and add a new one in the last position when other documentPanels is draged and dropped.
I have changed my Sample, you can check it in the attachment.
I also add the wrong_position picture to the attachment, you can check the wrong point.
Thanks
Thank you for your sample project, Li. I have passed this ticket to our developers for further research. In the meantime, as a solution, you can use the BeginInvoke method in the following manner:
Dispatcher.BeginInvoke(new Action(() => { _documentGroup.Remove(_pnlNewPanel); _documentGroup.Add(_pnlNewPanel); }));
Thanks,
Alexander
Hi,Alexander Rus:
Your solution is cool. Now the project worked with no exceptions.
Thank you very much.
You are always welcome, Li