本文整理汇总了C#中System.Windows.Input.ManipulationCompletedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ManipulationCompletedEventArgs类的具体用法?C# ManipulationCompletedEventArgs怎么用?C# ManipulationCompletedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ManipulationCompletedEventArgs类属于System.Windows.Input命名空间,在下文中一共展示了ManipulationCompletedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CenterGrid_ManipulateCompleted
private void CenterGrid_ManipulateCompleted(object sender, ManipulationCompletedEventArgs manipulationCompletedEventArgs)
{
double deltaX = TouchDownX - manipulationCompletedEventArgs.ManipulationOrigin.X;
double deltaY = TouchDownY - manipulationCompletedEventArgs.ManipulationOrigin.Y;
double absX = Math.Abs(TouchDownX - manipulationCompletedEventArgs.ManipulationOrigin.X);
double absY = Math.Abs(TouchDownY - manipulationCompletedEventArgs.ManipulationOrigin.Y);
if (absX > absY) //left or right
{
if (deltaX > 0 & deltaX > 12) //right
{
((StudyFlashCardSetViewModel)ViewModel).FlipCardRightCommand.Execute(null);
}
else if (deltaX < -12) //left
{
((StudyFlashCardSetViewModel)ViewModel).FlipCardLeftCommand.Execute(null);
}
}
else // up or down
{
if (deltaY > 0 & deltaY > 12) //up
{
((StudyFlashCardSetViewModel)ViewModel).CorrectNextCardCommand.Execute(null);
}
else if (deltaY < -12) //down
{
((StudyFlashCardSetViewModel)ViewModel).IncorrectNextCardCommand.Execute(null);
}
}
}
示例2: CalendarButton_ManipulationCompleted
private void CalendarButton_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
SolidColorBrush brush = new SolidColorBrush();
brush.Color = (Color)App.Current.Resources["CalendarBackNormalGray"];
CalendarButton.Background = brush;
}
示例3: azul_ManipulationCompleted_1
private void azul_ManipulationCompleted_1(object sender, ManipulationCompletedEventArgs e)
{
Ellipse elipse = sender as Ellipse;
string nombreObjeto = (sender as Ellipse).Name;
bool entroAnterior=false;
if (elipse.Name == "negro" || elipse.Name == "blanco" || elipse.Name == "amarillo" || elipse.Name=="verde")
{
if ((e.TotalManipulation.Translation.Y * -1) > 127 && (e.TotalManipulation.Translation.Y * -1) < 380)
{
entroAnterior= CambiarColores(nombreObjeto);
}
}
else
{
if ((e.TotalManipulation.Translation.Y * -1) > 312 && (e.TotalManipulation.Translation.Y * -1) < 560)
{
entroAnterior= CambiarColores(nombreObjeto);
}
}
if (!entroAnterior)
{
nombreAnterior = (sender as Ellipse).Name;
}
elipse.RenderTransform = null;
}
示例4: OnManipulationCompleted
protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e)
{
base.OnManipulationCompleted(e);
if(BlockTransitions) return;
var horizontalVelocity = e.FinalVelocities.LinearVelocity.X;
var verticalVelocity = e.FinalVelocities.LinearVelocity.Y;
var direction = GetDirection(horizontalVelocity, verticalVelocity);
if (direction == Orientation.Horizontal && Math.Abs(horizontalVelocity) > 200)
{
if (e.TotalManipulation.Translation.X < 0)
{
if (ShowNextButton)
SlideLeft.Begin();
else
SlideTopLeft.Begin();
}
else
{
if (ShowPreviousButton)
SlideRight.Begin();
else
SlideTopRight.Begin();
}
}
}
示例5: CalendarManipulationCompleted
void CalendarManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
while (TouchPanel.IsGestureAvailable)
{
var gesture = TouchPanel.ReadGesture();
if (gesture.GestureType == GestureType.Flick)
{
double horizontal = gesture.Delta.X / Factor;
double vertical = gesture.Delta.Y / Factor;
if (Math.Abs(horizontal) > Math.Abs(vertical))
{
if ((int)horizontal > 0)
{
DecrementMonth();
}
else
{
IncrementMonth();
}
}
else
{
if ((int)vertical > 0)
{
DecrementYear();
}
else
{
IncrementYear();
}
}
}
}
}
示例6: btn_Camera_ManipulationCompleted
private void btn_Camera_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
PhotoChooserTask pcTask = new PhotoChooserTask();
pcTask.ShowCamera = true;
pcTask.Completed += new EventHandler<PhotoResult>(pcTask_Completed);
pcTask.Show();
}
示例7: OnManipulationCompleted
protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e)
{
string dest = "/page2.xaml";
canvy.Children.Remove(jolidessin);
this.NavigationService.Navigate(new Uri(dest, UriKind.Relative));
base.OnManipulationCompleted(e);
}
示例8: azul_ManipulationCompleted_1
// Al soltar el circulo. Comprueba coordenadas.
private void azul_ManipulationCompleted_1(object sender, ManipulationCompletedEventArgs e)
{
Ellipse elipse = sender as Ellipse;
string nombreObjeto = (sender as Ellipse).Name;
double elipsex = Canvas.GetLeft(rect) + e.TotalManipulation.Translation.X;
double elipsey = Canvas.GetTop(rect) + e.TotalManipulation.Translation.Y;
//Canvas.Left="130" Canvas.Top="138" Width="187"
if (elipse.Name == "rojo" || elipse.Name == "azul" || elipse.Name == "amarillo")
{
if ((elipsex * -1) > 130 && (elipsex * -1) < 317)
{
CambiarColores(nombreObjeto, nombreAnterior);
}
}
//??
else
{
if ((e.TotalManipulation.Translation.Y * -1) > 312 && (e.TotalManipulation.Translation.Y * -1) < 560)
{
CambiarColores(nombreObjeto, nombreAnterior);
}
}
if (ver == 0)
{
nombreAnterior = (sender as Ellipse).Name;
}
elipse.RenderTransform = null;
dragTranslation = new CompositeTransform();
}
示例9: OnManipulationCompleted
protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e)
{
if (e.TotalManipulation.Translation.X == 0.0 && e.TotalManipulation.Translation.Y == 0.0)
HandleMouseEvent(e.ManipulationOrigin);
base.OnManipulationCompleted(e);
}
示例10: Slider1ManipulationCompleted
private void Slider1ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
var totalminutes = (int)slider1.Value;
_hours = totalminutes / 60;
_minutes = totalminutes - (60 * _hours);
inpDuration.Value = new TimeSpan(_hours, _minutes, 0);
}
示例11: Element_ManipulationCompleted
private void Element_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
if (!IsActive)
return;
FrameworkElement fe = sender as FrameworkElement;
if (Math.Abs(e.TotalManipulation.Translation.X) > fe.ActualWidth / 2 ||
Math.Abs(e.FinalVelocities.LinearVelocity.X) > FlickVelocity)
{
if (e.TotalManipulation.Translation.X < 0.0)
{
ToDoItemDeletedAction(fe);
}
else
{
ToDoItemCompletedAction(fe);
}
}
else
{
ToDoItemBounceBack(fe);
}
IsActive = false;
}
示例12: OnManipulationCompleted
protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e)
{
FrameworkElement _root = Application.Current.RootVisual
as FrameworkElement;
myDate = (DateTime)_root.DataContext;
// swipe to the right (100 pixels to the right
// and -25 to 25 up or down in the translation)
// change to nextday
if (e.TotalManipulation.Translation.X > 100 &&
(e.TotalManipulation.Translation.Y > -25 &&
e.TotalManipulation.Translation.Y < 25))
{
_root.DataContext = myDate.AddDays(-1);
NavigationService.Navigate(new Uri("/Page/DayEvent.xaml?Refresh=" + DateTime.Now, UriKind.Relative));
}
// swipe to the left (100 pixels to the left
// and -25 to 25 up or down in the translation)
// change to previous day
if (e.TotalManipulation.Translation.X < -100 &&
(e.TotalManipulation.Translation.Y > -25 &&
e.TotalManipulation.Translation.Y < 25))
{
_root.DataContext = myDate.AddDays(1);
NavigationService.Navigate(new Uri("/Page/DayEvent.xaml?Refresh=" + DateTime.Now, UriKind.Relative));
}
}
示例13: FrontImage_ManipulationCompleted
void FrontImage_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
App app = (App)Application.Current;
if (canBeChanged && app.canPlay)
{
Stream stream = TitleContainer.OpenStream("sounds/flip/" + RandomNumber(1, 10) + ".wav");
SoundEffect effect = SoundEffect.FromStream(stream);
FrameworkDispatcher.Update();
effect.Play();
app.manager.setNextCard(this);
}
/*
if (e.OriginalSource == this.FrontImage)
{
Console.Write("foo");
this.FrontImage.Visibility = Visibility.Collapsed;
this.BackImage.Visibility = Visibility.Visible;
}
else if (e.OriginalSource == this.BackImage)
{
Console.Write("foo");
this.BackImage.Visibility = Visibility.Collapsed;
this.FrontImage.Visibility = Visibility.Visible;
}*/
}
示例14: Border_ManipulationCompleted
private void Border_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
// suppress zoom
if (e.FinalVelocities.ExpansionVelocity.X != 0.0 ||
e.FinalVelocities.ExpansionVelocity.Y != 0.0)
e.Handled = true;
}
示例15: canvas_ManipulationCompleted
private void canvas_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
var left = Canvas.GetLeft(LayoutRoot);
if (_viewMoved)
return;
if (Math.Abs(initialPosition - left) < 100)
{
//bouncing back
MoveViewWindow(initialPosition);
return;
}
//change of state
if (initialPosition - left > 0)
{
//slide to the left
if (initialPosition > -420)
MoveViewWindow(-420);
else
MoveViewWindow(-840);
}
else
{
//slide to the right
if (initialPosition < -420)
MoveViewWindow(-420);
else
MoveViewWindow(0);
}
}