コード例 #1
0
        public async void ExecuteDeleteInstanceCommand(object parameter)
        {
            if (MessageBox.Show("Are you sure that you want to delete the instance " + SelectedInstance + Environment.NewLine + "This will remove all data in th instance and can not be undone.", "Delete instance", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
            {
                this.Busy        = true;
                this.BusyContent = "Deleting instanse " + SelectedInstance;

                try
                {
                    await Task.Factory.StartNew(() =>
                    {
                        if (InstanceService.DeleteInstance(SelectedInstance))
                        {
                            LoadInstances();
                        }
                    });
                }
                finally
                {
                    this.Busy = false;
                }
            }
        }