本文整理匯總了C#中Windows.UI.Xaml.Input.ManipulationDeltaRoutedEventArgs.Complete方法的典型用法代碼示例。如果您正苦於以下問題:C# ManipulationDeltaRoutedEventArgs.Complete方法的具體用法?C# ManipulationDeltaRoutedEventArgs.Complete怎麽用?C# ManipulationDeltaRoutedEventArgs.Complete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Windows.UI.Xaml.Input.ManipulationDeltaRoutedEventArgs
的用法示例。
在下文中一共展示了ManipulationDeltaRoutedEventArgs.Complete方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnManipulationDelta
private void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
if (_panel.ItemsFitContent)
{
return;
}
double deltaX = e.Delta.Translation.X;
if (e.IsInertial)
{
e.Complete();
}
else
{
if (Math.Abs(e.Cumulative.Translation.X) >= this.ItemWidthEx)
{
e.Complete();
}
else
{
_headerContainer.TranslateDeltaX(deltaX);
_panelContainer.TranslateDeltaX(deltaX);
if (Math.Sign(deltaX) > 0)
{
_tabsContainer.TranslateDeltaX(deltaX * _tabs.PrevTabWidth / this.ItemWidthEx);
}
else
{
_tabsContainer.TranslateDeltaX(deltaX * _tabs.SelectedTabWidth / this.ItemWidthEx);
}
}
}
e.Handled = true;
}
示例2: OnManipulationDelta
private void OnManipulationDelta(object Sender, ManipulationDeltaRoutedEventArgs DeltaRoutedEventArgs)
{
if (DeltaRoutedEventArgs.IsInertial)
{
if (_manipulationStartPoint.X - DeltaRoutedEventArgs.Position.X > 200)
{
_gameGrid.HandleMove(MoveDirection.Left);
DeltaRoutedEventArgs.Complete();
DeltaRoutedEventArgs.Handled = true;
}
else if (DeltaRoutedEventArgs.Position.X - _manipulationStartPoint.X > 200)
{
_gameGrid.HandleMove(MoveDirection.Right);
DeltaRoutedEventArgs.Complete();
DeltaRoutedEventArgs.Handled = true;
}
else if (_manipulationStartPoint.Y - DeltaRoutedEventArgs.Position.Y > 200)
{
_gameGrid.HandleMove(MoveDirection.Up);
DeltaRoutedEventArgs.Complete();
DeltaRoutedEventArgs.Handled = true;
}
else if (DeltaRoutedEventArgs.Position.Y - _manipulationStartPoint.Y > 200)
{
_gameGrid.HandleMove(MoveDirection.Down);
DeltaRoutedEventArgs.Complete();
DeltaRoutedEventArgs.Handled = true;
}
}
}
示例3: circlePanel_ManipulationDelta
private void circlePanel_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
rotateTransform.CenterX = circlePanel.X;
rotateTransform.CenterY = circlePanel.Y;
storyboard.Begin();
e.Complete();
}
示例4: OnAdornManipulationDelta
private async void OnAdornManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
double delta = e.Delta.Translation.Y;
await TranslateDelta(delta);
if (_cancelManipulation)
{
e.Complete();
}
}
示例5: MapManipulationDelta
private void MapManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
if (manipulationActive)
{
map.TransformMap(e.Position, e.Delta.Translation, e.Delta.Rotation, e.Delta.Scale);
}
else
{
e.Complete();
}
}
示例6: ManipDelta
private void ManipDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
if (e.IsInertial && _manipulating)
{
var currentpoint = e.Position;
if (currentpoint.X - _initialPoint.X >= 70) // swipe right
{
e.Complete();
e.Handled = true;
_manipulating = false;
ViewModel.NavigateDetails();
}
}
}
示例7: OnManipulationDelta
private void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
if ((Math.Sign(e.Delta.Translation.Y) < 0 && this.SelectedIndex == this.Children.Count - 1))
{
e.Complete();
return;
}
_current = _current ?? GetEligibleControl(e.Delta.Translation.Y);
double deltaY = e.Delta.Translation.Y;
double translateY = _current.GetTranslateY();
_lastDeltaSign = Math.Sign(deltaY);
double y = Math.Max(GetTopBound(), translateY + deltaY);
y = Math.Min(0, y);
_current.TranslateY(y);
}
示例8: _ManipulationDelta
private void _ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
Point end = e.Position;
e.Complete();
if (Math.Abs(end.X - start.X) < 5 && Math.Abs(end.Y - start.Y) < 5)
{
return;
}
if (Math.Abs(end.X - start.X) > Math.Abs(end.Y - start.Y))
{
if (end.X - start.X > 0) { Move(RIGHT); }
else { Move(LEFT); }
}
else
{
if (end.Y - start.Y > 0) { Move(DOWN); }
else { Move(UP); }
}
}
示例9: ManipulateMe_ManipulationDelta
// Process the change resulting from a manipulation
void ManipulateMe_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
// If the reset button has been pressed, mark the manipulation as completed
if (forceManipulationsToEnd)
{
e.Complete();
return;
}
previousTransform.Matrix = transforms.Value;
// Get center point for rotation
Point center = previousTransform.TransformPoint(new Point(e.Position.X, e.Position.Y));
deltaTransform.CenterX = center.X;
deltaTransform.CenterY = center.Y;
// Look at the Delta property of the ManipulationDeltaRoutedEventArgs to retrieve
// the rotation, scale, X, and Y changes
deltaTransform.Rotation = e.Delta.Rotation;
deltaTransform.TranslateX = e.Delta.Translation.X;
deltaTransform.TranslateY = e.Delta.Translation.Y;
}
示例10: ManipulateMe_OnManipulationDelta
private void ManipulateMe_OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
if (_forceManipulationsToEnd)
{
e.Complete();
return;
}
_previousTransform.Matrix = _transformGroup.Value;
Point center = _previousTransform.TransformPoint(new Point(e.Position.X, e.Position.Y));
_compositeTransform.CenterX = center.X;
_compositeTransform.CenterY = center.Y;
_compositeTransform.Rotation = e.Delta.Rotation;
_compositeTransform.ScaleX = _compositeTransform.ScaleY = e.Delta.Scale;
_compositeTransform.TranslateX = e.Delta.Translation.X;
_compositeTransform.TranslateY = e.Delta.Translation.Y;
e.Handled = true;
}
示例11: ManipulateMe_ManipulationDelta
void ManipulateMe_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
if (forceManipulationsToEnd)
{
e.Complete();
return;
}
//Set the new transform values based on user action
previousTransform.Matrix = transformGroup.Value;
compositeTransform.TranslateX = e.Delta.Translation.X / scrollViewer.ZoomFactor;
compositeTransform.TranslateY = e.Delta.Translation.Y / scrollViewer.ZoomFactor;
e.Handled = true;
}
示例12: ValidatePosition
private void ValidatePosition(CompositeTransform ct, ManipulationDeltaRoutedEventArgs deltaEventArgs = null)
{
Point point = element.TransformToVisual(Container).TransformPoint(new Point(0, 0));
if (point.X <= 0)
{
if (deltaEventArgs != null) deltaEventArgs.Complete();
ct.TranslateX = 0;
Rect rect = element.TransformToVisual(Container).TransformBounds(
new Rect(new Point(0, 0), element.RenderSize));
ct.TranslateX = -rect.Left;
}
if (point.X + element.ActualWidth >= Container.ActualWidth)
{
if (deltaEventArgs != null) deltaEventArgs.Complete();
ct.TranslateX = 0;
Rect rect = element.TransformToVisual(Container).TransformBounds(
new Rect(new Point(0, 0), element.RenderSize));
ct.TranslateX = Container.ActualWidth - rect.Right;
}
if (point.Y <= 0)
{
if (deltaEventArgs != null) deltaEventArgs.Complete();
ct.TranslateY = 0;
Rect rect = element.TransformToVisual(Container).TransformBounds(
new Rect(new Point(0, 0), element.RenderSize));
ct.TranslateY = -rect.Top;
}
if (point.Y + element.ActualHeight >= Container.ActualHeight)
{
if (deltaEventArgs != null) deltaEventArgs.Complete();
ct.TranslateY = 0;
Rect rect = element.TransformToVisual(Container).TransformBounds(
new Rect(new Point(0, 0), element.RenderSize));
ct.TranslateY = Container.ActualHeight - rect.Bottom;
}
}
示例13: PaginaGrid_ManipulationDelta
/// <summary>
/// Word opgeroepen tijdens het swypen.
/// er wordt gecontroleerd of de swype beëindigd is of niet (e.IsInertial). Indien wel, dan wordt het eindpunt bepaald
/// en wordt gekeken of de swype afstand op de X-as ver genoeg was om de menuanimatie te starten.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void PaginaGrid_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
if (e.IsInertial)
{
Point eindPunt = e.Position;
double afstand = eindPunt.X - beginPunt.X;
if (afstand >= 500)//500 is the threshold value, where you want to trigger the swipe right event
{
e.Complete();
if (!ucMenu.IsMenuOpen())
ucMenu.BeginMenuAnimatie();
}
else if (afstand <= -500)
{
e.Complete();
if (ucMenu.IsMenuOpen())
ucMenu.BeginMenuAnimatie();
}
}
}
示例14: SlideView_ManipulationDelta
void SlideView_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
#endif
{
if (!IsSlideEnabled)
{
e.Complete();
return;
}
#if WINDOWS_PHONE
var deltaManipulation = e.DeltaManipulation;
#elif NETFX_CORE
var deltaManipulation = e.Delta;
#endif
var rightOffset = Panel.GetOffset(SelectedIndex + 1);
var leftOffset = Panel.GetOffset(SelectedIndex - 1);
double offset = Math.Max(rightOffset, Math.Min(leftOffset, _translate.X + deltaManipulation.Translation.X));
_translate.X = offset;
#if NETFX_CORE
if (e.IsInertial)
{
e.Complete();
}
#endif
}
示例15: OnManipulationDelta
protected override void OnManipulationDelta(ManipulationDeltaRoutedEventArgs e)
#endif
{
#if SILVERLIGHT
var delta = e.DeltaManipulation.Translation;
var cumulative = e.CumulativeManipulation.Translation;
#else
if (e.PointerDeviceType != Windows.Devices.Input.PointerDeviceType.Touch ||
_parent?.SelectionMode == ListViewSelectionMode.Multiple ||
_parent?.SelectionMode == ListViewSelectionMode.Extended)
{
e.Complete();
return;
}
var delta = e.Delta.Translation;
var cumulative = e.Cumulative.Translation;
#endif
var target = ((ActualWidth / 5) * 1);
if (_direction == SwipeListDirection.None)
{
_direction = delta.X > 0
? SwipeListDirection.Left
: SwipeListDirection.Right;
DragBackground.Background = _direction == SwipeListDirection.Left
? LeftBackground
: RightBackground;
LeftTransform.X = -(LeftContainer.ActualWidth + 20);
RightTransform.X = (RightContainer.ActualWidth + 20);
DragClip.Rect = new Rect(_direction == SwipeListDirection.Left ? -ActualWidth : ActualWidth, 0, ActualWidth, ActualHeight);
if (_direction == SwipeListDirection.Left && LeftBehavior != SwipeListBehavior.Disabled)
{
DragBackground.Background = LeftBackground;
LeftContainer.Visibility = Visibility.Visible;
RightContainer.Visibility = Visibility.Collapsed;
}
else if (_direction == SwipeListDirection.Right && RightBehavior != SwipeListBehavior.Disabled)
{
DragBackground.Background = RightBackground;
LeftContainer.Visibility = Visibility.Collapsed;
RightContainer.Visibility = Visibility.Visible;
}
else
{
e.Complete();
return;
}
}
if (_direction == SwipeListDirection.Left)
{
var area1 = LeftBehavior == SwipeListBehavior.Collapse ? 1.5 : 2.5;
var area2 = LeftBehavior == SwipeListBehavior.Collapse ? 2 : 3;
ContentDragTransform.X = Math.Max(0, Math.Min(cumulative.X, ActualWidth));
DragClipTransform.X = Math.Max(0, Math.Min(cumulative.X, ActualWidth));
if (ContentDragTransform.X < target * area1)
{
LeftTransform.X += (delta.X / 1.5);
}
else if (ContentDragTransform.X >= target * area1 && ContentDragTransform.X < target * area2)
{
LeftTransform.X += (delta.X * 2.5);
}
else
{
LeftTransform.X = Math.Max(0, Math.Min(cumulative.X, ActualWidth)) - LeftContainer.ActualWidth;
}
if (ContentDragTransform.X == 0 && delta.X < 0)
{
_direction = SwipeListDirection.None;
}
}
else if (_direction == SwipeListDirection.Right)
{
var area1 = RightBehavior == SwipeListBehavior.Collapse ? 1.5 : 2.5;
var area2 = RightBehavior == SwipeListBehavior.Collapse ? 2 : 3;
ContentDragTransform.X = Math.Max(-ActualWidth, Math.Min(cumulative.X, 0));
DragClipTransform.X = Math.Max(-ActualWidth, Math.Min(cumulative.X, 0));
if (ContentDragTransform.X > -(target * area1))
{
RightTransform.X += (delta.X / 1.5);
}
else if (ContentDragTransform.X <= -(target * area1) && ContentDragTransform.X > -(target * area2))
{
RightTransform.X += (delta.X * 2.5);
}
else
//.........這裏部分代碼省略.........