[AvalonDock 2.0.1363] Initial size of pane

Aug 16, 2012 at 6:24 AM

If the user opens a new pane I want it to be floating. In order to achieve this I have this code:

        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
			LayoutAnchorablePane destPane = destinationContainer as LayoutAnchorablePane;

			if(destPane != null)
				return true;
			return false;

This works so far, except that the new floating pane does not have the size I want it to have.

How can I set width and hight of the new floating pane?

I tried setting FloatingWidth and FloatingHeight to no avail.

Aug 16, 2012 at 5:33 PM
Edited Aug 16, 2012 at 5:43 PM


have you tried the Floating[Height|Width] properties?




EDIT: Read to fast. But tried the same with the Demo-App which works perfectly. Perhaps you have set the properties in the style/xaml? Have you set the properties on the anchorableToShow object (and not to the destPane)? Make sure that you set the size before (!) the Float() operation.

Aug 17, 2012 at 8:10 AM

Hello micro,

your hint to set the size before calling Float() did the trick.

It works now, no matter whether I set the desired size on the anchorableToShow or the destPane.

Do you know what is the difference, if I set it on anchorableToShow or on destPane?