private async void ToggleRecurringVisibility(object sender, RoutedEventArgs e) { var viewModel = (ModifyPaymentViewModel)ViewModel; if (viewModel.SelectedPayment.IsRecurring) { await RecurringStackPanel.Fade(1).StartAsync(); } else { await RecurringStackPanel.Fade().StartAsync(); } }
private async void ToggleRecurringVisibility(object sender, RoutedEventArgs e) { if (ViewModel.SelectedPayment == null) { return; } if (ViewModel.SelectedPayment.IsRecurring) { await RecurringStackPanel.Fade(1).StartAsync(); } else { await RecurringStackPanel.Fade().StartAsync(); } }
private async void ToggleRecurringVisibility(object sender, RoutedEventArgs e) { var viewModel = (ModifyPaymentViewModel)ViewModel; // we set the value here to ensure the animation has played before the element is hidden if (!viewModel.SelectedPayment.IsRecurring) { viewModel.SelectedPayment.IsRecurring = !viewModel.SelectedPayment.IsRecurring; await RecurringStackPanel.Fade(1).StartAsync(); } else { await RecurringStackPanel.Fade().StartAsync(); viewModel.SelectedPayment.IsRecurring = !viewModel.SelectedPayment.IsRecurring; } }
private async void ToggleRecurringVisibility(object sender, RoutedEventArgs e) { var viewModel = (ModifyPaymentViewModel)DataContext; if (viewModel.SelectedPayment == null) { return; } if (viewModel.SelectedPayment.IsRecurring) { await RecurringStackPanel.Fade(1).StartAsync(); RecurringStackPanel.Visibility = Visibility.Collapsed; } else { RecurringStackPanel.Visibility = Visibility.Visible; await RecurringStackPanel.Fade().StartAsync(); } }