本文整理汇总了C#中Windows.UI.Xaml.Input.PointerRoutedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# PointerRoutedEventArgs类的具体用法?C# PointerRoutedEventArgs怎么用?C# PointerRoutedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PointerRoutedEventArgs类属于Windows.UI.Xaml.Input命名空间,在下文中一共展示了PointerRoutedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnPointerWheelChanged
private void OnPointerWheelChanged(object sender, PointerRoutedEventArgs e)
{
if (_isBusy)
{
return;
}
if (_panel.ItemsFitContent)
{
return;
}
var point = e.GetCurrentPoint(this);
int sign = Math.Sign(point.Properties.MouseWheelDelta);
if (sign > 0)
{
_headerContainer.TranslateDeltaX(1);
_panelContainer.TranslateDeltaX(1);
AnimatePrev();
}
else
{
_headerContainer.TranslateDeltaX(-1);
_panelContainer.TranslateDeltaX(-1);
AnimateNext();
}
e.Handled = true;
}
示例2: MyCanvas_PointerMoved
private void MyCanvas_PointerMoved(object sender, PointerRoutedEventArgs e)
{
PointerPoint point = e.GetCurrentPoint(this);
// move paddle... x
game.paddle.Move(point.Position.X);
}
示例3: CommentItem_PointerReleased
private void CommentItem_PointerReleased(object sender, PointerRoutedEventArgs e)
{
if (AppSettings.Instance.UserInfo != null)
{
reviewRect.Visibility = reviewRect.Visibility == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;
}
}
示例4: xamDataChart_PointerMoved
void xamDataChart_PointerMoved(object sender, PointerRoutedEventArgs e,
Infragistics.Controls.Charts.XamDataChart targetChart)
{
XamDataChart chart = sender as XamDataChart;
if (chart == null)
{
return;
}
//System.Diagnostics.Debug.WriteLine(targetChart.GetHashCode().ToString() + " PointerMoved: " + e.GetCurrentPoint(null).Position.ToString());
chart = targetChart;
foreach (var series in chart.Series)
{
var seriesPos = e.GetCurrentPoint(series).Position;
//System.Diagnostics.Debug.WriteLine("TrySelectClosest: " + seriesPos.ToString());
if (seriesPos.X >= 0 &&
seriesPos.X < series.ActualWidth &&
(sender != targetChart || (seriesPos.Y >= 0 && seriesPos.Y < series.ActualHeight)))
{
SelectClosest(
series, seriesPos);
}
}
if (sender == targetChart)
CategoryChart_PointerMoved(sender, e, targetChart);
if (sender == targetChart)
{
this.NotifyOtherTracker(sender, e);
}
}
示例5: StackPanel_PointerPressed_1
private void StackPanel_PointerPressed_1(object sender, PointerRoutedEventArgs e)
{
tipo = 1;
this.Frame.Navigate(typeof(ItemsPage), "AllGroups");
}
示例6: dPadPressed
private void dPadPressed(object sender, PointerRoutedEventArgs e)
{
Image dPad = (Image)sender;
PointerPoint point = e.GetCurrentPoint(dPad);
Mediator.DPadPressed(point, dPad.Name);
}
示例7: uiElement_PointerMoved
protected virtual void uiElement_PointerMoved(object sender, PointerRoutedEventArgs e)
{
if (moveD3dCanvas)
{
var newPosition = e.GetCurrentPoint(null);
double deltaX = newPosition.Position.X - lastPos.Position.X;
double deltaY = newPosition.Position.Y - lastPos.Position.Y;
// Only support CompositeTransform and TranslateTransform
// Is there any better way to handle this?
if (uiElement.RenderTransform is CompositeTransform)
{
var compositeTransform = (CompositeTransform)uiElement.RenderTransform;
compositeTransform.TranslateX += deltaX;
compositeTransform.TranslateY += deltaY;
}
else if (uiElement.RenderTransform is TranslateTransform)
{
var translateTransform = (TranslateTransform)uiElement.RenderTransform;
translateTransform.X += deltaX;
translateTransform.Y += deltaY;
}
lastPos = newPosition;
}
}
示例8: OnPointerPressed
public void OnPointerPressed(InqCanvas inqCanvas, PointerRoutedEventArgs e)
{
Debug.WriteLine(e.Pointer.PointerDeviceType);
_currentStroke = new PointCollection();
_polyline = new Polyline
{
Stroke = new SolidColorBrush(StrokeColor),
StrokeThickness = 3,
StrokeLineJoin = PenLineJoin.Round
};
inqCanvas.Children.Add(_polyline);
_polyline.Points = _currentStroke;
var point = e.GetCurrentPoint(inqCanvas);
_strokeBuilder.BeginStroke(point);
_currentStroke.Add(point.Position);
//_inkManager.
/*
//TODO: add data binding for thickness and color
_currentStroke.StrokeThickness = Math.Max(4.0 * e.GetCurrentPoint(inqCanvas).Properties.Pressure, 2);
_currentInqLineView.StrokeThickness = _currentStroke.StrokeThickness;
inqCanvas.Children.Add(_currentInqLineView);
var currentPoint = e.GetCurrentPoint(inqCanvas);
_currentStroke.AddPoint(new Point(currentPoint.Position.X, currentPoint.Position.Y));
*/
}
示例9: OnPointerPressed
public static void OnPointerPressed(RadialSlider slider, PointerRoutedEventArgs e)
{
slider.CapturePointer(e.Pointer);
_lastPoint = e.GetCurrentPoint(slider);
_isDragActive = true;
e.Handled = true;
}
示例10: Canvas_PointerReleased
private void Canvas_PointerReleased(object sender, PointerRoutedEventArgs e)
{
if (figureStartPoint != null)
{
var index = (int)((Figures.Margin.Left - 10) / 70);
Figure figure = new Figure();
figure.X1 = figureStartPoint.Position.X;
figure.Y1 = figureStartPoint.Position.Y;
figure.X2 = e.GetCurrentPoint(Canvas).Position.X;
figure.Y2 = e.GetCurrentPoint(Canvas).Position.Y;
figure.Fig = (FigureType)index;
switch ((int)rotateColors.Angle)
{
case 0:
figure.Color = Windows.UI.Color.FromArgb(255, 255, 0, 0);
break;
case 90:
figure.Color = Windows.UI.Color.FromArgb(255, 0, 255, 0);
break;
case 180:
figure.Color = Windows.UI.Color.FromArgb(255, 0, 0, 255);
break;
case 270:
figure.Color = Windows.UI.Color.FromArgb(255, 0, 0, 0);
break;
default:
break;
}
AddFigureToCanvas(figure);
figureStartPoint = null;
}
}
示例11: OnPointerEntered
private void OnPointerEntered(object sender, PointerRoutedEventArgs args)
{
if (args.Pointer.IsInContact)
SetPressedContent();
else
SetOverContent();
}
示例12: PlayArea_PointerPressed
private void PlayArea_PointerPressed(object sender, PointerRoutedEventArgs e)
{
if (!_gameBoard.Interactable)
return;
if (_clickedPoint.Equals(EmptyPoint))
{
_clickedPoint = e.GetCurrentPoint(PlayArea).Position;
int row = (int)e.GetCurrentPoint(PlayArea).Position.Y / 60;
int col = (int)e.GetCurrentPoint(PlayArea).Position.X / 60;
_selectionSquare.Visibility = Visibility.Visible;
_selectionSquare.SetValue(Canvas.LeftProperty, col * 60);
_selectionSquare.SetValue(Canvas.TopProperty, row * 60);
}
else
{
int clickedRow = (int) _clickedPoint.Y/60;
int clickedCol = (int) _clickedPoint.X/60;
int row = (int) e.GetCurrentPoint(PlayArea).Position.Y/60;
int col = (int) e.GetCurrentPoint(PlayArea).Position.X/60;
_gameBoard.Swap(row, col, clickedRow, clickedCol);
_clickedPoint = EmptyPoint;
_selectionSquare.Visibility = Visibility.Collapsed;
}
}
示例13: gridNLS_PointerExited
private void gridNLS_PointerExited(object sender, PointerRoutedEventArgs e)
{
borderNLS.Opacity = 0;
rectNLS.Opacity = 0.5;
rectNLS.Fill = new SolidColorBrush(Colors.Black);
tbkNLS.Foreground = new SolidColorBrush(Colors.White);
}
示例14: LayoutRoot_PointerPressed
public void LayoutRoot_PointerPressed(object sender, PointerRoutedEventArgs args)
{
//verify the settings have been entered and if so, launch the conventional navigation
var canRun = true;
object apiKey = null;
if (!Windows.Storage.ApplicationData.Current.RoamingSettings.Values.TryGetValue("FlickrApiKey", out apiKey) || string.IsNullOrWhiteSpace((string)apiKey))
{
canRun = false;
}
object username = null;
if (!Windows.Storage.ApplicationData.Current.RoamingSettings.Values.TryGetValue("FlickrUsername", out username) || string.IsNullOrWhiteSpace((string)username))
{
canRun = false;
}
if (canRun)
{
_RunApp((string)username, (string)apiKey);
}
else
{
var dialog = new MessageDialog("MetroFlickr requires an API key and a username in order to run. Please enter these in the settings charm under Preferences");
dialog.ShowAsync();
}
}
示例15: grdMatrix_pointer_pressed
// On clicking of one of the Matrix LEDs find which row/column and enable/disable
private void grdMatrix_pointer_pressed(object sender, PointerRoutedEventArgs e)
{
Rectangle _rect = sender as Rectangle;
int _row = (int)_rect.GetValue(Grid.RowProperty);
int _col = (int)_rect.GetValue(Grid.ColumnProperty);
togglePixelandRedraw(_row, _col);
}