Udin M
Udin M

Reputation: 61

Material Design Dialog Position in WPF/XMAL

I am using Material design dialog to show a large message in my wpf application. But when I show it on button chick event it appear at the middle of the application. I want to show it at the bottom of left corner. How do I achieve it? Here is my code

 <materialDesign:DialogHost Panel.ZIndex="566" x:Name="mainWindowDialogHost">
    <materialDesign:DialogHost.DialogContent>
        <Border Height="500" Width="200">
           //here goes a very large message
        </Border>
    </materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>

Upvotes: 0

Views: 1116

Answers (1)

Ozgur Saklanmaz
Ozgur Saklanmaz

Reputation: 564

What you want is actually something independent of Material Design. You can set the VerticalAlignment and HorizontalAlignment properties for all tools. If it is still not exactly in the position you want, you can position it better with the Margin feature.

My advice is to split the project design well with tools like Grid, Stackpanel, Dockpanel. In this way, the screen resolution, shrinking and growing will not affect the design.

You can find more detailed information here.

        <materialDesign:DialogHost Panel.ZIndex="566" x:Name="mainWindowDialogHost" 
                               HorizontalAlignment="Left" VerticalAlignment="Bottom">
        <materialDesign:DialogHost.DialogContent>
            <Border Height="500" Width="200">
                //here goes a very large message
            </Border>
        </materialDesign:DialogHost.DialogContent>
    </materialDesign:DialogHost>

Upvotes: 1

Related Questions