Defines a control that implements a surface for the free-form manipulation of items. Namespace: Microsoft.Surface.Presentation.Controls
Assembly: Microsoft.Surface.Presentation (in Microsoft.Surface.Presentation)
[StyleTypedPropertyAttribute(StyleTargetType=typeof(ScatterViewItem), Property="ItemContainerStyle")] public class ScatterView : ItemsControl, ITagVisualizationHost
/** @attribute StyleTypedPropertyAttribute(StyleTargetType=Microsoft.Surface.Presentation.Controls.ScatterViewItem, Property="ItemContainerStyle") */ public class ScatterView extends ItemsControl implements ITagVisualizationHost
A ScatterView control is a container for other controls or objects of any type. It provides the framework for moving and manipulating objects on the screen. When you add an object to the Items property of a ScatterView control, the event handlers required to move and manipulate the object are established automatically.
The Items property is a collection of ScatterViewItem controls, even if your application does not explicitly create ScatterViewItem controls when it adds to the Items collection. When you add an object that is not of type ScatterViewItem, the ScatterView control first wraps your object in a ScatterViewItem control before adding it to the collection. The following code example illustrates this behavior.
<s:ScatterView Name="MainScatterView"> <!-- These controls will automatically be wrapped in a ScatterViewItem control--> <Rectangle Width="42" Height="42" Margin="8" Fill="Blue"/> <Rectangle Width="42" Height="42" Margin="8" Fill="White"/> <Label Content="Label" Margin="8"/> <s:SurfaceButton Content="Button" Margin="16" /> <!-- These controls are explicitly placed inside a ScatterViewItem control--> <s:ScatterViewItem Deceleration="0.0001" SingleInputRotationMode="ProportionalToDistanceFromCenter"> <Label Margin="20" Content="1. Pizza"/> </s:ScatterViewItem> <s:ScatterViewItem Deceleration="0.001"> <Label Margin="20" Content="2. Laundry"/> </s:ScatterViewItem> <s:ScatterViewItem Deceleration="0.01" IsEnabled="False"> <Label Margin="20" Content="3. Movie"/> </s:ScatterViewItem> </s:ScatterView>
After a ScatterViewItem control has been added to the Items collection, users can manipulate it on the screen in a variety of ways. By using simple gestures, users can move, rotate, and scale the ScatterViewItem control. These manipulations can occur simultaneously.
When input devices that are captured by the ScatterViewItem control are released, inertia processing is used to gradually slow the movement and rotation. You can control the speed at which the inertia processing occurs through the Deceleration and AngularDeceleration properties.
As an item is decelerating, if it encounters the bounds of the ScatterView control, it bounces and decelerates more rapidly.
When you use a ScatterView control, multiple objects can simultaneously be the target of user interaction. Active items move to the top of the z-order.
Activation and Deactivation
A ScatterView control activates a ScatterViewItem control when a user starts manipulating the item. By default, when a ScatterViewItem object is activated, it grows slightly larger and displays a shadow beneath it. To disable these effects, set the ShowsActivationEffects property to false.
You can change the activation state of a ScatterViewItem control programmatically. You can use the Activate and Deactivate methods and the IsContainerActive and ContainerStaysActive properties to control the activation state in the manner that your application requires.
|Operating System (OS)||Windows 7|
|Software Developer Kit (SDK)||Surface 2.0 |
.NET Framework 4
|Developer environment||Visual Studio 2010, Express or full edition|
Microsoft Expression Blend 4.0 (optional)
|End-user hardware||Devices made for Surface 2.0, or |
Windows Touch computers
Did you find this information useful? Please send us your suggestions and comments.
© Microsoft Corporation. All rights reserved.