title: Child elements of scrollviewer preventing scrolling with mouse wheel?
body: <p>I'm having a problem getting mouse wheel scrolling to work in the following XAML, which I have simplified for clarity:</p>
  
  <pre><code>&lt;ScrollViewer
  HorizontalScrollBarVisibility="Visible"
  VerticalScrollBarVisibility="Visible"
  CanContentScroll="False"
  &gt;
      &lt;Grid
      MouseDown="Editor_MouseDown"
      MouseUp="Editor_MouseUp"
      MouseMove="Editor_MouseMove"
      Focusable="False"
      &gt;
          &lt;Grid.Resources&gt;
              &lt;DataTemplate
              DataType="{x:Type local:DataFieldModel}"
              &gt;
                  &lt;Grid
                  Margin="0,2,2,2"
                  &gt;
                      &lt;TextBox
                      Cursor="IBeam"
                      MouseDown="TextBox_MouseDown"
                      MouseUp="TextBox_MouseUp"
                      MouseMove="TextBox_MouseMove"
                      /&gt;
                  &lt;/Grid&gt;
              &lt;/DataTemplate&gt;
          &lt;/Grid.Resources&gt;
          &lt;ListBox
          x:Name="DataFieldListBox"
          ItemsSource="{Binding GetDataFields}"
          SelectionMode="Extended"
          Background="Transparent"
          Focusable="False"
          &gt;
              &lt;ListBox.ItemsPanel&gt;
                  &lt;ItemsPanelTemplate&gt;
                      &lt;Canvas /&gt;
                  &lt;/ItemsPanelTemplate&gt;
              &lt;/ListBox.ItemsPanel&gt;
              &lt;ListBox.ItemContainerStyle&gt;
                  &lt;Style
                  TargetType="ListBoxItem"
                  &gt;
                      &lt;Setter
                      Property="Canvas.Left"
                      Value="{Binding dfX}"
                      /&gt;
                      &lt;Setter
                      Property="Canvas.Top"
                      Value="{Binding dfY}"
                      /&gt;
                  &lt;/Style&gt;
              &lt;/ListBox.ItemContainerStyle&gt;
          &lt;/ListBox&gt;
      &lt;/Grid&gt;
  &lt;/ScrollViewer&gt;
  </code></pre>
  
  <p>Visually, the result is an area of some known size where <code>DataField</code>s read from a collection can be represented with <code>TextBox</code>es which have arbitrary position, size, et cetera.  In cases where the <code>ListBox</code>'s styled "area" is too large to display all at once, horizontal and vertical scrolling is possible, but only with the scroll bars.</p>
  
  <p>For better ergonomics and sanity, mouse wheel scrolling should be possible, and normally <code>ScrollViewer</code> would handle it automatically, but the <code>ListBox</code> appears to be handing those events such that the parent <code>ScrollViewer</code> never sees them.  So far I have only been able to get wheel scrolling working be setting <code>IsHitTestVisible=False</code> for either the <code>ListBox</code> or the parent <code>Grid</code>, but of course none of the child element's mouse events work after that.</p>
  
  <p>What can I do to ensure the <code>ScrollViewer</code> sees mouse wheel events while preserving others for child elements?</p>
  
  <p>Edit: I just learned that <code>ListBox</code> has a built-in <code>ScrollViewer</code> which is probably stealing wheel events from the parent <code>ScrollViewer</code> and that specifying a control template can disable it.  I'll update this question if that resolves the problem.</p>