public async void ExecuteAddInstanceCommand(object parameter) { try { var dlg = new CreateDatabaseDialog(); dlg.WindowStartupLocation = WindowStartupLocation.CenterOwner; if (dlg.ShowDialog() == true) { var dbName = dlg.ViewModel.DbName; this.Busy = true; this.BusyContent = "Adding new instanse "; await Task.Factory.StartNew(() => { if (InstanceService.AddInstance(dbName)) { LoadInstances(); } }); } } finally { this.Busy = false; } }
protected void OnCreateDatabase() { CreateDatabaseDialog dlg = new CreateDatabaseDialog(); if (dlg.Run() == (int)ResponseType.Ok) { DatabaseConnectionContext context = dlg.DatabaseConnection; WaitDialog.ShowDialog("Creating database ..."); ThreadPool.QueueUserWorkItem(new WaitCallback(OnCreateDatabaseThreaded), context); } dlg.Destroy(); }