private async Task DisappearToBottom() { // Update the cache PageRootCache.Update(); // Animate await PageRootCache.View.TranslateTo(PageRootCache.TranslationX, GetNewTranslationY(PageRootCache), VerticalDuration, QuintIn); // Hide page Page.IsVisible = false; }
private async Task MoveToSide(bool rightSide, bool appearing) { if (appearing) { // Position each element foreach (PropertyCache cache in PageContentCaches) { cache.View.TranslationX = GetNewTranslationX(cache, rightSide); } // Show page Page.IsVisible = true; // Animate each element List <Task> animations = new List <Task>(); foreach (PropertyCache cache in PageContentCaches) { animations.Add(cache.View.TranslateTo(cache.TranslationX, cache.TranslationY, HorizontalDuration, QuintOut)); } await Task.WhenAll(animations); } else { // Update each cache PageRootCache.Update(); foreach (PropertyCache cache in PageContentCaches) { cache.Update(); } // Animate each element List <Task> animations = new List <Task>(); foreach (PropertyCache cache in PageContentCaches) { animations.Add(cache.View.TranslateTo(GetNewTranslationX(cache, rightSide), cache.TranslationY, HorizontalDuration, QuintOut)); } await Task.WhenAll(animations); // Hide page Page.IsVisible = false; } }