DocumentClosed not raised

Jan 14, 2010 at 5:51 PM

Hi there,

I'm trying to receive a notification when a DockableContent inside a DocumentPane is closed or about to get closed by the user.

I've attached an event handler to DockingManager.DocumentClosed but it's never executed.

Please advise.

Here's my XAML:

<Window x:Class="WpfApplication1.AvalonDockTest"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
    Title="AvalonDockTest" Height="300" Width="300">
    <Grid>
        <ad:DockingManager DocumentClosed="DockingManager_DocumentClosed">
            <ad:DocumentPane>
                <ad:DockableContent Title="Hello1" HideOnClose="False">
                    <TextBlock>haha</TextBlock>
                </ad:DockableContent>
                <ad:DockableContent Title="Hello2" HideOnClose="False">
                    <TextBlock>asdfadsf</TextBlock>
                </ad:DockableContent>
            </ad:DocumentPane>
        </ad:DockingManager>
    </Grid>
</Window>