private void FindAllReferencesOnClick(object sender, RoutedEventArgs e) { if (sender is MenuItem m && m.DataContext is PackageVersionViewModel v) { var dlg = new PackageReferences { Package = v.Package, PackageVersion = v }; dlg.ShowDialog(); } }
private void PackageSearch_OnDropDownClosed(object sender, RoutedPropertyChangedEventArgs <bool> e) { var autoCompleteBox = ((AutoCompleteBox)sender); var key = autoCompleteBox.Text; if (ViewModel.PackageReferenceDictionary.TryGetValue(key, out var packageReference)) { Dispatcher.Invoke(() => { ViewModel.SelectedPackageReference = packageReference; autoCompleteBox.Text = string.Empty; PackageReferences.ScrollIntoView(packageReference); }); } }
private void AssemblySearch_OnDropDownClosed(object sender, RoutedPropertyChangedEventArgs <bool> e) { var autoCompleteBox = ((AutoCompleteBox)sender); var key = autoCompleteBox.Text; var binding = ViewModel.BindingRedirections.SingleOrDefault(b => b.AssemblyName == key); if (binding != null) { Dispatcher.Invoke(() => { ViewModel.SelectedBindingRedirection = binding; autoCompleteBox.Text = string.Empty; PackageReferences.ScrollIntoView(binding); }); } }
public ProjectDetailControl() { DataContextChanged += (sender, args) => { PropertyGrid.SelectedObject = ViewModel; }; Messenger.Default.Register <PackageReference>(this, reference => { PackageReferences.SelectedItem = reference; PackageReferences.ScrollIntoView(reference); }); InitializeComponent(); Loaded += (sender, args) => { Projects.RegisterSort(nameof(IProject.Name)); PackageReferences.RegisterSort(nameof(PackageReference.Package), nameof(IPackage.Name)); BindingRedirects.RegisterSort(nameof(BindingRedirection.AssemblyName)); Dependencies.RegisterSort(nameof(IProject.Name)); }; }