I am showing a floating - screen centered view in the Dockworspace, the problem that the view is flickering and user can see the view when moving from the default location to the center location
How can I get rid of this behavior?
I don't see any good way to get this to work correctly with the current CAB support. It looks like the UltraDockSmartPartInfo would need a FloatingLocation property to set the initialize location of the floating pane. I have forwarded this post to the Developer Support Manager and a DS engineer will be contacting you about this issue. As a workaround, you could create and float a pane manually if you can get a reference to the UltraDockWorkspace.
Is the user moving the pane with the mouse, or is the pane being moved pragmatically?
Since the view is shown at the top left corner, I am centering the view programmatically in the OnLoad method of the view, but the controlbox of the parent form that host the view (userControl) is visible before entering the OnLoad method.
Oh, I see. So instead of floating the pane and then centering it programmatically, I would instead use one of the overloads of the pane's Float methods which take a Point or Rectangle parameter. This will float the pane and give it the specified location (or bounds) in one operation.
I can't see how to float the pane, I am showing the view in this way :
UltraDockSmartPartInfo dspi = new UltraDockSmartPartInfo();
dspi .DefaultLocation = Infragistics.Win.UltraWinDock.DockedLocation.Floating; WorkItem.Workspaces["_dockWorkspace"].Show(myView, dspi );
Here the DockWorspace is responsible for creating the pane and showing it in the correct place.
With this code I can get this to work :
DockableControlPane dockableControlPane = dockWorksapace.PaneFromControl(view);
if (dockableControlPane != null)
Size viewSize = new Size(900, 700);
dockableControlPane = new DockableControlPane();
dockableControlPane.Control = view;
DockAreaPane dockAreaPane = new DockAreaPane(DockedLocation.Floating);
Point centerLocation = this.GetCenterLocation(viewSize); ;
dockAreaPane.FloatingLocation = centerLocation;
dockAreaPane.Size = viewSize;
I am not sure if this is the best way .
I don't see any problems with this code.