title: UWP Viewbox and Flipview Manipulations
body: <p>I'm writing a UWP photo viewer app that has a custom control that contains a Viewbox and has custom ManipulationEvents, inside a FlipView. I want to make it so that when you are zoomed out all the way you can swipe to flip, but still able to zoom in. That's where my problem is.</p>
  
  <p>When I have the viewbox set to anything <b>except</b> <code>ManipulationMode = ManipulationModes.System</code>, dragging on the viewbox does not trigger the FlipView. The problem is I want to be able to still zoom in on the image when in zoom level 1.</p>
  
  <p>Basically I'd like to set something that looks like: <code>ManipulationMode="Scale, System"</code>, where everything that's not scale would be bubbled up. Or even trigger this in code-behind.</p>
  
  <p>How would I accomplish this?</p>
  
  <p>Here is the basis of what I am doing:</p>
  
  <h3>CustomControl.xaml</h3>
  
  <pre><code>&lt;UserControl ...&gt;
  &lt;Grid&gt;
      &lt;ScrollViewer ...
          ManipulationMode="System"&gt;
          &lt;Viewbox ManipulationMode="TranslateX, TranslateY, Rotate, Scale"
              ManipulationStarted="Viewbox_OnManipulationStarted"
              ManipulationDelta="Viewbox_ManipulationDelta"&gt;
              &lt;ContentControl Content="{Binding ElementName=MyControl, Path=ViewboxContext}" /&gt;
          &lt;/Viewbox&gt;
      &lt;/ScrollViewer&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p><br/></p>
  
  <h3>CustomControl.xaml.cs</h3>
  
  <pre><code>...
  void ViewboxHost_OnManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
  {
      ...
  }
  
  void ViewboxHost_OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
  {
      if (IsAtMinZoom &amp;&amp; e.Delta.Scale &lt;= 1)
      {
          e.Handled = false;
      } else {
          e.Handled = true;
          return;
      }
  
      ...
  }
  </code></pre>
  
  <p><br /></p>
  
  <h3>MainPage.xaml</h3>
  
  <pre><code>&lt;Page ...&gt;
  &lt;Grid&gt;
      &lt;FlipView&gt;
          &lt;FlipView.Items&gt; &lt;!-- These will later be added view ItemsSource --&gt;
              &lt;FlipViewItem&gt;
                  &lt;controls:CustomControl&gt;
                      &lt;Image src="..." /&gt;
                  &lt;/controls:CustomControl&gt;
              &lt;/FlipViewItem&gt;
  
              &lt;!-- More of these guys ---&gt;
  
          &lt;/FlipView.Items&gt;
      &lt;/FlipView&gt;
  &lt;/Grid&gt;
  </code></pre>