- GitHub.VisualStudio.Views
- GitHub.VisualStudio.UI.Views
- GitHub.UI.Reactive.Controls
- GitHub.VisualStudio.UI.Controls
- GitHub.VisualStudio.UI.Views.Controls
GitHub.VisualStudio.UI.Views doesn't correspond to file location: warning
We have 2 different exports assemblies:
- GitHub.Exports
- GitHub.Exports.Reactive
IObservable<> is in the BCL: as long as we use this in the interfaces, can't
we have them all in 1 assembly?
- What is the difference between GetService and TryGetService in
IServiceProviderExtensions? Documentation says that TryGetService is a "Safe variant of GetService that doesn't throw exceptions if the service is not found." except AFAICS GetService just calls TryGetService, casts the result and doesn't throw anyway. - What is the difference between
TryGetServiceandGetExportedValueinIServiceProviderExtensions? They appear to be the same. - Is
IUIProvidermisnamed? For example here we use UIProvider to get anIConnection, butIConnectionhas nothing to do with UI as such. - I think understand what the GetService, TryGetService etc methods on
IServiceProviderExtensionsare trying to do: if the service provider is an IUIProvider, then call GetService on it, otherwise get an instance of IUIProvider from the service provider and call GetService on that. However I feel this is more confusing than helpful:- If you call
provider.GetService(type(T))then this mechanism will be bypassed, meaning that it will give different results toprovider.GetService<T>() - It masks the fast that there are different service providers for different types of resources. IMO it would be clearer to see:
- If you call
- Confusing that
Substitutes.ServiceProviderdoesn't return the same object each time, instead creates a new one. - What is
IExportFactoryProvider.UIControllerFactoryfor? Can't you just request aUIControllerfromUIProvideras it's markedNonShared.
ViewModels should not reference views. For example, GitHubPaneViewModel.Control.
ViewModels should reference other view models and it's the responsibility of the view layer to instantiate views for bound view models.
GitHubPaneViewModel is the worst offender; so much that it needs to be defined under Views rather than ViewModels! For example, the view should set up the toolbar buttons, the ViewModel should just define commands for them and then they should be bound together (even if its not possible to bind using XAML bindings)
Implements a weird kinda-but-not-really IObservable pattern. Use Observables.
There are 3 implementations of this
Why do our models (e.g. PullRequestModel) need interfaces? They have no logic.
- GitHubPaneViewModel is in GitHub.VisualStudio.UI.Views