Exemplo n.º 1
0
 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();
     }
 }
Exemplo n.º 2
0
        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);
                });
            }
        }
Exemplo n.º 3
0
        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);
                });
            }
        }
Exemplo n.º 4
0
        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));
            };
        }