title: display a UserControl when click Button
body: <p>I have created a <code>ListViewTemplate</code> as a <code>UserControl</code>,that I want to display it when I click on this Hamburger <code>Button</code>,this is my code:</p>
  
  <p><code>Main.xaml</code>:</p>
  
  <pre><code>&lt;SplitView.Content &gt;
      &lt;Grid  Background="White" &gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="35" /&gt;
              &lt;RowDefinition Height="*" /&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Grid Grid.Row="0" Background="#f0f0f0" &gt;
              &lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Right"&gt;
                  &lt;Button x:Name="TrieButton" Margin="0" Content="&amp;#xE700;"
                      Width="50"  Background="Transparent" VerticalAlignment="Stretch" Click="TrieButton_Click" /&gt;
              &lt;/StackPanel&gt;
          &lt;/Grid&gt;
          &lt;Frame Grid.Row="1"  x:Name="ContentFrame" Margin="0" /&gt;
      &lt;/Grid&gt;
  &lt;/SplitView.Content&gt;
  </code></pre>
  
  <p>And this is the code Behind:</p>
  
  <p><code>Main.xaml.cs</code>:</p>
  
  <pre><code> private void TrieButton_Click(object sender, RoutedEventArgs e)
   {
       ListViewTemplate c = new ListViewTemplate();
       if (c.Visibility == Visibility.Visible)
       {
           c.Visibility = Visibility.Collapsed;
       }
  
       else
       {  
           c.Visibility = Visibility.Visible;
       }
   }
  </code></pre>
  
  <p>this is my <code>UserControl</code>:
  <code>ListViewTemplate.xaml</code>:</p>
  
  <pre><code>&lt;Grid x:Name="FilterGrid" Background="Black"&gt;
      &lt;StackPanel   Orientation="Horizontal" HorizontalAlignment="Right" Margin="0" &gt;
          &lt;ListView x:Name="Liste" Background="Black" &gt;
              &lt;ListViewItem &gt;
                  &lt;TextBlock Text="Nom" Foreground="#9d9e9e"/&gt;
              &lt;/ListViewItem&gt;
              &lt;ListViewItem &gt;
                  &lt;TextBlock Text="Catégorie" Foreground="#9d9e9e"/&gt;
              &lt;/ListViewItem &gt;  
          &lt;/ListView&gt;
      &lt;/StackPanel&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>My problem is that this <code>ListView</code> <code>UserControl</code> is not shown when I click on the <code>TrieButton</code>,even I have increased the height of <code>Grid</code>
  so please How can I correct my code,to have <code>Listview</code> showed when I click on <code>TrieButton</code> </p>
  
  <p>thanks for help</p>