private void ManipulationProcessor_ManipulationUpdate(object sender, SofthinkCore.Gestures.Processor.ManipulationGestureEventArgs e) { var postit = sender as Postit; var matrix = (postit.RenderTransform != null) ? postit.RenderTransform.Value : new Matrix(); Point ct = new Point(postit.RenderSize.Width / 2, postit.RenderSize.Height / 2); // transform it to take into account transforms from previous manipulations ct = matrix.Transform(ct); //this will be a Zoom. matrix.ScaleAt(e.Delta.ScaleX, e.Delta.ScaleY, ct.X, ct.Y); // Rotation matrix.RotateAt(Geometry2DHelper.RadiansToDegree(e.Delta.Rotation), ct.X, ct.Y); //Translation (pan) matrix.Translate(e.Delta.TranslationX, e.Delta.TranslationY); postit.RenderTransform = new MatrixTransform(matrix); }
private void HoldProcessor_Hold(object sender, SofthinkCore.Gestures.Processor.HoldEventArgs e) { var postit = sender as Postit; postit.Background = new SolidColorBrush(RandomHelper.GetRandomColor()); }