title: Alternate ways to display forms inside a Grid row in WPF
body: <p>The WPF application I've created contains a Grid with 3 rows. I have a set of buttons in the 3rd row. On Clicking the Buttons, the forms are displayed in the 2nd row of the Grid. However What I've done is quite messy because I've created all the form contents in the same window and have set the visibility to Hidden.</p>
  
  <p>sample code:</p>
  
  <pre><code>&lt;Grid Name="panel1" Grid.Row="1" Visibility="Hidden"&gt;
   //contains a lot of textblocks,buttons and images
  &lt;/Grid&gt;
  &lt;Grid Name="panel2" Grid.Row="1" Visibility="Hidden"&gt;
   //contains a lot of textblocks,buttons and images
  &lt;/Grid&gt;
   &lt;Grid Name="panel3" Grid.Row="1" Visibility="Hidden"&gt;
   //contains a lot of textblocks,buttons and images
  &lt;/Grid&gt;
  </code></pre>
  
  <p>My xaml Code looks like this:</p>
  
  <pre><code>private void Image_MouseLeftButtonDown_1(object sender, System.Windows.Input.MouseButtonEventArgs e)
      {
          panel1.Visibility = System.Windows.Visibility.Hidden;
          panel2.Visibility = System.Windows.Visibility.Visible;
          panel3.Visibility = System.Windows.Visibility.Hidden;
      }
  </code></pre>
  
  <p>This approach looks really messy as I've included all the code in the Main Xaml file.
  Need some alternate ways to do this. Kindly help.</p>