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; }