Using DockingCommands.ActivateWindow and DockingCommands.CloseWindow with nested docksite

Docking/MDI for WPF Forum

Posted 9 years ago by eric
Version: 14.2.0611
Platform: .NET 4.5
Environment: Windows 8 (64-bit)
Avatar

Hi,

in my application that have a single docksite im using:

DockingCommands.ActivateWindow.Execute(Nothing, thePanel)

and

DockingCommands.CloseWindow.Execute(Nothing, thePanel)

to show/hide a ToolWindow successfully.

Althought I have another application that have 1 big docksite with two nested docksite inside.

Now the:

DockingCommands.ActivateWindow.Execute(Nothing, thePanel)

and

DockingCommands.CloseWindow.Execute(Nothing, thePanel)

doesn't work anymore. I understand that I must somehow indicate in which docksite this panel is located but im not sure how.

Thanks for the assistance.

Comments (4)

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

Hi Eric,

The DockingWindow class (base class of ToolWindow and DocumentWindow) contains command bindings for those commands.  Is your "thePanel" a ToolWindow or DocumentWindow?  If so, it should be working.


Actipro Software Support

Posted 9 years ago by eric
Avatar

Yes thePanel is a ToolWindow. Altough it is not working.

I am currently moving this project from AvalonDock control to Actipro, maybe i did something wrong but like i say the transition was working fine for other project that doesn't have nested docksite.

Is this call ok to do? DockingCommands.ActivateWindow.Execute(Nothing, thePanel)

or do i need to do: thePanel.Activate and thePanel.Close?

Please note that in my other project i tried to use thePanel.Activate and thePanel.Close but was not working. When i used the DockingCommands it started to work.



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

Calling the Activate() and Close() methods is recommended over the commands.  The command handlers in fact just call those methods directly, so I can't see how the commands would work but the method wouldn't.

It's hard to say why it's not working in your scenario since there aren't really any reported problems with those methods.  If you can't figure it out, please make a new simple sample project showing the issue and mail it in a zip with renamed file extension to our support address so that we can debug it.  Please reference this thread in your email.


Actipro Software Support

Posted 9 years ago by eric
Avatar

Ok i'm sorry, finally its because the toolwindow CanClose flag was set to False.

Sorry to have disturbed you with this stupid matter :)

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

Add Comment

Please log in to a validated account to post comments.