private void PerformUIInitialisation() { notificationIcon = new NotificationIndicator(); notificationIcon.DataContext = notifications.Model; // The package is now loaded asynchronously, so a solution might have // finished loading before this package is initialized Refresh(activeSolutionBoundTracker.CurrentConfiguration); // Ordering: don't register for solution change notifications // until we've finished setting up everything else activeSolutionBoundTracker.SolutionBindingChanged += OnSolutionBindingChanged; }
private void OnSolutionBindingChanged(object sender, ActiveSolutionBindingEventArgs binding) { if (notificationIcon == null) { notificationIcon = new NotificationIndicator(); notificationIcon.DataContext = notifications.Model; VisualStudioStatusBarHelper.AddStatusBarIcon(notificationIcon); } if (binding.IsBound) { notifications.StartAsync(binding.ProjectKey, notificationData); } else { notifications.Stop(); } }