title: WPF menu - Dynamic show and hide content
body: <p>I need to create interactive menu. When option was choosen, I want to show appropriate content.<br />
  For example when option "Schemat bazy Northwind" was clicked, to my grid should be added Image. When another option was choosen previous content is removed and etc. <br /></p>
  
  <p>The only thing that comes to my mind is create functions which at the beginning clear grid and later add content(Is it possible?).<br /></p>
  
  <p>Please there anybody could direct me to solve this problem.</p>
  
  <pre><code>&lt;Window x:Class="Northwind.AdminPanel"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="Panel administratora" WindowState="Maximized"&gt;
  
      &lt;StackPanel Name="bindingData"&gt;
          &lt;StatusBar&gt;
              &lt;TextBlock FontSize="15" Text="{Binding ServerName}" Margin="0 0 30 0"&gt;&lt;/TextBlock&gt;
              &lt;TextBlock FontSize="15" Text="{Binding ConnectionStatus}" Margin="0 0 30 0"&gt;&lt;/TextBlock&gt;
              &lt;Label FontSize="15" Name="lblClock"&gt;&lt;/Label&gt;
          &lt;/StatusBar&gt;
  
          &lt;DockPanel Height="55"&gt;
              &lt;Menu DockPanel.Dock="Top"&gt;
                  &lt;MenuItem Header="Baza" Margin="10" FontSize="15"&gt;&lt;/MenuItem&gt;
                  &lt;MenuItem Header="Pomoc" Margin="10" FontSize="15"&gt;
                      &lt;MenuItem x:Name="itemSchema" Header="Schemat bazy Northwind" Click="itmSchema_Click_1"&gt;&lt;/MenuItem&gt;
                  &lt;/MenuItem&gt;
             &lt;/Menu&gt;
          &lt;/DockPanel&gt;
  
          &lt;Grid x:Name="mainContent"&gt;  
  
            &lt;!--add content --&gt;                             
  
          &lt;/Grid&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows;
  using System.Windows.Controls;
  using System.Windows.Data;
  using System.Windows.Documents;
  using System.Windows.Input;
  using System.Windows.Media;
  using System.Windows.Media.Imaging;
  using System.Windows.Shapes;
  using System.Windows.Threading;
  namespace Northwind
  {
      public partial class AdminPanel : Window
      {
          public string ServerName { get; set; }
          public string ConnectionStatus { get; set; }
  
          public AdminPanel(string name,string status)
          {
              InitializeComponent();
  
              this.ServerName = name;
              this.ConnectionStatus = status;
  
              DispatcherTimer dtClockTime = new DispatcherTimer();
              dtClockTime.Interval = new TimeSpan(0, 0, 1);
              dtClockTime.Tick += dtClockTime_Tick;
  
              dtClockTime.Start();
              bindingData.DataContext = this;
          }
  
          private void dtClockTime_Tick(object sender, EventArgs e)
          {
              lblClock.Content = DateTime.Now.ToLongTimeString();
          }
  
          private void itmSchema_Click_1(object sender, RoutedEventArgs e)
          {
             //code
          }
      }    
  }    
  </code></pre>