本文整理匯總了C#中Windows.UI.Xaml.Input.ManipulationDeltaRoutedEventArgs類的典型用法代碼示例。如果您正苦於以下問題:C# ManipulationDeltaRoutedEventArgs類的具體用法?C# ManipulationDeltaRoutedEventArgs怎麽用?C# ManipulationDeltaRoutedEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ManipulationDeltaRoutedEventArgs類屬於Windows.UI.Xaml.Input命名空間,在下文中一共展示了ManipulationDeltaRoutedEventArgs類的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: DeltaImageManipulation
private void DeltaImageManipulation(object sender, ManipulationDeltaRoutedEventArgs e)
{
Image block = (Image)sender;
_thickness.Left = block.Margin.Left + e.Delta.Translation.X;
_thickness.Top = block.Margin.Top + e.Delta.Translation.Y;
block.Margin = _thickness;
}
示例3: if
private void rect觸控測試區_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
Debug.WriteLine("ManipulationDelta");
if (e.Cumulative.Translation.X > 150)
{
Refresh手勢操作結果("向右滑動");
e.Handled = true;
}
else if (e.Cumulative.Translation.X < -150)
{
Refresh手勢操作結果("向左滑動");
e.Handled = true;
}
else if (e.Cumulative.Translation.Y > 150)
{
Refresh手勢操作結果("向下滑動");
e.Handled = true;
}
else if (e.Cumulative.Translation.Y < -150)
{
Refresh手勢操作結果("向上滑動");
e.Handled = true;
}
}
示例4: theCanvas_ManipulationDelta
private void theCanvas_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
if (isInInertion)
{
return;
}
var top = Canvas.GetTop(this.rect);
var left = Canvas.GetLeft(this.rect);
top += e.Delta.Translation.Y;
left += e.Delta.Translation.X;
var scale = e.Delta.Scale;
//var oldWidth = this.rect.Width;
//var oldHeight = this.rect.Height;
//this.rect.Width *= scale;
//this.rect.Height *= scale;
//top -= (this.rect.Height - oldHeight) / 2;
//left -= (this.rect.Width - oldWidth) / 2;
Canvas.SetTop(this.rect, top);
Canvas.SetLeft(this.rect, left);
var transform = this.rect.RenderTransform as CompositeTransform;
//transform.ScaleX += e.Delta.Scale / 100;
//transform.ScaleY += e.Delta.Scale / 100;
transform.CenterX = this.rect.Width / 2;
transform.CenterY = this.rect.Height / 2;
transform.Rotation += e.Delta.Rotation;
//transform.Angle += e.Delta.Rotation;
}
示例5: CaptureOnManipulationDelta
private void CaptureOnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs args)
{
//Not inertia
if (args.IsInertial)
{
return;
}
var zoom = ViewModel.Zoom;
if (zoom != null && zoom.Supported)
{
double max = args.Cumulative.Translation.Y;
double halfHeight = Window.Current.Bounds.Height / 8;
double delta = - (max / halfHeight);
float value = currentZoom + Convert.ToInt32(delta) * 0.5f;
if (value >= zoom.Min && value <= zoom.Max)
{
zoom.Value = value;
}
}
}
示例6: OnManipulationDelta
private void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
if (e.PointerDeviceType != PointerDeviceType.Mouse)
{
TransformMap(e.Position, e.Delta.Translation, e.Delta.Rotation, e.Delta.Scale);
}
}
示例7: ItemLayer_ManipulationDelta
private void ItemLayer_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
if (e.Cumulative.Translation.X != 0.0)
{
Grid itemlayer = (Grid)sender;
var transform = (CompositeTransform)itemlayer.RenderTransform;
User user = ((FrameworkElement)e.OriginalSource).DataContext as User;
if (user == null) return;
// Reveals Call
if (e.Cumulative.Translation.X < -16 && Math.Abs(e.Cumulative.Translation.X) <= 128)
{
transform.TranslateX = e.Cumulative.Translation.X;
}
// Reveals Email
if (e.Cumulative.Translation.X > 16 && e.Cumulative.Translation.X <= 128)
{
transform.TranslateX = e.Cumulative.Translation.X;
}
e.Handled = true;
}
else
{
e.Handled = false;
}
}
示例8: 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;
}
}
}
示例9: OnPageManipulationDelta
private void OnPageManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
var delta = e.Delta;
var translationDelta = delta.Translation;
this.ViewModel.MovePlayer(translationDelta.Y);
}
示例10: circlePanel_ManipulationDelta
private void circlePanel_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
rotateTransform.CenterX = circlePanel.X;
rotateTransform.CenterY = circlePanel.Y;
storyboard.Begin();
e.Complete();
}
示例11: Grid_ManipulationDelta
private void Grid_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
k.Rotate(-e.Delta.Rotation/180.0 * Math.PI);
k.Translate(e.Delta.Translation);
if(e.Delta.Scale>0)
k.Scale(e.Delta.Scale);
G.Background = new SolidColorBrush(Colors.AliceBlue);
}
示例12: RightHandle_ManipulationDelta
private void RightHandle_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
var t = (sender as Grid).RenderTransform as CompositeTransform;
var x = (LeftHandle.RenderTransform as CompositeTransform).TranslateX;
var f = x + this.Size * .5;
var c = this.Range;
t.TranslateX = Translate(t, e, f, c);
RightHandleText.Text = Text(t.TranslateX);
}
示例13: Ellipse_ManipulationDelta
private void Ellipse_ManipulationDelta(object sender,
ManipulationDeltaRoutedEventArgs e)
{
var elli = sender as Ellipse;
var delta = e.Delta;
this.ScaleEllipse(elli, delta);
this.RotateEllipse(elli, delta);
this.TranslateEllipse(elli, delta);
}
示例14: Translate
private double Translate(CompositeTransform s, ManipulationDeltaRoutedEventArgs e, double floor, double ceiling)
{
var target = s.TranslateX + e.Delta.Translation.X;
if (target < floor)
return floor;
if (target > ceiling)
return ceiling;
return target;
}
示例15: OnAdornManipulationDelta
private async void OnAdornManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
double delta = e.Delta.Translation.Y;
await TranslateDelta(delta);
if (_cancelManipulation)
{
e.Complete();
}
}