protected override void OnIsLoadingMoreChanged() { InitializeLoadingMoreAnimation(); if (IsLoadingMore) { if (Footer == null) { Footer = _animationView; } _animationView.AbortAnimation(GetHashCode().ToString()); _animationView.IsVisible = true; _animationView.Play(); } else { _animationView.AbortAnimation(GetHashCode().ToString()); _animationView.IsPlaying = false; _animationView.IsVisible = false; Footer = null; } }
private void UpdateControlStateWithAnimation() { if (IsFavorite) { if (Parent is Layout <View> animationContainer) { //await Task.Delay(1000); if (!animationContainer.Children.Contains(_animationView)) { animationContainer.Children.Add(_animationView); } Source = null; _animationView.AbortAnimation(GetHashCode().ToString()); _animationView.IsVisible = true; _animationView.Play(); } else { System.Diagnostics.Debug.WriteLine($"Favorite button doesn't have parent container to render animation."); } } }