ModernDialog bug

Aug 19, 2014 at 3:01 PM
Hello, I have WPF application which uses Modern UI for WPF 1.0.6.
I created ModernDialog user control and putted some elements to dialog.
XAML code:
<mui:ModernDialog x:Class="SkynetCompanyContractWPF.Content.NumberDateDataGridDialog"
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                  xmlns:mui="http://firstfloorsoftware.com/ModernUI"
                  xmlns:System="clr-namespace:System;assembly=mscorlib"
                  mc:Ignorable="d"
                  Title="Reikalinga papildoma informacija"
                  Width="1000"
                  Height="1000">
    <Grid Width="1000">
        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="40" />
            <RowDefinition Height="40" />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="140" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Label Grid.Column="0"
               Grid.Row="0"
               Content="Sutarties data:"
               VerticalAlignment="Center" />

        <Label Grid.Column="0"
               Grid.Row="1"
               Content="Sutarties numeris:"
               VerticalAlignment="Center" />

        <Label Grid.Column="0"
               Grid.Row="2"
               Content="Ar taikyti nuolaida?"
               VerticalAlignment="Center" />

        <DatePicker Grid.Column="1"
                    Grid.Row="0"
                    Margin="0,5,0,5"
                    x:Name="datePicker"
                    HorizontalAlignment="Left"
                    Width="200"
                    SelectedDate="{x:Static System:DateTime.Now}" />

        <TextBox Grid.Column="1"
                 Grid.Row="1"
                 Name="contractNumber_TextBox"
                 HorizontalAlignment="Left"
                 Width="200"
                 Style="{StaticResource CustomerTextBox}"
                 IsReadOnly="False"/>
        
        <CheckBox
            Grid.Column="1"
            Grid.Row="2"
            x:Name="discount_CheckBox"
            IsChecked="{Binding WithDiscount, Mode=TwoWay}"/>
        
        <DataGrid Name="orderedServices"
                  AutoGenerateColumns="False"
                  Grid.Row="3"
                  Grid.Column="0"
                  ItemsSource="{Binding OrderServiceViews}"
                  CanUserAddRows="False"
                  HorizontalAlignment="Stretch"
                  Grid.ColumnSpan="2">
            <DataGrid.RowStyle>
                <Style TargetType="DataGridRow">
                    <Setter Property="ToolTip">
                        <Setter.Value>
                            <TextBlock Text="{Binding Comment}" />
                        </Setter.Value>
                    </Setter>
                </Style>
            </DataGrid.RowStyle>
            <DataGrid.Columns>
                <mui:DataGridCheckBoxColumn Header="Įtraukta"
                                            Binding="{Binding IsForPrint}" />
                <mui:DataGridTextColumn Header="Paslaugos pavadinimas"
                                        Binding="{Binding ServiceName}" />
                <mui:DataGridTextColumn Header="Summa be PVM"
                                        Binding="{Binding Summ, StringFormat=C, ConverterCulture=lt-LT}" />
                <mui:DataGridTextColumn Header="Vienetai"
                                        Binding="{Binding ServiceUnits}" />
                <mui:DataGridTextColumn Header="Kiekis"
                                        Binding="{Binding Quantity}" />
                <mui:DataGridTextColumn Header="Kaina"
                                        Binding="{Binding ServicePrice, StringFormat=C, ConverterCulture=lt-LT}" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</mui:ModernDialog>
And result:
Image
As you can see, near window on the right and bottom side appeared black border. Why?
And even if I set dialog window Width="1000" Height="1000" actual size is smaller, we can't see all datagrid orderedServices columns.

Is it bug or my mistake?
Coordinator
Aug 21, 2014 at 2:59 PM
You may want to set the max width and height constraints (default: 640x640) to a higher value, and set the SizeToContent to Manual like so:
<mui:ModernDialog 
  MaxWidth="9999"
  MaxHeight="9999"
  SizeToContent="Manual">