private void FlipToDataUsage(bool animated) { HasDataUsageSideUp = true; OnPropertyChanged("HasDataUsageSideUp"); HasVpnConnectionSideUp = false; OnPropertyChanged("HasVpnConnectionSideUp"); SpeedVisual.DrawCurves(); DataUsage.Visibility = Visibility.Visible; if (animated) { Storyboard flipAnimation = Resources["FlipToDataUsageStoryboard"] as Storyboard; flipAnimation.Completed += (sender, e) => { VpnConnection.Visibility = Visibility.Collapsed; }; flipAnimation.Begin(); } else { VpnConnection.Visibility = Visibility.Collapsed; } }
private void FlipToDataUsage(bool animated) { HasDataUsageSideUp = true; OnPropertyChanged("HasDataUsageSideUp"); HasVpnConnectionSideUp = false; OnPropertyChanged("HasVpnConnectionSideUp"); SpeedVisual.DrawCurves(); if (animated) { Storyboard flipAnimation = Resources["FlipToDataUsageStoryboard"] as Storyboard; AddTimelineCompleteHandler(flipAnimation, () => UpdateCardVisibility()); DataUsage.Visibility = Visibility.Visible; flipAnimation.Begin(); } else { UpdateCardVisibility(); } }