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

Commit 49f5618

Browse files
committed
Renamed ICanLoad -> ICanNavigate.
The term "load" is rather um, overloaded, so try using something else.
1 parent d6ebb74 commit 49f5618

File tree

7 files changed

+23
-16
lines changed

7 files changed

+23
-16
lines changed

src/GitHub.App/Controllers/NavigationController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ void CreateOrReuseView(IConnection connection, ViewWithData data, Action<IView>
130130
{
131131
disposablesForCurrentView?.Clear();
132132

133-
var action = view.ViewModel as ICanLoad;
133+
var action = view.ViewModel as ICanNavigate;
134134
if (action != null)
135135
{
136-
disposablesForCurrentView.Add(action?.Load.Subscribe(d =>
136+
disposablesForCurrentView.Add(action?.Navigate.Subscribe(d =>
137137
{
138138
LoadView(connection, d, onViewLoad);
139139
}));

src/GitHub.App/SampleData/PullRequestListViewModelDesigner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public PullRequestListViewModelDesigner()
6666

6767
public ObservableCollection<IAccount> Assignees { get; set; }
6868
public IAccount SelectedAssignee { get; set; }
69-
public IObservable<ViewWithData> Load { get; }
69+
public IObservable<ViewWithData> Navigate { get; }
7070

7171
public ReactiveCommand<object> OpenPullRequest { get; }
7272
public ReactiveCommand<object> CreatePullRequest { get; }

src/GitHub.App/ViewModels/PullRequestListViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public IAccount EmptyUser
227227
}
228228

229229
readonly Subject<ViewWithData> load = new Subject<ViewWithData>();
230-
public IObservable<ViewWithData> Load => load;
230+
public IObservable<ViewWithData> Navigate => load;
231231

232232
public ReactiveCommand<object> OpenPullRequest { get; }
233233
public ReactiveCommand<object> CreatePullRequest { get; }

src/GitHub.Exports.Reactive/ViewModels/IPullRequestListViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public override string ToString()
2727
}
2828
}
2929

30-
public interface IPullRequestListViewModel : IViewModel, ICanLoad
30+
public interface IPullRequestListViewModel : IViewModel, ICanNavigate
3131
{
3232
ITrackingCollection<IPullRequestModel> PullRequests { get; }
3333
IPullRequestModel SelectedPullRequest { get; }

src/GitHub.Exports/GitHub.Exports.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
<Compile Include="ViewModels\IHasBusy.cs" />
217217
<Compile Include="ViewModels\IInfoPanel.cs" />
218218
<Compile Include="ViewModels\IServiceProviderAware.cs" />
219-
<Compile Include="ViewModels\ICanLoad.cs" />
219+
<Compile Include="ViewModels\ICanNavigate.cs" />
220220
<Compile Include="UI\Octicon.cs" />
221221
<Compile Include="ViewModels\IGitHubConnectSection.cs" />
222222
<Compile Include="ViewModels\IGitHubInvitationSection.cs" />

src/GitHub.Exports/ViewModels/ICanLoad.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using GitHub.UI;
3+
4+
namespace GitHub.ViewModels
5+
{
6+
/// <summary>
7+
/// Interface for view models in a navigable panel such as the GitHub pane which can signal
8+
/// to navigate to another page.
9+
/// </summary>
10+
public interface ICanNavigate
11+
{
12+
/// <summary>
13+
/// Gets an observable which is signalled with the page to navigate to.
14+
/// </summary>
15+
IObservable<ViewWithData> Navigate { get; }
16+
}
17+
}

0 commit comments

Comments
 (0)