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?
Regards.
I don't see any problems with this code.
With this code I can get this to work :
DockableControlPane dockableControlPane = dockWorksapace.PaneFromControl(view);
if (dockableControlPane != null)
{
dockableControlPane.Show();
dockableControlPane.Activate();
}
else
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;
dockAreaPane.Panes.Add(dockableControlPane);
dockWorksapace.DockAreas.Add(dockAreaPane);
dockAreaPane.Float(true, centerLocation);
I am not sure if this is the best way .
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.
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.
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.