title: How to limit child window's movement within parent boundaries?
body: <p>I was wondering is it possible to limit child window's ability to be moved around to only within parent's panel boundaries ? Suppose I create a child window with a button click: </p>
  
  <pre><code>&lt;UserControl x:Class="ChildWindowTest.MainPage"
  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:Child="clr-namespace:ChildWindowTest"
  mc:Ignorable="d"             
  d:DesignHeight="300" d:DesignWidth="400" &gt;
  
  &lt;Grid x:Name="LayoutRoot" &gt;
      &lt;StackPanel Width="500" Height="500"&gt;
          &lt;Button Width="100" Height="25" Click="Button_Click" Content="Child Window"/&gt;
      &lt;/StackPanel&gt;
  &lt;/Grid&gt;
  &lt;/UserControl&gt;
  
  &lt;controls:ChildWindow 
  x:Class="ChildWindowTest.ChildWindow1"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
  Width="400"     Height="300"    Title="ChildWindow1" &gt;
  
  &lt;Grid x:Name="LayoutRoot" Margin="2"&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition /&gt;
          &lt;RowDefinition Height="Auto" /&gt;
      &lt;/Grid.RowDefinitions&gt;
  
  &lt;/Grid&gt;
  &lt;/controls:ChildWindow&gt;
  </code></pre>
  
  <p>I can move the generated child to left, right and down off screen (clipped off). I want to avoid that, basically set up a boundary within which child window is allowed to be moved (within <code>StackPanel</code> boundary) </p>
  
  <p>Thank you for any suggestion .. </p>