How to get currently selected DocumentContent object?

Jun 23, 2009 at 2:22 PM

Hi,

I haven't been able to work out how to get the currently selected document. Can anyone help?

I have the following XAML:

<ad:DockingManager x:Name="dockManager">
<ad:ResizingPanel Orientation="Vertical" >
                        <ad:DocumentPane x:Name="documentsHost">
                            <ad:DocumentContent Title="File1.doc">
                                <RichTextBox/>
                            </ad:DocumentContent >
                            <ad:DocumentContent Title="File2.doc">
                                <RichTextBox/>
                            </ad:DocumentContent >
                        </ad:DocumentPane>
                        <ad:DockablePane ad:ResizingPanel.ResizeHeight="200">
                            <ad:DockableContent Title="Details">
                                <TextBox />

                            </ad:DockableContent>
                       </ad:DockablePane>
                    </ad:ResizingPanel>
</ad:DockingManager>

 

I'm trying to reference the currently select item. Would've thought I could use the following:
documentsHost.Items.CurrentItem

but it doesn't work. Any suggestions?

Many thanks,
adh

Jun 23, 2009 at 2:26 PM

You just have to use dockManager.ActiveDocument.

Jun 23, 2009 at 3:02 PM

of right, doh!

Thanks so much for the quick response. I forgot about that. ;)