private async void menuitemImages_Click(object sender, RoutedEventArgs e) { var model = gridDeployments.SelectedItem as DeploymentModel; var deployment = model.Context; CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); var images = new List <AzureSphereImage>(); Cursor = Cursors.Wait; try { foreach (var imageId in deployment.DeployedImages) { images.Add(await _ParentWindow.Api.GetImageAsync(_ParentWindow.Tenant, imageId, cancellationTokenSource.Token)); } } finally { Cursor = null; } var dialog = new ImagesWindow(); dialog.Owner = this; dialog.Images = images; var dialogResult = dialog.ShowDialog(); dialog = null; }
private async void menuitemImages_Click(object sender, RoutedEventArgs e) { var model = gridDeployments.SelectedItem as DeploymentModel; var imageModels = new List <ImageModel>(); Cursor = Cursors.Wait; try { ModelManager modelManager = ModelManager.GetInstance(); imageModels = await modelManager.GetImageModels(this.CurrentTenantModel, model); } finally { Cursor = null; } var dialog = new ImagesWindow(); dialog.Owner = this; dialog.imageModels = imageModels; var dialogResult = dialog.ShowDialog(); dialog = null; }