This project is read-only.

Common classes and utilities

Blake.NUI includes several common classes and utilities that are useful for a variety of NUI and multi-touch applications.


DisplayMatrix represents the data behind translation, rotation, and scale transformations for custom multi-touch controls. It allows you to get or set the individual translation, rotate, and scale values, as well as apply delta values, and it calculates the Matrix. You can use this Matrix to transform points to and from the original and transformed spaces.

ZoomCanvas uses a DisplayMatrix to record and update the transformation of the infinite canvas. NaturalShow uses DisplayMatrix also to record the positions of content. You can also use DisplayMatrix to create custom ScatterView-type controls.


If you know the translation, rotation, and scale values for an interface element, ScatterMatrixHelper can generate and update the RenderTransform for the element.


AnimateUtility has static helper methods that set up and run an animation Storyboard on any DependencyProperty for any element. This is extremely useful for programmatically animating elements. Animation methods are provided for animating double, Point, and Vector values.


SurfaceAnimateUtility provides the ThrowSVI method, which makes the necessary AnimateUtility calls to animate a ScatterViewItem's position and orientation to wherever youwant.


MathUtility has a few common math operations including IsEqualFuzzy, MapValue, Clamp, NormalizeAngle, RotateVector, and Get2DAngle.


VisualUtility has two methods useful for walking the visual tree: FindVisualParent and GetChildByType

Last edited Jul 13, 2010 at 2:59 AM by JoshB, version 2


icube Sep 6, 2010 at 5:09 PM 
Hi can you give a small code example on how to use the AnimateUtility and SurfaceAnimateUtility. thanks