With the following xaml:
<Window x:Class="Touch.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid x:Name="LayoutRoot" Background="Silver" IsManipulationEnabled="True">
<Rectangle x:Name="rect" Width="200" Height="100" Fill="Red"/>
</Grid>
</Window>
Touching the rectangle generates the following events in WPF and Noesis:
WPF
======================================
MainWindow.TouchDown Rectangle(rect)
MainWindow.GotTouchCapture Rectangle(rect) : Captured=Rectangle(rect)
MainWindow.LostTouchCapture Rectangle(rect) : Captured=Grid(LayoutRoot)
MainWindow.GotTouchCapture Grid(LayoutRoot) : Captured=Grid(LayoutRoot)
LayoutRoot.ManipulationStarting Grid(LayoutRoot)
LayoutRoot.ManipulationStarted Grid(LayoutRoot)
MainWindow.TouchUp Grid(LayoutRoot)
MainWindow.LostTouchCapture Grid(LayoutRoot) : Captured=null
LayoutRoot.ManipulationInertiaStarting Grid(LayoutRoot)
LayoutRoot.ManipulationCompleted Grid(LayoutRoot)
NOESIS
======================================
MainWindow.TouchDown Rectangle(rect)
MainWindow.GotTouchCapture Rectangle(rect) : Captured=Rectangle(rect)
LayoutRoot.ManipulationStarting Grid(LayoutRoot)
LayoutRoot.ManipulationStarted Grid(LayoutRoot)
MainWindow.LostTouchCapture Rectangle(rect) : Captured=Grid(LayoutRoot)
MainWindow.GotTouchCapture Grid(LayoutRoot) : Captured=Grid(LayoutRoot)
LayoutRoot.ManipulationInertiaStarting Grid
MainWindow.LostTouchCapture Grid : Captured=null
LayoutRoot.ManipulationCompleted Grid
There are two important differences here:
- On touch down, when manipulation starts, in WPF first the source captures the touch, then it raises ManipulationStarting and ManipulationStarted events. In Noesis capture happens after manipulation start events.
- On touch up, in WPF the TouchUp event is raised before terminating the manipulation. In Noesis TouchUp event is not fired if a manipulation is active.
Another difference is that WPF doesn't send MouseMove events when ManipulationInertiaStarting or ManipulationCompleted events are cancelled. Noesis is sending MouseMove(x,y) before promoting the MouseUp and MouseMove(-1,-1) after. So in WPF the control's "MouseOver" state will keep visible after cancelling the manipulations, but not in Noesis. Although I don't really like how WPF behaves in this situation, because leaves the UI in an incorrect visual state. |