예제 #1
0
        private async void App_Suspending(object sender, SuspendingEventArgs e)
        {
            var deferral = e.SuspendingOperation.GetDeferral();
            await _customerDataProvider.SaveCustomersAsync(customerListView.Items.OfType <Customer>());

            deferral.Complete();
        }
예제 #2
0
        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();
        }
예제 #3
0
 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();
 }
예제 #5
0
        private void MainWindow_Closing(object sender, CancelEventArgs e)
        {
            var customers = customerListView.Items.OfType <Customer>();

            _customerDataProvider.SaveCustomersAsync(customers).Wait();
        }