The Wayback Machine - https://web.archive.org/web/20200906093220/https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/issues/1945
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

Same default height #1945

Open
AgPeHaJIuH1 opened this issue Jun 27, 2020 · 0 comments
Open

Same default height #1945

AgPeHaJIuH1 opened this issue Jun 27, 2020 · 0 comments

Comments

@AgPeHaJIuH1
Copy link

@AgPeHaJIuH1 AgPeHaJIuH1 commented Jun 27, 2020

Hello. Sorry for my perfectionism, but I'm used to the fact that the controls look the same, this also applies to their Height by default. Now I have to redefine some styles so that the elements are the same height (add Padding or set MinHeight). I would like them to look the same by default, if possible. Thank you for understanding.

image

<Window x:Class="WpfApp4.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:local="clr-namespace:WpfApp4"
        xmlns:mat="http://materialdesigninxaml.net/winfx/xaml/themes"
        mc:Ignorable="d"
        Title="MainWindow"
        Height="450"
        Width="800"
        Background="{StaticResource MaterialDesignPaper}"
        FontFamily="{mat:MaterialDesignFont}"
        TextElement.Foreground="{StaticResource MaterialDesignBody}"
        TextElement.FontWeight="Medium"
        TextElement.FontSize="14"
        TextOptions.TextFormattingMode="Ideal"
        TextOptions.TextRenderingMode="Auto">


    <StackPanel>



        <Grid>

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200" />
                <ColumnDefinition Width="200" />
                <ColumnDefinition Width="200" />
            </Grid.ColumnDefinitions>

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

            <TextBox Grid.Column="0"
                     Grid.Row="0"
                     VerticalAlignment="Top"
                     HorizontalAlignment="Stretch" />

            <ComboBox Grid.Column="0"
                      Grid.Row="1"
                      VerticalAlignment="Top"
                      HorizontalAlignment="Stretch" />

            <DatePicker Grid.Column="0"
                        Grid.Row="2"
                        VerticalAlignment="Top"
                        HorizontalAlignment="Stretch" />



            <ComboBox Grid.Column="1"
                      Grid.Row="0"
                      VerticalAlignment="Top"
                      HorizontalAlignment="Stretch" />

            <DatePicker Grid.Column="1"
                        Grid.Row="1"
                        VerticalAlignment="Top"
                        HorizontalAlignment="Stretch" />

            <TextBox Grid.Column="1"
                     Grid.Row="2"
                     VerticalAlignment="Top"
                     HorizontalAlignment="Stretch" />



            <DatePicker Grid.Column="2"
                        Grid.Row="0"
                        VerticalAlignment="Top"
                        HorizontalAlignment="Stretch" />

            <TextBox Grid.Column="2"
                     Grid.Row="1"
                     VerticalAlignment="Top"
                     HorizontalAlignment="Stretch" />

            <ComboBox Grid.Column="2"
                      Grid.Row="2"
                      VerticalAlignment="Top"
                      HorizontalAlignment="Stretch" />

        </Grid>

        <Separator Margin="0 20" />

        <TextBlock Text="Floating"
                   Margin="0 0 0 10" />

        <Grid>

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200" />
                <ColumnDefinition Width="200" />
                <ColumnDefinition Width="200" />
            </Grid.ColumnDefinitions>

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

            <TextBox Grid.Column="0"
                     Grid.Row="0"
                     VerticalAlignment="Top"
                     HorizontalAlignment="Stretch"
                     mat:HintAssist.Hint="Text"
                     mat:HintAssist.IsFloating="True" />

            <ComboBox Grid.Column="0"
                      Grid.Row="1"
                      VerticalAlignment="Top"
                      HorizontalAlignment="Stretch"
                      mat:HintAssist.Hint="Text"
                      mat:HintAssist.IsFloating="True" />

            <DatePicker Grid.Column="0"
                        Grid.Row="2"
                        VerticalAlignment="Top"
                        HorizontalAlignment="Stretch"
                        mat:HintAssist.Hint="Text"
                        mat:HintAssist.IsFloating="True" />



            <ComboBox Grid.Column="1"
                      Grid.Row="0"
                      VerticalAlignment="Top"
                      HorizontalAlignment="Stretch"
                      mat:HintAssist.Hint="Text"
                      mat:HintAssist.IsFloating="True" />

            <DatePicker Grid.Column="1"
                        Grid.Row="1"
                        VerticalAlignment="Top"
                        HorizontalAlignment="Stretch"
                        mat:HintAssist.Hint="Text"
                        mat:HintAssist.IsFloating="True" />

            <TextBox Grid.Column="1"
                     Grid.Row="2"
                     VerticalAlignment="Top"
                     HorizontalAlignment="Stretch"
                     mat:HintAssist.Hint="Text"
                     mat:HintAssist.IsFloating="True" />



            <DatePicker Grid.Column="2"
                        Grid.Row="0"
                        VerticalAlignment="Top"
                        HorizontalAlignment="Stretch"
                        mat:HintAssist.Hint="Text"
                        mat:HintAssist.IsFloating="True" />

            <TextBox Grid.Column="2"
                     Grid.Row="1"
                     VerticalAlignment="Top"
                     HorizontalAlignment="Stretch"
                     mat:HintAssist.Hint="Text"
                     mat:HintAssist.IsFloating="True" />

            <ComboBox Grid.Column="2"
                      Grid.Row="2"
                      VerticalAlignment="Top"
                      HorizontalAlignment="Stretch"
                      mat:HintAssist.Hint="Text"
                      mat:HintAssist.IsFloating="True" />

        </Grid>

    </StackPanel>
</Window>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.