By default, Microsoft Surface responds to any touch, including non-finger touches for example caused by a hovering hand or a sleeve touching the table. While they can be ignored using the GetIsFingerRecognized() method and setting the Handled flag of TouchEventArgs in preview touch handlers, the ScatterView seems to be somewhat special. Although you cannot move it ScatterViewItems after having intercepted and set Handled to true, items still come to the top for non-finger touches – which is rather irritating.
Therefore, I implemented a CustomTopmostBehavior, an attached behavior for ScatterViewItems that solves this problem. To enable it for all ScatterViewItems of an application, simply use the following line of code:
CustomTopmostBehavior.Activate();
Alternatively, it can be added to an existing ScatterViewItem style:
<Style TargetType="{x:Type s:ScatterViewItem}"> <!-- Other setters --> <Setter Property="local:CustomTopmostBehavior.IsEnabled" Value="True"/> </Style>
It ignores all non-finger touches and prevents them from bringing ScatterViewItems to the top. This can be customized by changing the CustomTopmostBehavior.TestCondition static property, which is set by default to:
CustomTopmostBehavior.TestCondition = (t) => { return t.GetIsFingerRecognized(); };
Download source code.