Programatically creating the docksite with the toolwindow.

Docking/MDI for WPF Forum

Posted 11 years ago by keshav bansal
Version: 12.2.0571
Avatar

Hi,

How to Programatically creating the docksite with the toolwindow in floated state.

I have docksite named docksite1 and it have two toolwindows named toolwidnow1 and toolwidnow2 in docksite1 of  my main application. If i drag the toolwindow named toolwidnow1 and  float it then i want to remove this toolwindow from the docksite1 and want to programatically create the new docksite and add the toolwindow1 in that new docksite and float this toolwindow.

Code used given below in the window state change event handler of the docksite1.

void docksite1_WindowStateChanged(object sender, ActiproSoftware.Windows.Controls.Docking.DockingWindowStateChangedEventArgse)

{

docksite1.ToolWindows.Remove(toolwidnow1 );

ToolWindowContainer container = newToolWindowContainer();container.Items.Add(toolwidnow1 );

DockSite newdocksite = newDockSite();

newdocksite.LinkDockSite(docksite1);

toolwidnow1 .Float(newSize(200,200));

}

 I am able to create the new docksite and remove the toolwindow fro the existing docksite but i am not able to drag the toolwindow1 in the newdocksite.

Comments (3)

Answer - Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Keshav,

You should never directly work with tool window containers, since what you are doing there won't work. Instead, do something like this probably:

docksite1.ToolWindows.Remove(toolwindow1);
DockSite newdocksite = new DockSite();
newdocksite.LinkDockSite(docksite1);
newdocksite.ToolWindows.Add(toolwindow1);
toolwindow1.Float(new Size(200,200));


Actipro Software Support

Posted 11 years ago by keshav bansal
Avatar

Hi,

I am able to remove the toolwindow1 from the  docksite1 and also able to create the new docksite and add the removed toolwindow1 in the new docksite.

But I am Not able to drag this toolwindow which Now exists in the new docksite.

Just because of not able to drag ,I am also not able to dock this toolwindow1 from the new docksite to the docksite1 with the help of LinkDockSite . 

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Keshav,

Sorry but its hard to say what the problem could be without a simple sample project. If you'd like us to look into it, please make a new small sample and email it to our support address. Rename the .zip file extension so it doesn't get spam blocked.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.