[Version 1.3] RestoreLayout doesn't do anything for me

Jun 14, 2010 at 4:30 PM

Is RestoreLayout not yet complete in v1.3? It seems completely broken to me. In case it's a bug, here's my XAML. I'm calling RestoreLayout in the Loaded event handler for my window. I've tried it with and without a BeginInvoke call.

<Window x:Class="Client.Wpf.FormEditorWindow"
        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"
        xmlns:fec="clr-namespace:Client.Wpf.FormEditorControls"
        Title="Forms Editor" Height="480" Width="640">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="24"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="24"/>
        </Grid.RowDefinitions>
        <Menu>
            <MenuItem Header="Application">
                <MenuItem Header="Save" Command="Save"/>
                <MenuItem Header="Refresh" Command="Refresh"/>
                <MenuItem Header="Close" Command="Close"/>
            </MenuItem>
        </Menu>

        <ad:DockingManager x:Name="dockManager" Grid.Row="1">
            <ad:ResizingPanel Orientation="Horizontal">
                <ad:ResizingPanel ad:ResizingPanel.ResizeWidth="160">
                    <ad:DockablePane>
                        <ad:DockableContent Title="Forms" x:Name="formListContent">
                            <fec:FormListControl />
                        </ad:DockableContent>
                    </ad:DockablePane>
                </ad:ResizingPanel>
                <ad:DocumentPane SelectedIndex="0">
                    <ad:DocumentContent Title="Designer">
                        <ad:ResizingPanel Orientation="Vertical">
                            <ad:ResizingPanel Orientation="Horizontal">
                                <ad:DockablePane>
                                    <ad:DockableContent Title="Canvas" x:Name="canvasContent">
                                        <fec:CanvasControl/>
                                    </ad:DockableContent>
                                </ad:DockablePane>
                                <ad:ResizingPanel Orientation="Vertical" ad:ResizingPanel.ResizeWidth="200">
                                    <ad:DockablePane>
                                        <ad:DockableContent Title="Controls" x:Name="controlListContent">
                                            <fec:ControlListControl/>
                                        </ad:DockableContent>
                                    </ad:DockablePane>
                                    <ad:DockablePane>
                                        <ad:DockableContent Title="Properties" x:Name="propertiesContent">
                                            <fec:PropertiesControl/>
                                        </ad:DockableContent>
                                    </ad:DockablePane>
                                </ad:ResizingPanel>
                            </ad:ResizingPanel>
                            <ad:DockablePane ad:ResizingPanel.ResizeHeight="160">
                                <ad:DockableContent Title="Constraints" x:Name="constraintsContent">
                                    <fec:ConstraintsControl/>
                                </ad:DockableContent>
                            </ad:DockablePane>
                        </ad:ResizingPanel>
                    </ad:DocumentContent>
                    <ad:DocumentContent Title="Permissions">
                        <fec:PermissionsControl/>
                    </ad:DocumentContent>
                </ad:DocumentPane>
            </ad:ResizingPanel>
        </ad:DockingManager>

        <StatusBar Grid.Row="2">
            <StatusBarItem Content=""/>
        </StatusBar>
    </Grid>
</Window>

Jun 14, 2010 at 4:37 PM

PS, it seems that the SelectedIndex property doesn't work in the above code either. It always selects the second document tab when it runs.

 

Jun 15, 2010 at 9:59 AM

you're xaml is quite strange! I can see dockablepanes inside document contents, also I see resizing panels that contain only one child...maybe you could start working with AD using the tutorial under the documentation tab.

can you post layout xml you're restoring? also could you please specify what is not restored (a content, a pane or the whole layout) ?

Regarding the SelectedIndex issuer, thanks for the feedback; I've added it to the pending issue list :)

Ado

 

 

 

Jun 15, 2010 at 7:02 PM

If it's not appropriate to put dockablepanes inside a document tab, then we should throw an error at runtime or compiletime. I assume that's causing most of my issues. It's fairly common to have resizing panels with only one child during development. I think that should be supported (or chuck an error otherwise rather than silently fail).