コード例 #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();
     }
 }
コード例 #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);
                });
            }
        }
コード例 #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);
                });
            }
        }
コード例 #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));
            };
        }