10000 Show current PR on status bar and allow navigation to PR details MVP by jcansdale · Pull Request #1102 · github/VisualStudio · GitHub
[go: up one dir, main page]

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

Show current PR on status bar and allow navigation to PR details MVP #1102

Merged
merged 18 commits into from
Dec 18, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a simple ViewModel for PullRequestStatusView
  • Loading branch information
jcansdale committed Sep 12, 2017
commit e6f55fdf760143198bdbe034d033f568bd902514
1 change: 1 addition & 0 deletions src/GitHub.InlineReviews/GitHub.InlineReviews.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
<Compile Include="ViewModels\IPullRequestCommentsViewModel.cs" />
<Compile Include="ViewModels\IssueCommentThreadViewModel.cs" />
<Compile Include="ViewModels\PullRequestCommentsViewModel.cs" />
<Compile Include="ViewModels\PullRequestStatusViewModel.cs" />
<Compile Include="Views\DiffCommentThreadView.xaml.cs">
<DependentUpon>DiffCommentThreadView.xaml</DependentUpon>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Windows.Controls.Primitives;
using System.ComponentModel.Composition;
using GitHub.InlineReviews.Views;
using GitHub.InlineReviews.ViewModels;

namespace GitHub.InlineReviews.Services
{
Expand All @@ -30,7 +31,8 @@ public void ShowStatus()
var githubStatusBar = FindPullRequestStatusView(statusBar);
if (githubStatusBar == null)
{
var view = new PullRequestStatusView { Name = GitHubStatusName };
var viewModel = new PullRequestStatusViewModel { Number = 666, Title = "A beast of a PR" };
var view = new PullRequestStatusView { Name = GitHubStatusName, DataContext = viewModel };
statusBar.Items.Insert(0, view);
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/GitHub.InlineReviews/ViewModels/PullRequestStatusViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;

namespace GitHub.InlineReviews.ViewModels
{
class PullRequestStatusViewModel
{
public int Number { get; set; }
public string Title { get; set; }
}
}
7 changes: 5 additions & 2 deletions src/GitHub.InlineReviews/Views/PullRequestStatusView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:GitHub.InlineReviews.Views"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
d:DesignHeight="20" d:DesignWidth="60">
<UserControl.ToolTip>
<TextBlock Text="{Binding Title}" />
</UserControl.ToolTip>
<Grid>
<TextBlock>PR #777</TextBlock>
<TextBlock>PR# <Run Text="{Binding Number}" /></TextBlock>
</Grid>
</UserControl>
0