本文整理汇总了C#中System.Windows.Input.ManipulationStartedEventArgs.GetCurrentPoint方法的典型用法代码示例。如果您正苦于以下问题:C# ManipulationStartedEventArgs.GetCurrentPoint方法的具体用法?C# ManipulationStartedEventArgs.GetCurrentPoint怎么用?C# ManipulationStartedEventArgs.GetCurrentPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Input.ManipulationStartedEventArgs
的用法示例。
在下文中一共展示了ManipulationStartedEventArgs.GetCurrentPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryStartTiltEffect
private static void TryStartTiltEffect(FrameworkElement source, ManipulationStartedEventArgs e)
#endif
{
// Use first child of the control, so that we can add transforms and not
// impact any transforms on the control itself.
#if WINDOWS_STORE
var element = source;
var container = source;
#elif WINDOWS_PHONE
var element = VisualTreeHelper.GetChild(source, 0) as FrameworkElement;
var container = e.ManipulationContainer as FrameworkElement;
#endif
if (element == null || container == null)
return;
// Touch point relative to the element being tilted.
#if WINDOWS_STORE
var tiltTouchPoint = e.GetCurrentPoint(element).Position;
#elif WINDOWS_PHONE
var tiltTouchPoint = container.TransformToVisual(element).Transform(e.ManipulationOrigin);
#endif
// Center of the element being tilted.
var elementCenter = new Point(element.ActualWidth/2, element.ActualHeight/2);
// Camera adjustment.
var centerToCenterDelta = GetCenterToCenterDelta(element, source);
#if WINDOWS_STORE
BeginTiltEffect(element, tiltTouchPoint, elementCenter, centerToCenterDelta, e.Pointer);
#elif WINDOWS_PHONE
BeginTiltEffect(element, tiltTouchPoint, elementCenter, centerToCenterDelta);
#endif
}