This project is read-only.

Can we set a Fixed with for a dockable content

Aug 26, 2009 at 4:45 PM


I would like to create a dockable content but with a fixed size, can we do this ?



Aug 26, 2009 at 7:16 PM

Makes it sense?
Try to set it with an initial size.


Aug 27, 2009 at 7:23 AM


I would like to create a kind of vertical toolbar, by example.

I have try to set :

- Width

- MinWidth and MaxWidth


I have try this on any control... but it doesn't work :-(

Aug 27, 2009 at 10:16 AM

Try the same as in your first post:

Add the "ad:ResizingPanel.ResizeWidth" property shown in the sample:

<ad:DockablePane Name="DockPaneLeft" Padding="5" ad:ResizingPanel.ResizeWidth="200">

But that is only the initial width. The user can resize it after showing for the first time.
When you have more than one DockableContent in your DockablePane, what about the other ones?

Why don't you use a WrapPanel for that?

Aug 27, 2009 at 11:16 AM

Because I would like to be able to move and and to have a "floating" toolbox... like in Photosjop CS 4.


Take a look :

Aug 27, 2009 at 2:03 PM
Edited Aug 27, 2009 at 2:05 PM

for the first try you can set the floating window size by:

_propertiesWindow.FloatingWindowSize = new Size(50,50);

or in xaml:
<ad:DockableContent x:Name="_propertiesWindow" Title="Properties" DockableStyle="Dockable" FloatingWindowSize="100,50">

I think it should be possible to set the floating window with a fixed size. But what happens when a user
dock it at one side in docking mode. Then he can change the size.

I don't want to change so many things in the control because I'm not the developer and I changed so many things
to get it work. When ado or Christop is back I think it will be possible.

Aug 27, 2009 at 2:13 PM



I have try this by setting


<ad:DockableContent x:Name="_toolbox" Title="Tools" DockableStyle="DockableToBorders" FloatingWindowSize="44,250">


but when I set it as floating, the 'toolbox' has a 'random' size :-(

Aug 27, 2009 at 2:19 PM

Ok, I did it:

Add the following after FloatingWindowSize in ManagedContent.cs:

        ResizeMode _floatingResizeMode = ResizeMode.CanResize;
        public ResizeMode FloatingResizeMode
            { return _floatingResizeMode; }
            { _floatingResizeMode = value; }

Then change DockableFloatingWindow.cs as (insert the red line)

        public DockableFloatingWindow(DockingManager manager, DockablePane dockablePane)
: this(manager)
//create a new temporary pane FloatingDockablePane pane = new FloatingDockablePane(this);

//setup window size ManagedContent selectedContent = dockablePane.SelectedItem as ManagedContent;

if (selectedContent != null && selectedContent.FloatingWindowSize.IsEmpty)
selectedContent.FloatingWindowSize = new Size(dockablePane.ActualWidth, dockablePane.ActualHeight);

if (selectedContent != null)
Width = selectedContent.FloatingWindowSize.Width;
Height = selectedContent.FloatingWindowSize.Height;
this.ResizeMode = selectedContent.FloatingResizeMode;
else { Width = dockablePane.ActualWidth; Height = dockablePane.ActualHeight; } //Width = dockablePane.ActualWidth; //Height = dockablePane.ActualHeight; ////save current content position in container pane //pane.SetValue(ResizingPanel.ResizeWidthProperty, dockablePane.GetValue(ResizingPanel.ResizeWidthProperty)); //pane.SetValue(ResizingPanel.ResizeHeightProperty, dockablePane.GetValue(ResizingPanel.ResizeHeightProperty)); int selectedIndex = dockablePane.SelectedIndex;

//remove contents from container pane and insert in hosted pane while (dockablePane.Items.Count > 0)
ManagedContent content = dockablePane.RemoveContent(0);

//add content to my temporary pane pane.Items.Add(content); } //let templates access this pane HostedPane = pane; HostedPane.SelectedIndex = selectedIndex; //Change state on contents IsDockableWindow = true;

Now you can use it like this in xaml:

<ad:DockableContent x:Name="_propertiesWindow" Title="Properties" DockableStyle="Dockable" FloatingWindowSize="70,200" FloatingResizeMode="NoResize">

Now the size is fixed in floating mode and is variable in docking mode.

I hope that helps.

Best regards,


Aug 27, 2009 at 2:31 PM

Thanks a lot,


I have do the changes, but it remain the same !!! ... I use the last "source code" version of the library.


Is there something else I have to change ?


Aug 27, 2009 at 4:45 PM
Edited Aug 27, 2009 at 4:46 PM

No, I think that's all.
I made some other changes and wait to get ado (the coordinator) back in this discussion.

If you give me a mail address, I can send you my package with the working demo.