title: Frame Page controls layout
body: <p>Could you please tell me where I have gone wrong, my frame size takes the size of the wpf window, code is:</p>
  
  <pre><code>&lt;Window x:Class="MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="BSP" Height="700" Width="990" WindowStartupLocation="CenterScreen"&gt;
      &lt;Grid Background="Green" VerticalAlignment="Center" HorizontalAlignment="Center" &gt;
              &lt;Frame Name="MainFrame" Source="LoginScreen.xaml" NavigationUIVisibility="Hidden" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"  /&gt;        
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>The page size less than the window and also the total size of margin+width+size of label is less than the size of page yet the button is being displayed as cut. Code for the page is below:</p>
  
  <pre><code>&lt;Page x:Class="Loggedin"
        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" 
        mc:Ignorable="d" 
        Height="660" Width="920"
        Title="Loggedin"&gt;  
        &lt;Grid Background="white" Margin="2"&gt;
          &lt;StackPanel Orientation="Horizontal" VerticalAlignment="Top" &gt;
              &lt;Label Content="Loggedin as" Height="28" HorizontalAlignment="Left" Name="Loggedinas" /&gt;
              &lt;Button Content="LogOut" Margin="780,0,0,0" Height="28" Name="Logout" Width="50" HorizontalAlignment="Right"/&gt;
          &lt;/StackPanel&gt;
        &lt;/Grid&gt;
  &lt;/Page&gt;
  </code></pre>
  
  <p>Could you please assist me, it is eating my brain from 2 days :(.  Following are pics of output:
  Pic from Visual Studios: <a href="http://clip2net.com/s/1Fpb7" rel="nofollow">http://clip2net.com/s/1Fpb7</a></p>
  
  <p>Pic from Runtime: <a href="http://clip2net.com/s/1FpbQ" rel="nofollow">http://clip2net.com/s/1FpbQ</a></p>