title: How to place an XAML usercontrol in a grid
body: <p>I have the following main.xaml and usercontrol.</p>
  
  <p>I need to place several times the user control on the 2nd row, 2nd column of the grid, By using visual studio it wont allow to drag and drop the user control, so I suppose I have to do it by code, I just dont know how</p>
  
  <p><strong>MainPage.xaml</strong></p>
  
  <pre><code>&lt;Grid HorizontalAlignment="Left" Height="768" VerticalAlignment="Top" Width="1366" x:Name="grid" Background="Black"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="150"/&gt;
              &lt;RowDefinition/&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition/&gt;
              &lt;ColumnDefinition Width="250"/&gt;
          &lt;/Grid.ColumnDefinitions&gt;
          &lt;Border BorderBrush="White" BorderThickness="3" Grid.Column="1" Background="Red" CornerRadius="30"/&gt;
          &lt;TextBlock x:Name="txtCountry" Grid.Column="1" TextWrapping="Wrap"  FontSize="36" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
          &lt;TextBlock x:Name="txtTime" Grid.Row="1" TextWrapping="Wrap" FontSize="180" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
      &lt;/Grid&gt;
  </code></pre>
  
  <p><strong>Usercontrol</strong></p>
  
  <pre><code>&lt;UserControl
      x:Class="AlarmPro.TimeOnCity"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="using:AlarmPro"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      mc:Ignorable="d"
      d:DesignHeight="150"
      d:DesignWidth="250"&gt;
  
      &lt;Grid Background="Black"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="30"/&gt;
              &lt;RowDefinition/&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Border BorderBrush="#FFDE6A6A" BorderThickness="1" Grid.Row="0" Grid.Column="0" Background="#FFDC4646"&gt;
              &lt;TextBlock TextWrapping="Wrap" Text="TextBlock" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16"/&gt;
          &lt;/Border&gt;
          &lt;Border BorderBrush="Black" BorderThickness="1" Grid.Row="1" Background="#FFAE4F00"&gt;
              &lt;TextBlock TextWrapping="Wrap" Text="TextBlock" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="36"/&gt;
          &lt;/Border&gt;
  
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>