本文整理汇总了C#中Input.GetPosition方法的典型用法代码示例。如果您正苦于以下问题:C# Input.GetPosition方法的具体用法?C# Input.GetPosition怎么用?C# Input.GetPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Input
的用法示例。
在下文中一共展示了Input.GetPosition方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnMouseMove
protected override void OnMouseMove(Input.MouseEventArgs e)
{
base.OnMouseMove(e);
if (startTracking)
{
double diff = e.GetPosition(this).X - initialValue;
initialValue = e.GetPosition(this).X;
//Notify the curve needs to be redrawn...
AnimationEditor editor = UIHelper.TryFindParent<AnimationEditor>(this);
if (editor != null) {
editor.NotifyValueIncrement(diff);
}
}
}
示例2: OnMouseMove
internal override void OnMouseMove(Input.MouseEventArgs e)
{
base.OnMouseMove(e);
if (!IsEnabled) return;
if (!IsLeftButtonDown) return;
if (timer != null) return;
Point position = e.GetPosition(TreeView);
if (position.Y < scrollBorderSize)
{
//scroll down
ScrollContinously(-scrollDelta);
}
else if ((TreeView.RenderSize.Height - position.Y) < scrollBorderSize)
{
//scroll up
ScrollContinously(scrollDelta);
}
}
示例3: OnMouseLeftButtonDown
protected override void OnMouseLeftButtonDown(Input.MouseButtonEventArgs e)
{
base.OnMouseLeftButtonDown(e);
startTracking = Mouse.Capture(this);
initialValue = e.GetPosition(this).X;
}
示例4: OnMouseMove
protected override void OnMouseMove(Input.MouseEventArgs e)
{
if (e.LeftButton == Input.MouseButtonState.Pressed && NavigationTriggerMode == Controls.NavigationTriggerMode.MouseDrag)
{
e.Handled = true;
Point currentPosition = e.GetPosition(null);
double baseX = _currentPageIndex * this.Width;
double diffX = currentPosition.X - _mouseDragStartPosition.X;
//foreach (FrameworkElement child in InternalChildren)
//{
// TranslateTransform tt = child.RenderTransform as TranslateTransform;
// tt.X = baseX + diffX;
// tt.X = 500;
//}
_draggedDistance = diffX;
}
base.OnMouseMove(e);
}
示例5: OnMouseDown
protected override void OnMouseDown(Input.MouseButtonEventArgs e)
{
Keyboard.Focus(this);
if (NavigationTriggerMode == Controls.NavigationTriggerMode.MouseClick)
{
if (e.LeftButton == Input.MouseButtonState.Pressed)
{
NavigateToPreviousPage();
}
else if (e.RightButton == Input.MouseButtonState.Pressed)
{
NavigateToNextPage();
}
}
else if (NavigationTriggerMode == Controls.NavigationTriggerMode.MouseDrag)
{
_mouseDragStartPosition = e.GetPosition(null);
}
base.OnMouseDown(e);
}