start a floating window that is dockable

Sep 22, 2009 at 6:18 PM

Hi Ado,

I have a class that derives from DockableConent called DockableReportWindow and this class hosts a reportviewer winforms control.

I want to show my DockableReportWindow in a FloatingWindow with height set to 400 and width set to 800 px and that is dockable to any side of the docking manager or the document pane and also dockable to the center of the document pane.

How can I achieve this?

Thanks

sg.

 

Sep 23, 2009 at 3:33 PM
Edited Sep 23, 2009 at 3:33 PM

Hi, I'm a little new to Avalon myself but I accomplished this programmatically as follows:

//newContent is your ContentControl
DockablePane pane = new DockablePane(); //temporary pane to add content to

DockableContent dockContent = new DockableContent();
dockContent.Content = newContent;
dockContent.FloatingWindowSize = new Size(400, 400);
pane.Items.Add(dockContent);

DockableFloatingWindow floatingWindow = new DockableFloatingWindow(owner, dockContent);
dockContent.SetAsActive();
floatingWindow.Show();

I hope that helps.

 

Sep 25, 2009 at 3:19 PM

This seems to work too:

//regionTarget is a DockingManager
//newContent is a ContentControl
DockableContent dockContent = new DockableContent();
dockContent.Content = newContent;
regionTarget.Show(dockContent, dockableContentState.FloatingWindow);