private async void App_Suspending(object sender, SuspendingEventArgs e) { var deferral = e.SuspendingOperation.GetDeferral(); await _customerDataProvider.SaveCustomersAsync(customerListView.Items.OfType <Customer>()); deferral.Complete(); }
private async void App_Suspending(object sender, SuspendingEventArgs e) { // Requests that the app suspending operation be delayed. var deferral = e.SuspendingOperation.GetDeferral(); await _customerDataProvider.SaveCustomersAsync( customerListView.Items.OfType <Customer>()); // Notifies the operating system that the app has saved its data // and is ready to be suspended. deferral.Complete(); }
private async void App_Suspending(object sender, SuspendingEventArgs e) { await _customerDataProvider.SaveCustomersAsync( customerListView.Items.OfType <Customer>()); }
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { _customerDataProvider.SaveCustomersAsync( customerListView.Items.OfType <Customer>()).Wait(); }
private void MainWindow_Closing(object sender, CancelEventArgs e) { var customers = customerListView.Items.OfType <Customer>(); _customerDataProvider.SaveCustomersAsync(customers).Wait(); }