title: Scrolling ContextMenu items
body: <p>In Windows Phone there is a feature called <strong>ContextMenu</strong>, which allows to create a popup menu for controls.</p>
  <p>However, if the list of menu items is quite big, some of them doesn't fit the screen. The following simple example will show the point:</p>
  <p>in xaml:</p>
  <p>We will be using Toolkit, so adding</p>
  <pre><code>xmlns:toolkit=&quot;clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit&quot;
  </code></pre>
  <p>and then for example:</p>
  <pre><code>   &lt;Button Content=&quot;Button 1&quot; Height=&quot;72&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;160,400,0,0&quot; Name=&quot;button1&quot; VerticalAlignment=&quot;Top&quot; Width=&quot;160&quot;&gt;
          &lt;toolkit:ContextMenuService.ContextMenu&gt;
              &lt;toolkit:ContextMenu&gt;                    
                      &lt;toolkit:MenuItem Header=&quot;Action A&quot; Name=&quot;miActionA1&quot; BorderBrush=&quot;Black&quot; BorderThickness=&quot;1&quot; Click=&quot;nullAction&quot; /&gt;
                      &lt;toolkit:MenuItem Header=&quot;Action B&quot; Name=&quot;miActionB1&quot; BorderBrush=&quot;Black&quot; BorderThickness=&quot;1&quot; Click=&quot;nullAction&quot; /&gt;
                      &lt;toolkit:MenuItem Header=&quot;Action C&quot; Name=&quot;miActionC1&quot; BorderBrush=&quot;Black&quot; BorderThickness=&quot;1&quot; Click=&quot;nullAction&quot; /&gt;
                      &lt;toolkit:MenuItem Header=&quot;Action D&quot; Name=&quot;miActionD1&quot; BorderBrush=&quot;Black&quot; BorderThickness=&quot;1&quot; Click=&quot;nullAction&quot; /&gt;
                      &lt;toolkit:MenuItem Header=&quot;Action E&quot; Name=&quot;miActionE1&quot; BorderBrush=&quot;Black&quot; BorderThickness=&quot;1&quot; Click=&quot;nullAction&quot; /&gt;
                      &lt;toolkit:MenuItem Header=&quot;Action F&quot; Name=&quot;miActionF1&quot; BorderBrush=&quot;Black&quot; BorderThickness=&quot;1&quot; Click=&quot;nullAction&quot; /&gt;                      
              &lt;/toolkit:ContextMenu&gt;
          &lt;/toolkit:ContextMenuService.ContextMenu&gt;
      &lt;/Button&gt;
  </code></pre>
  <p>At nullAction we're doing nothing</p>
  <pre><code>private void nullAction(object sender, RoutedEventArgs e)
          {
  
          }
  </code></pre>
  <p>The DesignHeight value is standard for the default WP7 page it's <code>DesignHeight=&quot;768&quot;</code></p>
  <p>As you can see, when you long tap the &quot;Button 1&quot; control, the menu is shown, but not completely. Some items
  are not visible. In my case, the best decision was to make this menu scrollable. That can be done, using  <strong>ScrollViewer</strong>.</p>
  <p>So, we cover the menu items with Scrollviewer and StackPanel.</p>
  <pre><code> &lt;Button Content=&quot;Button 1&quot; Height=&quot;72&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;160,400,0,0&quot; Name=&quot;button1&quot; VerticalAlignment=&quot;Top&quot; Width=&quot;160&quot;&gt;
          &lt;toolkit:ContextMenuService.ContextMenu&gt;
              &lt;toolkit:ContextMenu&gt;
                  &lt;ScrollViewer&gt;
                      &lt;StackPanel&gt;
                      &lt;toolkit:MenuItem Header=&quot;Action A&quot; Name=&quot;miActionA1&quot; BorderBrush=&quot;Black&quot; BorderThickness=&quot;1&quot; Click=&quot;nullAction&quot; /&gt;
                      &lt;toolkit:MenuItem Header=&quot;Action B&quot; Name=&quot;miActionB1&quot; BorderBrush=&quot;Black&quot; BorderThickness=&quot;1&quot; Click=&quot;nullAction&quot; /&gt;
                      &lt;toolkit:MenuItem Header=&quot;Action C&quot; Name=&quot;miActionC1&quot; BorderBrush=&quot;Black&quot; BorderThickness=&quot;1&quot; Click=&quot;nullAction&quot; /&gt;
                      &lt;toolkit:MenuItem Header=&quot;Action D&quot; Name=&quot;miActionD1&quot; BorderBrush=&quot;Black&quot; BorderThickness=&quot;1&quot; Click=&quot;nullAction&quot; /&gt;
                      &lt;toolkit:MenuItem Header=&quot;Action E&quot; Name=&quot;miActionE1&quot; BorderBrush=&quot;Black&quot; BorderThickness=&quot;1&quot; Click=&quot;nullAction&quot; /&gt;
                      &lt;toolkit:MenuItem Header=&quot;Action F&quot; Name=&quot;miActionF1&quot; BorderBrush=&quot;Black&quot; BorderThickness=&quot;1&quot; Click=&quot;nullAction&quot; /&gt;
                      &lt;/StackPanel&gt;
                  &lt;/ScrollViewer&gt;
              &lt;/toolkit:ContextMenu&gt;
          &lt;/toolkit:ContextMenuService.ContextMenu&gt;
      &lt;/Button&gt;
  </code></pre>
  <p>Success? Nope, because you can scroll this list, but
  can't choose the item down.</p>
  <p><strong>My question, is how to fix it?</strong></p>
  <p>Use multitouch? (I don't know much about it)</p>
  <p>Perhaps, I need to add some property to Scrolviewer?</p>
  <p>Any other ideas?</p>
  <p><strong>[updated]</strong> Also, found that tap/click handlers for items change behavior, if scrollviewer is added. Normally, when you tap the item, the context menu closes and the handler method executes. With scrollviewer, the context menu doesn't close, needs one more tap to close it manually. Why's that happening?</p>