public GitControlProxy([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider) { serviceProvider .GetService<ITeamExplorer>() .GetPropertyValue<object>("TeamExplorerManager") .GetPropertyValue<object>("ViewModel") .AddEventHandler("PropertyChanged", (PropertyChangedEventHandler)((s, e) => { OnTeamExplorerManagerViewModelChanged(s, e); })); Account = new Account(); }
void ITeamExplorerPage.Initialize(object sender, PageInitializeEventArgs e) { Title = "Work Items"; _serviceProvider = e.ServiceProvider; _gitProxy = _serviceProvider.GetService<GitControlProxy>(); _account = _gitProxy.Account; _explorer = new Explorer(); _explorer.DataContext = _account; _explorer.NewQueryLink.RequestNavigate += OnNewItemQueryClicked; _explorer.NewItemLink.RequestNavigate += OnNewWorkItemClicked; _explorer.CreateQueryLink.RequestNavigate += OnCreateQueryClicked; _explorer.AddQueryLink.RequestNavigate += OnAddQueryClicked; _explorer.QuerySelected += OnQuerySelected; PageContent = _explorer; }