private void OnAvailabilityChanged(object sender, BrokeredServicesChangedEventArgs e)
 {
     NuGetUIThreadHelper.JoinableTaskFactory.RunAsync(async() =>
     {
         _searchService?.Dispose();
         _searchService = await GetSearchServiceAsync(CancellationToken.None);
     }).PostOnFailure(nameof(PackageItemLoader), nameof(OnAvailabilityChanged));
 }
        private void OnAvailabilityChanged(object sender, BrokeredServicesChangedEventArgs e)
        {
            NuGetUIThreadHelper.JoinableTaskFactory.RunAsync(async() =>
            {
                INuGetSolutionManagerService newService = await GetSolutionManagerServiceAsync(
                    ServiceBroker,
                    CancellationToken.None);

                using (_solutionManagerService.Swap(newService))
                {
                }
            })
            .PostOnFailure(nameof(NuGetUIContext), nameof(OnAvailabilityChanged));
        }
 private void AvailabilityChanged(object sender, BrokeredServicesChangedEventArgs e)
 {
     _jtf.RunAsync(AvailabilityChangedAsync)
     .PostOnFailure(typeof(NuGetSearchServiceReconnector).FullName, nameof(AvailabilityChangedAsync));
 }