Thanks to visit codestin.com
Credit goes to github.com

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

Add navigation from GitHub tool window to repository #2480

Merged
merged 4 commits into from
Mar 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 10 additions & 0 deletions src/GitHub.App/ViewModels/GitHubPane/GitHubPaneViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ public GitHubPaneViewModel(
},
currentPage.Select(x => x is IOpenInBrowser));

BrowseRepository = ReactiveCommand.Create(
() =>
{
var url = LocalRepository.CloneUrl.ToRepositoryUrl();
if (url != null) browser.OpenUrl(url);
},
currentPage.Select(x => x is IOpenInBrowser));

help = ReactiveCommand.Create(() => { });
help.Subscribe(_ =>
{
Expand Down Expand Up @@ -531,5 +539,7 @@ static Regex CreateRoute(string route)
var routeFormat = "^" + new Regex("(:([a-z]+))\\b").Replace(route, @"(?<$2>[\w_.\-=]+)") + "$";
return new Regex(routeFormat, RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
}

public ReactiveCommand<Unit, Unit> BrowseRepository { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,8 @@
<Separator Margin="5,-2,5,0"
Foreground="{DynamicResource GitHubPaneTitleBrush}"
Style="{StaticResource TitleVerticalSeparator}" />
<TextBlock Margin="0,-5,0,0"
VerticalAlignment="Center"
Foreground="{DynamicResource GitHubVsGrayText}"
Text="{Binding LocalRepository.Name}" />
</StackPanel>
<ghfvs:GitHubActionLink Margin="0,-2.5,0,0" Command="{Binding BrowseRepository}" Content="{Binding LocalRepository.Name}" />
</StackPanel>

<Separator Margin="0,0,0,2"
DockPanel.Dock="Top"
Expand Down