Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit c9b2fc1

Browse files
Using MEF correctly
1 parent d23554f commit c9b2fc1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/GitHub.VisualStudio.UI/Views/GitHubPane/PullRequestAnnotationsView.xaml.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,16 @@ public PullRequestAnnotationsView()
1818
InitializeComponent();
1919
}
2020

21-
IVisualStudioBrowser GetBrowser()
22-
{
23-
var serviceProvider = (IGitHubServiceProvider)Package.GetGlobalService(typeof(IGitHubServiceProvider));
24-
return serviceProvider.GetService<IVisualStudioBrowser>();
25-
}
21+
[Import]
22+
public IVisualStudioBrowser Browser { get; set; }
2623

2724
void OpenHyperlink(object sender, ExecutedRoutedEventArgs e)
2825
{
2926
Uri uri;
3027

3128
if (Uri.TryCreate(e.Parameter?.ToString(), UriKind.Absolute, out uri))
3229
{
33-
GetBrowser().OpenUrl(uri);
30+
Browser.OpenUrl(uri);
3431
}
3532
}
3633
}

0 commit comments

Comments
 (0)