Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Auto for DockHeight #298

Open
EtienneLaneville opened this issue Aug 24, 2021 · 1 comment
Open

Using Auto for DockHeight #298

EtienneLaneville opened this issue Aug 24, 2021 · 1 comment

Comments

@EtienneLaneville
Copy link

Using Auto for DockHeight on a LayoutAnchorablePane works some of the time when editing the XAML in Visual Studio but doesn't work at run time. Here's a simple example that demonstrates the problem:

<Window x:Class="MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:avalonDock="clr-namespace:AvalonDock;assembly=AvalonDock"
        xmlns:avalonDockLayout="clr-namespace:AvalonDock.Layout;assembly=AvalonDock"
        xmlns:local="clr-namespace:AutoDockHeightTest"
        mc:Ignorable="d"
        Title="Auto Dock Height"
        Height="450"
        Width="800">
    <Grid>

        <avalonDock:DockingManager x:Name="dockingManager"
                                   AllowMixedOrientation="True">

            <avalonDockLayout:LayoutRoot x:Name="layoutRoot">

                <avalonDockLayout:LayoutPanel x:Name="mainLayoutPanel"
                                              Orientation="Vertical">

                    <avalonDockLayout:LayoutAnchorablePane DockHeight="Auto"
                                                           Name="autoSizePane">
                        <avalonDockLayout:LayoutAnchorable Title="Auto Size">
                            <Border Background="Aquamarine">
                                <Expander Header="Auto Size Anchorable">
                                    <Border Background="Fuchsia"
                                            Height="100">
                                        <TextBlock Text="Hidden content" />
                                    </Border>
                                </Expander>
                            </Border>
                        </avalonDockLayout:LayoutAnchorable>
                    </avalonDockLayout:LayoutAnchorablePane>

                    <avalonDockLayout:LayoutAnchorablePane DockHeight="*"
                                                           Name="relativeSizePane">
                        <avalonDockLayout:LayoutAnchorable Title="Relative Size">
                            <Border Background="Aquamarine">
                                <TextBlock Text="Relative Size Anchorable" />
                            </Border>
                        </avalonDockLayout:LayoutAnchorable>
                    </avalonDockLayout:LayoutAnchorablePane>

                </avalonDockLayout:LayoutPanel>
            </avalonDockLayout:LayoutRoot>
        </avalonDock:DockingManager>

    </Grid>
</Window>

This is how the Window shows up in Visual Studio:

image

When you run the project though, the Window shows up like this:

image

@mattico
Copy link

mattico commented Nov 6, 2021

See: xceedsoftware/wpftoolkit#1195
And #73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants