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

Commit 71b8bcf

Browse files
committed
Wire up "not a github repo" view to VM
VM not actually doing anything yet though.
1 parent df55907 commit 71b8bcf

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed
Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
using System;
12
using System.ComponentModel.Composition;
23
using GitHub.Exports;
34
using GitHub.Services;
5+
using GitHub.UI;
46
using ReactiveUI;
57

68
namespace GitHub.ViewModels
@@ -12,21 +14,32 @@ namespace GitHub.ViewModels
1214
[PartCreationPolicy(CreationPolicy.NonShared)]
1315
public class NotAGitHubRepositoryViewModel : BaseViewModel, INotAGitHubRepositoryViewModel
1416
{
15-
IUIProvider uiProvider;
16-
1717
/// <summary>
1818
/// Initializes a new instance of the <see cref="NotAGitHubRepositoryViewModel"/> class.
1919
/// </summary>
2020
[ImportingConstructor]
21-
public NotAGitHubRepositoryViewModel(IUIProvider uiProvider)
21+
public NotAGitHubRepositoryViewModel()
2222
{
23-
this.uiProvider = uiProvider;
2423
Publish = ReactiveCommand.Create();
24+
Publish.Subscribe(_ => OnPublish());
2525
}
2626

2727
/// <summary>
2828
/// Gets the command executed when the user clicks the "Publish to GitHub" link.
2929
/// </summary>
3030
public IReactiveCommand<object> Publish { get; }
31+
32+
/// <summary>
33+
/// Gets or sets a value indicating whether the repository publish dialog will be opened
34+
/// with the private option checked.
35+
/// </summary>
36+
public bool PublishPrivate { get; set; }
37+
38+
/// <summary>
39+
/// Called when the <see cref="Publish"/> command is executed.
40+
/// </summary>
41+
private void OnPublish()
42+
{
43+
}
3144
}
3245
}

src/GitHub.VisualStudio/UI/Views/NotAGitHubRepositoryView.xaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,15 @@
4343
HorizontalAlignment="Center"
4444
Orientation="Vertical">
4545

46-
<CheckBox Foreground="{DynamicResource GitHubVsToolWindowText}" Margin="10">Publish as a private repository</CheckBox>
46+
<CheckBox Foreground="{DynamicResource GitHubVsToolWindowText}"
47+
IsChecked="{Binding PublishPrivate}"
48+
Margin="10">
49+
Publish as a private repository
50+
</CheckBox>
4751

48-
<Button HorizontalAlignment="Center" Style="{DynamicResource GitHubVsPrimaryActionButton}">
49-
Publish to GitHub
52+
<Button HorizontalAlignment="Center" Style="{DynamicResource GitHubVsPrimaryActionButton}"
53+
Command="{Binding Publish}">
54+
Publish to GitHub
5055
</Button>
5156

5257
</StackPanel>

0 commit comments

Comments
 (0)