[Version 1.3 - .NET3.5] DocumentPane Closing event

Jul 12, 2010 at 11:28 AM

Hi

Using MVVM with Unity. .NET 3.5 libs version 1.3.3571.0.

When I add a new view (of type DocumentContent) into a Region of type DocumentPane, then remove it again, the region still thinks the view is still inside it....so I cannot add another view of the same name in....is there any command that I can bind to when the user presses the X in the tab to close the tab?

Shell:


       

<AvalonDock:DockingManager Name="DockingManager" Grid.Row="1">
            <AvalonDock:ResizingPanel Orientation="Vertical">
                <AvalonDock:ResizingPanel Orientation="Horizontal">

                    <AvalonDock:DockablePane Name="LeftRegion" Regions:RegionManager.RegionName="LeftRegion"
                                             AvalonDock:ResizingPanel.ResizeWidth="200" Width="200" MinWidth="200" />
                    
                    <AvalonDock:DocumentPane Name="ScreensRegion" Regions:RegionManager.RegionName="ScreensRegion" />
                    
                </AvalonDock:ResizingPanel>

                <AvalonDock:DockablePane Name="BottomRegion" Regions:RegionManager.RegionName="BottomRegion"
                                         AvalonDock:ResizingPanel.ResizeHeight="200" Height="200" />
                
            </AvalonDock:ResizingPanel>
        </AvalonDock:DockingManager>

 

(Im inserting the views into the ScreensRegion).

 

View:

<AvalonDock:DocumentContent
    x:Class="App.Module.ScreenEditor.Views.ScreenEditorView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:AvalonDock="clr-namespace:AvalonDock;assembly=AvalonDock"
    mc:Ignorable="d"
    Title="{Binding ScreenTitle}"
    Width="1280"
    Height="800"
    >
    
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0"
                   FontSize="20">Screen Editor</TextBlock>
        <TextBlock Grid.Row="1" Text="{Binding ScreenTitle}" />
    
    </Grid>
    
</AvalonDock:DocumentContent>

Thank you
Gareth Evans

 

 

 

Jul 12, 2010 at 12:01 PM

You could handle the DockingManager.DocumentClosing/Close events,

(looking at your xaml: at the moment ResizingPanel doesn't handle the min/maxwidth/height of contained panes)

Ado

Jul 12, 2010 at 12:33 PM

Thanks for the reply.

How would I go about accessing DockingManager?

As the DockingManager (above XAML) is in the Shell project and the View (above XAML) is in a separate projects.

Does the DockingManager implement an interface or anything?

Thank you

GE

 

 

 

Jul 12, 2010 at 12:36 PM

Found it...

The Manager property on the View as it implements AvalonDock:DocumentContent :D

GE