<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="MyAuth.ModalDialog" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="430" 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">

  <!-- outer grid, fills root visual (canvas) -->
  <Grid x:Name="LayoutRoot" Background="#40000000">

    <!-- inner grid, shows caption and content -->
    <Border Background="White" CornerRadius="6" BorderBrush="Black" BorderThickness="1 1 3 3" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 -50 0 0" MinHeight="100">
      <Grid>
        <Grid.RowDefinitions>
          <RowDefinition Height="auto" />
          <RowDefinition />
          <RowDefinition Height="auto" />
        </Grid.RowDefinitions>

        <!-- caption -->
        <Border Name="_bdrCaption" Background="Gray" CornerRadius="6 6 0 0" Padding="0 3">
          <Grid>
            <Grid.ColumnDefinitions>
              <ColumnDefinition />
              <ColumnDefinition Width="auto" />
            </Grid.ColumnDefinitions>
            <TextBlock Name="_tbCaption" Text="Caption" Margin="6 0" VerticalAlignment="Center" FontSize="16" Foreground="White" />
            <HyperlinkButton Name="_btnClose" Content="x" Grid.Column="1" Margin="6 0" VerticalAlignment="Center" IsTabStop="False" FontWeight="Bold" FontSize="16" Foreground="White" />
          </Grid>
        </Border>

        <!-- content -->
        <Border Name="_bdrContent" Grid.Row="1" Padding="12 6" HorizontalAlignment="Left" VerticalAlignment="Top" />

        <!-- error message -->
        <TextBlock Name="_tbErrorMsg" Grid.Row="2" Padding="12" TextWrapping="Wrap" HorizontalAlignment="Left" Foreground="#ffc00000" FontWeight="Bold" Visibility="Collapsed" />
      </Grid>
    </Border>
  </Grid>
</UserControl>