title: WinrtXamlToolkit TreeView expand with single instead of double click
body: <p>I am using the <a href="https://github.com/xyzzer/WinRTXamlToolkit/tree/master/WinRTXamlToolkit/Controls/TreeView" rel="nofollow noreferrer">TreeView</a> from the <a href="https://github.com/xyzzer/WinRTXamlToolkit" rel="nofollow noreferrer">WinrtXamlToolkit</a>. The default behavior of this control is to expand the nested items on double click of the header. The code responsible for this is here <a href="https://github.com/xyzzer/WinRTXamlToolkit/blob/master/WinRTXamlToolkit/Controls/TreeView/TreeViewItem.cs#L1205" rel="nofollow noreferrer">(TreeViewItem.cs line 1205)</a>.</p>
  <pre><code>private void OnHeaderMouseLeftButtonDown(object sender, PointerRoutedEventArgs e)
          {
              if (Interaction.AllowMouseLeftButtonDown(e))
              {
                  // If the event hasn't already been handled and this item is
                  // focusable, then focus (and possibly expand if it was double
                  // clicked)
                  if (!e.Handled &amp;&amp; IsEnabled)
                  {
                      if (Focus(FocusState.Programmatic))
                      {
                          e.Handled = true;
                      }
  
                      // Expand the item when double clicked
                      if (Interaction.ClickCount % 2 == 0)
                      {
                          bool opened = !IsExpanded;
                          UserInitiatedExpansion |= opened;
                          IsExpanded = opened;
  
                          e.Handled = true;
                      }
                  }
  
                  Interaction.OnMouseLeftButtonDownBase();
                  OnPointerPressed(e);
              }
          }
  </code></pre>
  <p>Is there a way to change this behavior to expand the items on single click or tap without actually copying the control and all it's related classes to my project?</p>
  <p>It seems like an overkill to do this just to change a few lines of code.</p>