private async void AnimateButton() { if (!collectButton.IsEnabled) { return; } CollectSampleIMG.Scale(scaleX: 1.2f, scaleY: 1.2f, centerX: 0, centerY: 0f, duration: 500, delay: 0, easingType: EasingType.Default).Start(); if (!collectButton.IsEnabled) { return; } await Task.Delay(500); if (!collectButton.IsEnabled) { return; } CollectSampleIMG.Scale(scaleX: 1, scaleY: 1, centerX: 0, centerY: 0f, duration: 500, delay: 0, easingType: EasingType.Default).Start(); if (!collectButton.IsEnabled) { return; } await Task.Delay(500); AnimateButton(); }
private async void collectButton_Click(object sender, RoutedEventArgs e) { Click.Play(); collectButton.IsEnabled = false; CollectSampleIMG.Scale(scaleX: 1.3f, scaleY: 1.3f, centerX: 0, centerY: 0, duration: 200, delay: 0, easingType: EasingType.Default).Start(); await System.Threading.Tasks.Task.Delay(200); CollectSampleIMG.Scale(scaleX: 1, scaleY: 1f, centerX: 0, centerY: 0, duration: 200, delay: 0, easingType: EasingType.Default).Start(); await Task.Delay(1600); Frame.Navigate(typeof(SampleDrop)); }