0

I have a WPF app with the following subset of code for the main window:

    <ad:DockingManager x:Name="dockManager" Grid.Row="1">
        <ad:ResizingPanel Name="mainResizingPanel" Orientation="Horizontal">
                 <!- other stuff here -->
                <ad:DocumentPane Name="documentPane" DragEnter="DocumentPaneDragEnter" AllowDrop="True" Drop="DocumentPaneDrop"></ad:DocumentPane>
        </ad:ResizingPanel>
    </ad:DockingManager>

I also have code to add DocumentContent to the DocumentPane.

documentPane.Items.Add(docContent);

My implemented drag and drop functionality only works once something has been added to the documentPane. How come the documentPane won't accept a drop until it has a child object?

Seth
  • 8,213
  • 14
  • 71
  • 103

1 Answers1

0

I guess that you must set the background on that "documentPane" explicitly (via the Background property, of course).

Vladimir
  • 3,599
  • 18
  • 18
  • Ahh I did set the background to a different colour however it doesn't appear until I create the other object. How come it is not getting instantiated even though I have it in the WPF code? – Seth Aug 12 '11 at 06:30
  • Actually it is getting instantiated but its not expanding to the remaining space. – Seth Aug 12 '11 at 06:35
  • @Seth I guess that sizing in your scenario is set to Auto ad, whether you see it or not, prior to adding any child the height or width of your pane is 0. You might want to change the Width or Height of Row 1 to a fixed value or a relative one(*). – Vladimir Aug 12 '11 at 06:39
  • @Vladmir that doesn't work either. I'm starting to wonder whether this is a bug with AvalonDock. I.e. I tried setting the height to a relative value "*" and an absolute value. – Seth Aug 12 '11 at 06:55
  • 1
    Could be. Anyway, make sure first that in the moment you drop over your desired control, its (actual) size it is indeed larger than 0. It is possible that even if you set that RowDefinition 1's Height to * or fixed, the other panels are not docked properly or are automatically collapsed, something like that. – Vladimir Aug 12 '11 at 07:00