WPF Programmatically Enable TextBox Scrolling/Panning for Tablets : <p>I am working with a WPF application that will be used on Windows tablets. The issue I am having is that I cannot scroll through a large multi-line TextBox on a tablet by pressing and dragging the content. However, it still scrolls on a desktop with a mouse wheel.</p>

<p>This question (<a href="https://stackoverflow.com/questions/26781833/enable-swipe-scrolling-on-textbox-control-in-wpf-scrollviewer">Enable swipe scrolling on Textbox control in WPF Scrollviewer</a>) seems to answer the same problem I am having, but I need to do it programmatically. This is what I am doing to set the panning mode of the TextBox:</p>

<pre><code>txtLongText.SetValue(ScrollViewer.PanningModeProperty, PanningMode.None);
</code></pre>

<p>Which I can tell is working because the click &amp; drag text selection is now disabled, but the content still does not scroll. I am also setting the panning mode of the outer ScrollViewer as such:</p>

<pre><code>popupScrollView.PanningMode = PanningMode.Both;
</code></pre>

<p>The <code>popupScrollView</code> object is then being set as the content inside a Popup.</p>

<p>The only thing I can think of is if there is somewhere else higher up that I need to be setting the panning mode? Any help would be appreciated. Thanks.</p>
