本文整理匯總了C#中Xamarin.Forms.View.TranslateTo方法的典型用法代碼示例。如果您正苦於以下問題:C# View.TranslateTo方法的具體用法?C# View.TranslateTo怎麽用?C# View.TranslateTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Xamarin.Forms.View
的用法示例。
在下文中一共展示了View.TranslateTo方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Appearing
public async override Task Appearing(View content, PopupPage page)
{
var taskList = new List<Task>();
taskList.Add(base.Appearing(content, page));
if (content != null)
{
var topOffset = GetTopOffset(content, page);
var leftOffset = GetLeftOffset(content, page);
if (PositionIn == MoveAnimationOptions.Top)
{
content.TranslationY = -topOffset;
}
else if (PositionIn == MoveAnimationOptions.Bottom)
{
content.TranslationY = topOffset;
}
else if (PositionIn == MoveAnimationOptions.Left)
{
content.TranslationX = -leftOffset;
}
else if (PositionIn == MoveAnimationOptions.Right)
{
content.TranslationX = leftOffset;
}
taskList.Add(content.TranslateTo(_defaultTranslationX, _defaultTranslationY, DurationIn, EasingIn));
}
page.IsVisible = true;
await Task.WhenAll(taskList);
}
示例2: Disappearing
public async override Task Disappearing(View content, PopupPage page)
{
var taskList = new List<Task>();
taskList.Add(base.Disappearing(content, page));
if (content != null)
{
_defaultTranslationY = content.TranslationX;
var topOffset = GetTopOffset(content, page);
taskList.Add(content.TranslateTo(content.TranslationX, topOffset, DurationOut, EasingOut));
};
await Task.WhenAll(taskList);
}
示例3: Appearing
public async override Task Appearing(View content, PopupPage page)
{
var taskList = new List<Task>();
taskList.Add(base.Appearing(content, page));
if (content != null)
{
var topOffset = GetTopOffset(content, page);
content.TranslationY = topOffset;
taskList.Add(content.TranslateTo(content.TranslationX, _defaultTranslationY, DurationIn, EasingIn));
};
page.IsVisible = true;
await Task.WhenAll(taskList);
}
示例4: Disappearing
public async override Task Disappearing(View content, PopupPage page)
{
var taskList = new List<Task>();
taskList.Add(base.Disappearing(content, page));
if (content != null)
{
UpdateDefaultTranslations(content);
var topOffset = GetTopOffset(content, page);
var leftOffset = GetLeftOffset(content, page);
if (PositionOut == MoveAnimationOptions.Top)
{
taskList.Add(content.TranslateTo(_defaultTranslationX, -topOffset, DurationOut, EasingOut));
}
else if (PositionOut == MoveAnimationOptions.Bottom)
{
taskList.Add(content.TranslateTo(_defaultTranslationX, topOffset, DurationOut, EasingOut));
}
else if (PositionOut == MoveAnimationOptions.Left)
{
taskList.Add(content.TranslateTo(-leftOffset, _defaultTranslationY, DurationOut, EasingOut));
}
else if (PositionOut == MoveAnimationOptions.Right)
{
taskList.Add(content.TranslateTo(leftOffset, _defaultTranslationY, DurationOut, EasingOut));
}
}
await Task.WhenAll(taskList);
}