public PackageRestoreBar(INuGetSolutionManagerService solutionManager, IPackageRestoreManager packageRestoreManager) { InitializeComponent(); _uiDispatcher = Dispatcher.CurrentDispatcher; _solutionManager = solutionManager; _packageRestoreManager = packageRestoreManager; if (_packageRestoreManager != null) { _packageRestoreManager.PackagesMissingStatusChanged += OnPackagesMissingStatusChanged; } // Set DynamicResource binding in code // The reason we can't set it in XAML is that the VsBrushes class comes from either // Microsoft.VisualStudio.Shell.10 or Microsoft.VisualStudio.Shell.11 assembly, // depending on whether NuGet runs inside VS10 or VS11. StatusMessage.SetResourceReference(TextBlock.ForegroundProperty, VsBrushes.InfoTextKey); RestoreBar.SetResourceReference(Border.BackgroundProperty, VsBrushes.InfoBackgroundKey); RestoreBar.SetResourceReference(Border.BorderBrushProperty, VsBrushes.ActiveBorderKey); // Find storyboards that will be used to smoothly show and hide the restore bar. _showRestoreBar = FindResource("ShowSmoothly") as Storyboard; _hideRestoreBar = FindResource("HideSmoothly") as Storyboard; }