55using System . Runtime . InteropServices ;
66using System . Windows ;
77using System . Windows . Controls ;
8- using GitHub . Helpers ;
98using GitHub . Extensions ;
109using GitHub . Factories ;
1110using GitHub . Services ;
@@ -38,17 +37,17 @@ public class GitHubPane : ToolWindowPane, IServiceProviderAware
3837 bool initialized = false ;
3938 IDisposable viewSubscription ;
4039 IGitHubPaneViewModel viewModel ;
41- ContentControl contentControl ;
40+ ContentPresenter contentPresenter ;
4241
4342 public FrameworkElement View
4443 {
45- get { return contentControl . Content as FrameworkElement ; }
44+ get { return contentPresenter . Content as FrameworkElement ; }
4645 set
4746 {
4847 viewSubscription ? . Dispose ( ) ;
4948 viewSubscription = null ;
5049
51- contentControl . Content = value ;
50+ contentPresenter . Content = value ;
5251
5352 viewSubscription = value . WhenAnyValue ( x => x . DataContext )
5453 . SelectMany ( x =>
@@ -66,7 +65,7 @@ public FrameworkElement View
6665 public GitHubPane ( ) : base ( null )
6766 {
6867 Caption = "GitHub" ;
69- Content = contentControl = new ContentControl ( ) ;
68+ Content = contentPresenter = new ContentPresenter ( ) ;
7069
7170 BitmapImageMoniker = new Microsoft . VisualStudio . Imaging . Interop . ImageMoniker ( )
7271 {
@@ -95,12 +94,10 @@ public void Initialize(IServiceProvider serviceProvider)
9594
9695 async Task InitializeAsync ( IServiceProvider serviceProvider )
9796 {
98- // Allow MEF to refresh its cache on a background thread so it isn't counted against us.
97+ // Allow MEF to initialize its cache asynchronously
9998 var asyncServiceProvider = ( IAsyncServiceProvider ) GetService ( typeof ( SAsyncServiceProvider ) ) ;
10099 await asyncServiceProvider . GetServiceAsync ( typeof ( SComponentModel ) ) ;
101100
102- await ThreadingHelper . SwitchToMainThreadAsync ( ) ;
103-
104101 var provider = VisualStudio . Services . GitHubServiceProvider ;
105102 var teServiceHolder = provider . GetService < ITeamExplorerServiceHolder > ( ) ;
106103 teServiceHolder . ServiceProvider = serviceProvider ;
0 commit comments