void _vm_RequestShowPackageManagerSearch(object s, EventArgs e) { if (_pkgSearchVM == null) { _pkgSearchVM = new PackageManagerSearchViewModel(dynSettings.PackageManagerClient); } if (_searchPkgsView == null) { _searchPkgsView = new PackageManagerSearchView(_pkgSearchVM); _searchPkgsView.Closed += (sender, args) => _searchPkgsView = null; _searchPkgsView.Show(); if (_searchPkgsView.IsLoaded && this.IsLoaded) _searchPkgsView.Owner = this; } _searchPkgsView.Focus(); _pkgSearchVM.RefreshAndSearchAsync(); }
void DynamoViewModelRequestShowPackageManagerSearch(object s, EventArgs e) { if (!DisplayTermsOfUseForAcceptance()) return; // Terms of use not accepted. if (_pkgSearchVM == null) { _pkgSearchVM = new PackageManagerSearchViewModel(dynamoViewModel.PackageManagerClientViewModel); } if (_searchPkgsView == null) { _searchPkgsView = new PackageManagerSearchView(_pkgSearchVM) { Owner = this, WindowStartupLocation = WindowStartupLocation.CenterOwner }; _searchPkgsView.Closed += (sender, args) => _searchPkgsView = null; _searchPkgsView.Show(); if (_searchPkgsView.IsLoaded && IsLoaded) _searchPkgsView.Owner = this; } _searchPkgsView.Focus(); _pkgSearchVM.RefreshAndSearchAsync(); }
private void ShowPackageManagerSearch() { var pms = new PackageManagerSearchViewModel(Controller.PackageManagerClient); var window = new PackageManagerSearchView(pms); window.Show(); }