本文整理汇总了C#中View.AnimateKinetic方法的典型用法代码示例。如果您正苦于以下问题:C# View.AnimateKinetic方法的具体用法?C# View.AnimateKinetic怎么用?C# View.AnimateKinetic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View.AnimateKinetic方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Kinetic
public void Kinetic ()
{
var view = new View ();
var resultList = new List<Tuple<double, double>> ();
view.AnimateKinetic (
name: "Kinetics",
callback: (distance, velocity) => {
resultList.Add (new Tuple<double, double> (distance, velocity));
return true;
},
velocity: 100,
drag: 1);
Assert.That (resultList, Is.Not.Empty);
int checkVelo = 100;
int dragStep = 16;
foreach (var item in resultList) {
checkVelo -= dragStep;
Assert.AreEqual (checkVelo, item.Item2);
Assert.AreEqual (checkVelo * dragStep, item.Item1);
}
}
示例2: KineticFinished
public void KineticFinished ()
{
var view = new View ();
bool finished = false;
view.AnimateKinetic (
name: "Kinetics",
callback: (distance, velocity) => true,
velocity: 100,
drag: 1,
finished: () => finished = true);
Assert.True (finished);
}