Add functionality to ToolWindowContainer

Docking/MDI for WPF Forum

Posted 10 years ago by Jaspis
Version: 9.2.0515
Avatar
Hi,
I have a ToolWindowContainer and I want to add a new button next to the close button. Therefore I changed the default style of the ToolWindowContainer. This works fine.

The complete layout of my docksite is stored using the DockSiteLayoutSerializer.
If I reference my custom ToolWindowContainer style per key
( <docking:ToolWindowContainer Style="{StaticResource MyToolWindowContainerStyle}"> ) this style information is not serialized. So when I serialize and deserialize the layout, the ToolWindowContainer has the default style.
How can I achieve to serialize / deserialize my layout using my custom style?

Thanks Jaspis

[Modified at 03/30/2010 08:40 AM]

Comments (3)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jaspis,

Setting any property or Style on ToolWindowContainer instances is not a good idea because they are created and destroyed dynamically at runtime as the user moves docking windows around.

Instead, you can apply an implicit style for ToolWindowContainer in your app's resources. That way it will be applied to any ToolWindowContainer control that is created.


Actipro Software Support

Posted 10 years ago by Jaspis
Avatar
Hi,

thanks for your quick answer.
The problem is that I want to add the style to only one ToolWindowContainer, not to all.

If that is not possible, is there a way to change the behaviour of saying the maximize button without retemplating the ToolWindowContainer?

Jaspis

[Modified at 03/31/2010 01:33 AM]
Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jaspis,

That will work for your initial setup and you could probably get it to work even after a layout load, however note that as soon as you start dragging the tool window around at run-time your single instance will be destroyed in certain scenarios. That's why I was saying it's never safe to name or set any settings on specific docking window container instances.

We don't have a way to add custom buttons at this time other than retemplating ToolWindowContainer. I believe it's an item on our TODO list so I'll mark this post down with that item.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) 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.