Docking error

Aug 24, 2009 at 8:38 PM

I am new to AvalonDock. I tried this little example:

<ad:DockingManager Name="DockManager">
     <ad:ResizingPanel Name="resizingPanel" />

Code (OnClick):

DockablePane dp = new DockablePane();
TextBox uc = new TextBox();
uc.Text = "Example";
DockableContent dc = new DockableContent();
dc.Title = "Title";
dc.Content = uc;           
dp.Width = Double.NaN;
dp.HorizontalAlignment = HorizontalAlignment.Left;

My DockableContent is displayed OK at begining. Then I move it in floating position.
When I tried to dock it to the left again, exception is thrown (ArgumentOutofRangeException - parameter: index).

What is wrong with my approach?

Thanks for help in advance!!!

Aug 25, 2009 at 11:48 AM


Change your xaml file like the following and it will work.

ad:DockingManager Name="DockManager"> <ad:ResizingPanel Name="resizingPanel" Orientation="Horizontal"> <ad:DocumentPane x:Name="_documentsHost"/> </ad:ResizingPanel> </ad:DockingManager>