public void Execute(object parameter) { viewModel.ImportSandboxConfingAction?.Invoke( async(file, exportErrorCallback) => { try { using (var s = await file.OpenStreamForReadAsync()) using (var sr = new StreamReader(s)) { var importModel = WSBConfigManagerModel.Import(sr); if (string.IsNullOrEmpty(importModel.Name)) { importModel.Name = Path.GetFileNameWithoutExtension(file.Name); } viewModel.model.WSBConfigCollection.Add(importModel); } } catch (Exception) { exportErrorCallback?.Invoke(); } } ); }