Skip to content

DialogHost doesn't allow dialogs with height over approx 732 #4006

@andyste1

Description

@andyste1

I have a DialogHost on my main window. Via a button (relay command) in the main window's VM, I instantiate a view then show it using DialogHost.Show(view).

The view being shown is a UserControl, with Height="600". This is the view's XAML (irrelevant parts removed):

<UserControl ...
             BorderBrush="Red"
             BorderThickness="3"
             Width="800"
             Height="600">

    <Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <materialDesign:ColorZone Grid.Row="0"
                                      Padding="0"
                                      Mode="PrimaryLight">
				...
            </materialDesign:ColorZone>

            <DataGrid Grid.Row="1" Margin="16">...</DataGrid>

            <Button Grid.Row="1"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Bottom"
                    Style="{StaticResource MaterialDesignFloatingActionSecondaryButton}"
                    Margin="0,0,16,16">
               ...
            </Button>
        </Grid>

        <materialDesign:DrawerHost  ...  </materialDesign:DrawerHost>
    </Grid>
</UserControl>

You can see that it's pretty basic: two grid rows, with a ColorZone in the first (height Auto) and a datagrid (star height) in the second. A FAB is positioned bottom-right of the second row. There is also a DrawerHost (opened via the FAB) but the problem I'm reporting still occurs with this removed.

Note I've added a red border to the user control to better demonstrate the issue.

With the view (user control) height set to 600, the UI looks like it does in the first screenshot. As you'd expect, the datagrid fills the second row and the FAB sits in the bottom-right of the dialog. The dialog continues to display correctly at heights below this, and up to approx 730. Beyond this and the bottom of the view starts to get clipped:
If I set the view's height to 733 you can see the bottom red border is starting to disappear (third screenshot).
And with a height of 770 the bottom border has completely disappeared, and the FAB is also starting to disappear (last screenshot).
The problem is unrelated to the DataGrid and still occurs with this removed.

Any idea what's happening? Is there some kind of hard limit to the height of a dialog?

Image

Version

5.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugevaluation requiredItems is pending review or evaluation by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions