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

Commit bc32eb4

Browse files
authored
Merge branch 'master' into update-doc-links
2 parents 3b0288f + 0ea3cc0 commit bc32eb4

File tree

6 files changed

+9
-19
lines changed

6 files changed

+9
-19
lines changed

src/GitHub.App/SampleData/ForkRepositorySelectViewModelDesigner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public ForkRepositorySelectViewModelDesigner()
3939

4040
public string Title => null;
4141

42-
public ReactiveCommand<IAccount, Unit> SelectedAccount => null;
42+
public ReactiveCommand<IAccount, IAccount> SelectedAccount => null;
4343

4444
public ReactiveCommand<RemoteRepositoryModel, Unit> SwitchOrigin => null;
4545

src/GitHub.App/ViewModels/Dialog/ForkRepositorySelectViewModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class ForkRepositorySelectViewModel : ViewModelBase, IForkRepositorySelec
3030
public ForkRepositorySelectViewModel(IModelServiceFactory modelServiceFactory)
3131
{
3232
this.modelServiceFactory = modelServiceFactory;
33-
SelectedAccount = ReactiveCommand.Create<IAccount>(_ => { });
33+
SelectedAccount = ReactiveCommand.Create<IAccount, IAccount>(account => account);
3434
SwitchOrigin = ReactiveCommand.Create<RemoteRepositoryModel>(_ => { });
3535
}
3636

@@ -54,11 +54,11 @@ public bool IsLoading
5454
private set { this.RaiseAndSetIfChanged(ref isLoading, value); }
5555
}
5656

57-
public ReactiveCommand<IAccount, Unit> SelectedAccount { get; }
57+
public ReactiveCommand<IAccount, IAccount> SelectedAccount { get; }
5858

5959
public ReactiveCommand<RemoteRepositoryModel, Unit> SwitchOrigin { get; }
6060

61-
public IObservable<object> Done => SelectedAccount.SelectNull();
61+
public IObservable<object> Done => SelectedAccount;
6262

6363
public async Task InitializeAsync(LocalRepositoryModel repository, IConnection connection)
6464
{

src/GitHub.Exports.Reactive/ViewModels/Dialog/IForkRepositorySelectViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public interface IForkRepositorySelectViewModel : IDialogContentViewModel
3030
/// <summary>
3131
/// Gets a command that is executed when the user selects an item in <see cref="Accounts"/>.
3232
/// </summary>
33-
ReactiveCommand<IAccount, Unit> SelectedAccount { get; }
33+
ReactiveCommand<IAccount, IAccount> SelectedAccount { get; }
3434

3535
/// <summary>
3636
/// Gets a command that is executed when the user selects an item in <see cref="ExistingForks"/>.

src/GitHub.VisualStudio.UI/Views/Dialog/ForkRepositoryExecuteView.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@
9595
Visibility="{Binding Error, Converter={ui:NullToVisibilityConverter}}"
9696
HorizontalAlignment="Left" />
9797
<StackPanel Margin="0 8" Orientation="Horizontal" HorizontalAlignment="Right">
98-
<Button HorizontalAlignment="Right" Padding="16 4" BorderThickness="0" Margin="0 0 4 0" Click="backButton_OnClick" Content="{x:Static ghfvs:Resources.Back}"/>
99-
<Button HorizontalAlignment="Right" Padding="16 4" BorderThickness="0" Click="repoForkButton_OnClick" Content="{x:Static ghfvs:Resources.ForkRepository}"/>
98+
<Button HorizontalAlignment="Right" Padding="16 4" BorderThickness="0" Margin="0 0 4 0" Command="{Binding BackCommand}" Content="{x:Static ghfvs:Resources.Back}"/>
99+
<Button HorizontalAlignment="Right" Padding="16 4" BorderThickness="0" Command="{Binding CreateFork}" Content="{x:Static ghfvs:Resources.ForkRepository}"/>
100100
</StackPanel>
101101
</StackPanel>
102102
</StackPanel>

src/GitHub.VisualStudio.UI/Views/Dialog/ForkRepositoryExecuteView.xaml.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,5 @@ public ForkRepositoryExecuteView()
1414
{
1515
InitializeComponent();
1616
}
17-
18-
private void repoForkButton_OnClick(object sender, RoutedEventArgs e)
19-
{
20-
((IForkRepositoryExecuteViewModel)DataContext).CreateFork.Execute();
21-
}
22-
23-
private void backButton_OnClick(object sender, RoutedEventArgs e)
24-
{
25-
((IForkRepositoryExecuteViewModel)DataContext).BackCommand.Execute();
26-
}
2717
}
2818
}

src/GitHub.VisualStudio.UI/Views/Dialog/ForkRepositorySelectView.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ private void accountsListBox_SelectionChanged(object sender, SelectionChangedEve
2424

2525
if (account != null)
2626
{
27-
((IForkRepositorySelectViewModel)DataContext).SelectedAccount.Execute(account);
27+
((IForkRepositorySelectViewModel)DataContext).SelectedAccount.Execute(account).Subscribe();
2828
}
2929
}
3030

@@ -33,7 +33,7 @@ private void existingForksListBox_SelectionChanged(object sender, SelectionChang
3333
var repository = e.AddedItems.OfType<RemoteRepositoryModel>().FirstOrDefault();
3434
if (repository != null)
3535
{
36-
((IForkRepositorySelectViewModel)DataContext).SwitchOrigin.Execute(repository);
36+
((IForkRepositorySelectViewModel)DataContext).SwitchOrigin.Execute(repository).Subscribe();
3737
}
3838
}
3939
}

0 commit comments

Comments
 (0)