DockSite.ControlSize not bindable?

Docking/MDI for WPF Forum

Posted 15 years ago by Radu
Avatar
Hi

I have the following situation:

<docking:ToolWindowContainer docking:DockSite.ControlSize="{Binding ElementName=HelpViewer, Path=DesiredSize, Mode=TwoWay}">
                    <docking:ToolWindow x:Name="HelpPreview" Title="Help Preview" CanClose="False" HorizontalContentAlignment="Stretch">
                        <help:HelpViewerControl x:Name="HelpViewer"/>
                    </docking:ToolWindow>
The HelpViewerControl has a DependencyProperty called DesiredSize. The problem is that the ControlSize does not seem to react on binding; if I set it directly, without binding, it works. Can you please advice? Inside my HelpViewerControl I get the default value for ControlSize (200,800) that means the binding works in that direction, but not reverse.

Comments (12)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Radu,

That is correct, the ControlSize only affects layout before the layout is completely loaded. After that, it gets updated by the SplitContainer but external changes won't affect layout.


Actipro Software Support

Posted 15 years ago by Radu
Avatar
Thank you for your answer ... But then what is the recommended way to adjust the size of a ToolWindow (dockable or floating) based on the (desired) size of its content?
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Radu,

Right now you can set the ControlSize before the layout takes effect however once it has been arranged, etc. there really isn't a good way at this time to resize things. This sort of feature is something we've got on our TODO list.


Actipro Software Support

Posted 15 years ago by Radu
Avatar
:(

Ok, there is no "good" way... is there maybe a "bad" way (as I need this feature)? :)
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Radu,

Unfortunately the one idea we had in mind doesn't seem to work (closing, setting control size again, and reopening) because it's reusing the size from a hidden breadcrumb container there.

You'd probably need to call something like ToolWindow.Dock() to get a new size instantiated but that may make it dock in a different location than where it originally was if the user has moved things around and made the layout complex.

Again this is something we are aware of and will be adding something in the future to help with this issue so that you can resize things programmatically.


Actipro Software Support

Posted 14 years ago by Radu
Avatar
Sorry to raise this up again... any news regarding the possibility to adjust the size of a ToolWindow programmatically at runtime? It is a bit of a showstopper for our project and I would like to have it solved somehow. Thanks for any ideas/help.
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Radu,

Sorry this is still on the TODO list. If this is something that is critical for you, we can always be hired at an hourly rate to implement it for you. When we do that we bump it up to near top priority. Details on that are here and you can contact us for more info if you are interested:
http://www.actiprosoftware.com/Purchase/ConsultingServices.aspx


Actipro Software Support

Posted 14 years ago by Radu
Avatar
:) It is a bit strange that resizing a window at runtime is not possible... I would have seen it as a standard feature in such powerful framework as the Actipro Docking system ;)
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Radu,

Just an fyi, we've added some resizing functionality for the next maintenance release. The new functionality allows the items of a SplitContainer to be resized based on specified ratios (which is a percentage of the SplitContainer's size). But, we still have a TODO item to handle setting an explicit size on a ToolWindow/DocumentWindow/etc.


Actipro Software Support

Posted 14 years ago by Radu
Avatar
Thank you for the good news. I am looking forward to use the "TODO Item" as soon as you'll have it ready ;)
Posted 14 years ago by Dave
Avatar
Can you please clarify this comment:

"The new functionality allows the items of a SplitContainer to be resized based on specified ratios (which is a percentage of the SplitContainer's size)."

What release are these changes in? Can you provide a small sample of how to do this? We are programatically adding ToolWindows to a DockSite, and would like to resize the ToolWindow when it is created.

Thanks.
Dave
FinFolio
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Dave,

The SplitContainer.ResizeSlots method was added in WPF Studio 2009.1 build 0506. You can view the details here:

http://www.actiprosoftware.com/Support/Forums/ViewForumTopic.aspx?ForumTopicID=4306

Our Sample Browser includes a QuickStart, called "Programmatic Sizing", that shows how this method can be used.


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.