Skip to content
This repository was archived by the owner on Jul 2, 2022. It is now read-only.

Commit 5123384

Browse files
committed
About's Source Code now opens CodeHub in the application
1 parent 8fc38ff commit 5123384

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
using CodeFramework.Core.ViewModels;
2+
using System.Windows.Input;
3+
using Cirrious.MvvmCross.ViewModels;
4+
using CodeHub.Core.ViewModels.Repositories;
25

36
namespace CodeHub.Core.ViewModels.App
47
{
58
public class AboutViewModel : BaseViewModel
69
{
10+
public ICommand GoToSourceCodeCommand
11+
{
12+
get { return new MvxCommand(() => ShowViewModel<RepositoryViewModel>(new RepositoryViewModel.NavObject { Repository = "codehub", Username = "thedillonb" })); }
13+
}
714
}
815
}
916

CodeHub.iOS/CodeHub.iOS.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@
132132
<Compile Include="Views\Accounts\AddAccountView.designer.cs">
133133
<DependentUpon>AddAccountView.cs</DependentUpon>
134134
</Compile>
135-
<Compile Include="Views\App\AboutViewController.cs" />
136135
<Compile Include="Views\App\MenuView.cs" />
137136
<Compile Include="Views\App\SettingsView.cs" />
138137
<Compile Include="Views\Events\NewsView.cs" />
@@ -222,6 +221,7 @@
222221
</Compile>
223222
<InterfaceDefinition Include="Views\App\EnablePushNotificationsViewController.xib" />
224223
<Compile Include="Factories\FeatureFactory.cs" />
224+
<Compile Include="Views\App\AboutView.cs" />
225225
</ItemGroup>
226226
<ItemGroup>
227227
<ProjectReference Include="..\lib\CodeFramework\CodeFramework.Core\CodeFramework.Core.iOS.csproj">

CodeHub.iOS/Views/App/AboutViewController.cs renamed to CodeHub.iOS/Views/App/AboutView.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,27 @@
33
using MonoTouch.Foundation;
44
using MonoTouch.UIKit;
55
using CodeFramework.iOS.ViewControllers;
6+
using CodeHub.Core.ViewModels.App;
67

78
namespace CodeHub.iOS.Views.App
89
{
9-
public class AboutViewController : ViewModelDrivenDialogViewController
10+
public class AboutView : ViewModelDrivenDialogViewController
1011
{
1112
private const string About = @"CodeHub is the best way to browse and maintain your GitHub repositories on any iPhone, iPod Touch, and iPad device! " +
1213
"Keep an eye on your projects with the ability to view everything from pull requests to commenting on individual file diffs in the latest change set. " +
1314
"CodeHub brings GitHub to your finger tips in a sleek and efficient design." + "\n\nCreated By Dillon Buchanan";
1415

15-
public AboutViewController()
16+
public AboutView()
1617
: base (true)
1718
{
1819
Title = "About".t();
1920
}
2021

2122
public override void ViewDidLoad()
2223
{
23-
base.ViewDidLoad();
24+
base.ViewDidLoad();
25+
26+
var vm = (AboutViewModel)ViewModel;
2427

2528
var root = new RootElement(Title)
2629
{
@@ -30,7 +33,7 @@ public override void ViewDidLoad()
3033
},
3134
new Section
3235
{
33-
new StyledStringElement("Source Code".t(), () => UIApplication.SharedApplication.OpenUrl(new NSUrl("https://github.com/thedillonb/CodeHub")))
36+
new StyledStringElement("Source Code".t(), () => vm.GoToSourceCodeCommand.Execute(null))
3437
},
3538
new Section(String.Empty, "Thank you for downloading. Enjoy!")
3639
{

0 commit comments

Comments
 (0)