├── .gitattributes
├── .gitignore
├── CreatePackages.ps1
├── MvvmLight.XamarinForms.nuspec
├── MvvmLight.XamarinForms
├── DialogService.cs
├── MvvmLight.XamarinForms.csproj
└── NavigationService.cs
├── MvvmLightNavigation.sln
├── MvvmLightNavigation
└── MvvmLightNavigation
│ ├── INavigationExtension.cs
│ ├── MvvmLightNavigationExtension.csproj
│ ├── NavigationServiceExtension.cs
│ ├── Properties
│ └── AssemblyInfo.cs
│ └── packages.config
├── MvvmLightNavigationExtension.Droid
├── MvvmLightNavigationExtension.Droid.csproj
├── NavigationServiceExtension.cs
├── Properties
│ └── AssemblyInfo.cs
├── Resources
│ ├── AboutResources.txt
│ ├── Resource.Designer.cs
│ └── Values
│ │ └── Strings.xml
├── app.config
└── packages.config
├── MvvmLightNavigationExtension.Forms
├── DialogService.cs
├── MvvmLight.Extension.Forms.csproj
├── NavigationService.cs
├── Properties
│ └── AssemblyInfo.cs
└── packages.config
├── MvvmLightNavigationExtension.NetStd
├── INavigationExtension.cs
├── MvvmLightNavigationExtension.NetStd.csproj
└── NavigationServiceExtension.cs
├── MvvmLightNavigationExtension.Sample.Droid
├── Assets
│ └── AboutAssets.txt
├── MainActivity.cs
├── Page3Activity.cs
├── PageActivity.cs
├── Properties
│ ├── AndroidManifest.xml
│ └── AssemblyInfo.cs
├── Resources
│ ├── AboutResources.txt
│ ├── Resource.Designer.cs
│ ├── drawable
│ │ └── Icon.png
│ ├── layout
│ │ ├── Main.axml
│ │ └── Page.axml
│ └── values
│ │ └── Strings.xml
├── Sample.Droid.csproj
├── app.config
└── packages.config
├── MvvmLightNavigationExtension.Sample.iOS
├── AppDelegate.cs
├── Entitlements.plist
├── GettingStarted.Xamarin
├── Info.plist
├── Main.cs
├── Main.storyboard
├── Page3Controller.cs
├── Page3Controller.designer.cs
├── PageController.cs
├── PageController.designer.cs
├── Properties
│ └── AssemblyInfo.cs
├── Resources
│ └── LaunchScreen.xib
├── Sample.iOS.csproj
├── ViewController.cs
├── ViewController.designer.cs
├── app.config
└── packages.config
├── MvvmLightNavigationExtension.Sample
├── Properties
│ └── AssemblyInfo.cs
├── Sample.csproj
├── ViewModels
│ ├── MainViewModel.cs
│ └── PageViewModel.cs
└── packages.config
├── MvvmLightNavigationExtension.iOS
├── MvvmLightNavigationExtension.iOS.csproj
├── NavigationServiceExtension.cs
├── Properties
│ └── AssemblyInfo.cs
└── packages.config
├── MvvmLightNavigationExtension.nuspec
├── MvvmLightNavigationForms.nuspec
├── Nuget.config
├── README.md
└── XamarinFormsSample
├── XamarinFormsSample.Android
├── Assets
│ └── AboutAssets.txt
├── MainActivity.cs
├── Properties
│ ├── AndroidManifest.xml
│ └── AssemblyInfo.cs
├── Resources
│ ├── AboutResources.txt
│ ├── Resource.Designer.cs
│ ├── drawable-hdpi
│ │ └── icon.png
│ ├── drawable-xhdpi
│ │ └── icon.png
│ ├── drawable-xxhdpi
│ │ └── icon.png
│ ├── drawable
│ │ └── icon.png
│ ├── layout
│ │ ├── Tabbar.axml
│ │ └── Toolbar.axml
│ └── values
│ │ └── styles.xml
├── XamarinFormsSample.Android.csproj
└── packages.config
├── XamarinFormsSample.UWP
├── App.xaml
├── App.xaml.cs
├── Assets
│ ├── LockScreenLogo.scale-100.png
│ ├── LockScreenLogo.scale-125.png
│ ├── LockScreenLogo.scale-150.png
│ ├── LockScreenLogo.scale-200.png
│ ├── LockScreenLogo.scale-400.png
│ ├── SplashScreen.scale-100.png
│ ├── SplashScreen.scale-125.png
│ ├── SplashScreen.scale-150.png
│ ├── SplashScreen.scale-200.png
│ ├── SplashScreen.scale-400.png
│ ├── Square150x150Logo.scale-200.png
│ ├── Square44x44Logo.scale-100.png
│ ├── Square44x44Logo.scale-125.png
│ ├── Square44x44Logo.scale-150.png
│ ├── Square44x44Logo.scale-200.png
│ ├── Square44x44Logo.scale-400.png
│ ├── Square44x44Logo.targetsize-16_altform-unplated.png
│ ├── Square44x44Logo.targetsize-24_altform-unplated.png
│ ├── Square44x44Logo.targetsize-256_altform-unplated.png
│ ├── Square44x44Logo.targetsize-32_altform-unplated.png
│ ├── Square44x44Logo.targetsize-48_altform-unplated.png
│ ├── StoreLogo.png
│ ├── Wide310x150Logo.scale-100.png
│ ├── Wide310x150Logo.scale-125.png
│ ├── Wide310x150Logo.scale-150.png
│ ├── Wide310x150Logo.scale-200.png
│ └── Wide310x150Logo.scale-400.png
├── MainPage.xaml
├── MainPage.xaml.cs
├── Package.appxmanifest
├── Properties
│ ├── AssemblyInfo.cs
│ └── Default.rd.xml
├── XamarinFormsSample.UWP.csproj
├── XamarinFormsSample.UWP.nuget.targets
└── project.json
├── XamarinFormsSample.iOS
├── AppDelegate.cs
├── Entitlements.plist
├── Info.plist
├── Main.cs
├── Properties
│ └── AssemblyInfo.cs
├── Resources
│ ├── Default-568h@2x.png
│ ├── Default-Portrait.png
│ ├── Default-Portrait@2x.png
│ ├── Default.png
│ ├── Default@2x.png
│ ├── Icon-60@2x.png
│ ├── Icon-60@3x.png
│ ├── Icon-76.png
│ ├── Icon-76@2x.png
│ ├── Icon-Small-40.png
│ ├── Icon-Small-40@2x.png
│ ├── Icon-Small-40@3x.png
│ ├── Icon-Small.png
│ ├── Icon-Small@2x.png
│ ├── Icon-Small@3x.png
│ └── LaunchScreen.storyboard
├── XamarinFormsSample.iOS.csproj
├── iTunesArtwork
├── iTunesArtwork@2x
└── packages.config
└── XamarinFormsSample
├── App.xaml
├── App.xaml.cs
├── ViewModels
├── AboutViewModel.cs
└── MainViewModel.cs
├── Views
├── AboutView.xaml
├── AboutView.xaml.cs
├── MainView.xaml
├── MainView.xaml.cs
├── ModalView.xaml
└── ModalView.xaml.cs
├── XamarinFormsSample.projitems
└── XamarinFormsSample.shproj
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | build/
21 | bld/
22 | [Bb]in/
23 | [Oo]bj/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 |
28 | # MSTest test Results
29 | [Tt]est[Rr]esult*/
30 | [Bb]uild[Ll]og.*
31 |
32 | # NUNIT
33 | *.VisualState.xml
34 | TestResult.xml
35 |
36 | # Build Results of an ATL Project
37 | [Dd]ebugPS/
38 | [Rr]eleasePS/
39 | dlldata.c
40 |
41 | # DNX
42 | project.lock.json
43 | artifacts/
44 |
45 | *_i.c
46 | *_p.c
47 | *_i.h
48 | *.ilk
49 | *.meta
50 | *.obj
51 | *.pch
52 | *.pdb
53 | *.pgc
54 | *.pgd
55 | *.rsp
56 | *.sbr
57 | *.tlb
58 | *.tli
59 | *.tlh
60 | *.tmp
61 | *.tmp_proj
62 | *.log
63 | *.vspscc
64 | *.vssscc
65 | .builds
66 | *.pidb
67 | *.svclog
68 | *.scc
69 |
70 | # Chutzpah Test files
71 | _Chutzpah*
72 |
73 | # Visual C++ cache files
74 | ipch/
75 | *.aps
76 | *.ncb
77 | *.opensdf
78 | *.sdf
79 | *.cachefile
80 |
81 | # Visual Studio profiler
82 | *.psess
83 | *.vsp
84 | *.vspx
85 |
86 | # TFS 2012 Local Workspace
87 | $tf/
88 |
89 | # Guidance Automation Toolkit
90 | *.gpState
91 |
92 | # ReSharper is a .NET coding add-in
93 | _ReSharper*/
94 | *.[Rr]e[Ss]harper
95 | *.DotSettings.user
96 |
97 | # JustCode is a .NET coding add-in
98 | .JustCode
99 |
100 | # TeamCity is a build add-in
101 | _TeamCity*
102 |
103 | # DotCover is a Code Coverage Tool
104 | *.dotCover
105 |
106 | # NCrunch
107 | _NCrunch_*
108 | .*crunch*.local.xml
109 |
110 | # MightyMoose
111 | *.mm.*
112 | AutoTest.Net/
113 |
114 | # Web workbench (sass)
115 | .sass-cache/
116 |
117 | # Installshield output folder
118 | [Ee]xpress/
119 |
120 | # DocProject is a documentation generator add-in
121 | DocProject/buildhelp/
122 | DocProject/Help/*.HxT
123 | DocProject/Help/*.HxC
124 | DocProject/Help/*.hhc
125 | DocProject/Help/*.hhk
126 | DocProject/Help/*.hhp
127 | DocProject/Help/Html2
128 | DocProject/Help/html
129 |
130 | # Click-Once directory
131 | publish/
132 |
133 | # Publish Web Output
134 | *.[Pp]ublish.xml
135 | *.azurePubxml
136 | ## TODO: Comment the next line if you want to checkin your
137 | ## web deploy settings but do note that will include unencrypted
138 | ## passwords
139 | #*.pubxml
140 |
141 | *.publishproj
142 |
143 | # NuGet Packages
144 | *.nupkg
145 | # The packages folder can be ignored because of Package Restore
146 | **/packages/*
147 | # except build/, which is used as an MSBuild target.
148 | !**/packages/build/
149 | # Uncomment if necessary however generally it will be regenerated when needed
150 | #!**/packages/repositories.config
151 |
152 | # Windows Azure Build Output
153 | csx/
154 | *.build.csdef
155 |
156 | # Windows Store app package directory
157 | AppPackages/
158 |
159 | # Visual Studio cache files
160 | # files ending in .cache can be ignored
161 | *.[Cc]ache
162 | # but keep track of directories ending in .cache
163 | !*.[Cc]ache/
164 |
165 | # Others
166 | ClientBin/
167 | [Ss]tyle[Cc]op.*
168 | ~$*
169 | *~
170 | *.dbmdl
171 | *.dbproj.schemaview
172 | *.pfx
173 | *.publishsettings
174 | node_modules/
175 | orleans.codegen.cs
176 |
177 | # RIA/Silverlight projects
178 | Generated_Code/
179 |
180 | # Backup & report files from converting an old project file
181 | # to a newer Visual Studio version. Backup files are not needed,
182 | # because we have git ;-)
183 | _UpgradeReport_Files/
184 | Backup*/
185 | UpgradeLog*.XML
186 | UpgradeLog*.htm
187 |
188 | # SQL Server files
189 | *.mdf
190 | *.ldf
191 |
192 | # Business Intelligence projects
193 | *.rdl.data
194 | *.bim.layout
195 | *.bim_*.settings
196 |
197 | # Microsoft Fakes
198 | FakesAssemblies/
199 |
200 | # Node.js Tools for Visual Studio
201 | .ntvs_analysis.dat
202 |
203 | # Visual Studio 6 build log
204 | *.plg
205 |
206 | # Visual Studio 6 workspace options file
207 | *.opt
208 |
209 | # LightSwitch generated files
210 | GeneratedArtifacts/
211 | _Pvt_Extensions/
212 | ModelManifest.xml
213 | *.bak
214 |
--------------------------------------------------------------------------------
/CreatePackages.ps1:
--------------------------------------------------------------------------------
1 | c:\nuget.exe pack MvvmLightNavigationForms.nuspec -OutputDirectory Export
2 | c:\nuget.exe pack MvvmLightNavigationExtension.nuspec -OutputDirectory Export
--------------------------------------------------------------------------------
/MvvmLight.XamarinForms.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MvvmLight.XamarinForms
5 | 1.0.1
6 | MvvmLight for Xamarin.Forms
7 | Daniel Hindrikes
8 | http://opensource.org/licenses/MIT
9 | https://github.com/dhindrik/MvvmLightNavigationExtension
10 | false
11 | INavigationService and IDialogService implemention for Xamarin.Forms
12 | MIT license
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/MvvmLight.XamarinForms/DialogService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using GalaSoft.MvvmLight.Views;
7 |
8 | namespace MvvmLight.XamarinForms
9 | {
10 | public class DialogService : IDialogService
11 | {
12 | public async Task ShowError(Exception error, string title, string buttonText, Action afterHideCallback)
13 | {
14 | await NavigationService.Page.DisplayAlert(title, error.Message, buttonText);
15 |
16 | if (afterHideCallback != null)
17 | {
18 | afterHideCallback();
19 | }
20 | }
21 |
22 | public async Task ShowError(string message, string title, string buttonText, Action afterHideCallback)
23 | {
24 | await NavigationService.Page.DisplayAlert(title, message, buttonText);
25 |
26 | if (afterHideCallback != null)
27 | {
28 | afterHideCallback();
29 | }
30 | }
31 |
32 | public async Task ShowMessage(string message, string title)
33 | {
34 | await NavigationService.Page.DisplayAlert(title, message, "OK");
35 | }
36 |
37 | public async Task ShowMessage(string message, string title, string buttonText, Action afterHideCallback)
38 | {
39 | await NavigationService.Page.DisplayAlert(title, message, buttonText);
40 |
41 | if (afterHideCallback != null)
42 | {
43 | afterHideCallback();
44 | }
45 | }
46 |
47 | public async Task ShowMessage(string message, string title, string buttonConfirmText, string buttonCancelText, Action afterHideCallback)
48 | {
49 | var result = await NavigationService.Page.DisplayAlert(title, message, buttonConfirmText, buttonCancelText);
50 |
51 | if (afterHideCallback != null)
52 | {
53 | afterHideCallback(result);
54 | }
55 |
56 | return result;
57 | }
58 |
59 | public async Task ShowMessageBox(string message, string title)
60 | {
61 | await NavigationService.Page.DisplayAlert(title, message, "OK");
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/MvvmLight.XamarinForms/MvvmLight.XamarinForms.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard1.0
5 |
6 | portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20
7 |
8 | 2.0.1-pre1
9 | Daniel Hindrikes
10 |
11 | MvvmLight for Xamarin.Forms
12 | INavigationService and IDialogService implemention for Xamarin.Forms
13 | https://opensource.org/licenses/MIT
14 | Daniel Hindrikes
15 | https://github.com/dhindrik/MvvmLightNavigationExtension
16 | https://github.com/dhindrik/MvvmLightNavigationExtension
17 | GIT
18 | Xamarin
19 | Converted to .NET standard
20 | true
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/MvvmLight.XamarinForms/NavigationService.cs:
--------------------------------------------------------------------------------
1 | using GalaSoft.MvvmLight.Views;
2 | using MvvmLightNavigationExtension;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using TinyNavigationHelper.Forms;
9 | using Xamarin.Forms;
10 |
11 | namespace MvvmLight.XamarinForms
12 | {
13 | public class NavigationService : INavigationService, INavigationServiceExtension
14 | {
15 | internal static Page Page { get { return _app.MainPage; } }
16 |
17 | private static Application _app;
18 |
19 | private FormsNavigationHelper _navigation;
20 |
21 | private Stack _navigationStack = new Stack();
22 | public void Initialize(Application app)
23 | {
24 | _app = app;
25 | _navigation = new FormsNavigationHelper(app);
26 |
27 | NavigationServiceExtension.Current = this;
28 |
29 |
30 | }
31 |
32 | public void Configure(string key, Type type)
33 | {
34 | _navigation.RegisterView(key, type);
35 | }
36 |
37 | public string CurrentPageKey
38 | {
39 | get { return _navigationStack.Peek(); }
40 | }
41 |
42 | public void CloseModal()
43 | {
44 | _navigation.CloseModalAsync();
45 | }
46 |
47 | public void GoBack()
48 | {
49 | _navigationStack.Pop();
50 | _navigation.BackAsync();
51 | }
52 |
53 | public void NavigateTo(string pageKey)
54 | {
55 | NavigateTo(pageKey, null);
56 | }
57 |
58 | public void NavigateTo(string pageKey, object parameter)
59 | {
60 | _navigation.NavigateToAsync(pageKey, parameter);
61 |
62 | _navigationStack.Push(pageKey);
63 | }
64 |
65 | public void OpenModal(string key)
66 | {
67 | OpenModal(key, null);
68 | }
69 |
70 | public void OpenModal(string key, object parameter)
71 | {
72 | _navigation.OpenModalAsync(key, parameter);
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/MvvmLightNavigation/MvvmLightNavigation/INavigationExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace MvvmLightNavigationExtension
8 | {
9 | public interface INavigationServiceExtension
10 | {
11 | void OpenModal(string key);
12 | void OpenModal(string key, object parameter);
13 | void CloseModal();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/MvvmLightNavigation/MvvmLightNavigation/MvvmLightNavigationExtension.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
7 | {E479F480-0834-482D-AC0B-17DE833B925F}
8 | Library
9 | MvvmLightNavigationExtension
10 | MvvmLightNavigationExtension
11 | v4.5
12 | Profile259
13 | 10.0
14 |
15 |
16 | true
17 | full
18 | false
19 | bin\Debug
20 | DEBUG;
21 | prompt
22 | 4
23 | false
24 |
25 |
26 | full
27 | true
28 | bin\Release
29 | prompt
30 | 4
31 | false
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | ..\..\packages\MvvmLightLibs.5.2.0.0\lib\portable-net45+wp8+wpa81+netcore45+monoandroid1+xamarin.ios10\GalaSoft.MvvmLight.dll
41 | True
42 |
43 |
44 | ..\..\packages\MvvmLightLibs.5.2.0.0\lib\portable-net45+wp8+wpa81+netcore45+monoandroid1+xamarin.ios10\GalaSoft.MvvmLight.Extras.dll
45 | True
46 |
47 |
48 | ..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll
49 | True
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/MvvmLightNavigation/MvvmLightNavigation/NavigationServiceExtension.cs:
--------------------------------------------------------------------------------
1 | using GalaSoft.MvvmLight.Views;
2 | using Microsoft.Practices.ServiceLocation;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace MvvmLightNavigationExtension
10 | {
11 | public static class NavigationServiceExtension
12 | {
13 | public static INavigationServiceExtension Current { get; set; }
14 |
15 | public static void OpenModal(this INavigationService navigationService, string key)
16 | {
17 | Current.OpenModal(key);
18 | }
19 |
20 | public static void OpenModal(this INavigationService navigationService, string key, object parameter)
21 | {
22 | Current.OpenModal(key, parameter);
23 | }
24 |
25 | public static void CloseModal(this INavigationService navigationService)
26 | {
27 | Current.CloseModal();
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/MvvmLightNavigation/MvvmLightNavigation/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 |
4 | // Information about this assembly is defined by the following attributes.
5 | // Change them to the values specific to your project.
6 |
7 | [assembly: AssemblyTitle("MvvmLightNavigation")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("")]
12 | [assembly: AssemblyCopyright("joe")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
19 |
20 | [assembly: AssemblyVersion("1.0.*")]
21 |
22 | // The following attributes are used to specify the signing key for the assembly,
23 | // if desired. See the Mono documentation for more information about signing.
24 |
25 | //[assembly: AssemblyDelaySign(false)]
26 | //[assembly: AssemblyKeyFile("")]
27 |
28 |
--------------------------------------------------------------------------------
/MvvmLightNavigation/MvvmLightNavigation/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.Droid/MvvmLightNavigationExtension.Droid.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {16235605-8216-4FF1-95CE-DD375EE028A4}
9 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
10 | Library
11 | Properties
12 | MvvmLightNavigationExtension.Droid
13 | MvvmLightNavigationExtension.Droid
14 | 512
15 | Resources\Resource.Designer.cs
16 | Off
17 | True
18 | v7.1
19 |
20 |
21 | true
22 | full
23 | false
24 | bin\Debug\
25 | DEBUG;TRACE
26 | prompt
27 | 4
28 |
29 |
30 | pdbonly
31 | true
32 | bin\Release\
33 | TRACE
34 | prompt
35 | 4
36 |
37 |
38 |
39 | ..\packages\MvvmLightLibsStd10.5.4.0.1-alpha\lib\monoandroid1\GalaSoft.MvvmLight.dll
40 |
41 |
42 | ..\packages\MvvmLightLibsStd10.5.4.0.1-alpha\lib\monoandroid1\GalaSoft.MvvmLight.Platform.dll
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | {e479f480-0834-482d-ac0b-17de833b925f}
67 | MvvmLightNavigationExtension
68 |
69 |
70 |
71 |
78 |
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.Droid/NavigationServiceExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | using Android.App;
7 | using Android.Content;
8 | using Android.OS;
9 | using Android.Runtime;
10 | using Android.Views;
11 | using Android.Widget;
12 | using GalaSoft.MvvmLight.Views;
13 | using System.Reflection;
14 |
15 | namespace MvvmLightNavigationExtension.Droid
16 | {
17 | public class NavigationServiceExtension : NavigationService, INavigationServiceExtension
18 | {
19 | private Dictionary _pageKeys = new Dictionary();
20 |
21 | private const string ParameterKeyName = "ParameterKey";
22 |
23 | public void Initialize()
24 | {
25 | MvvmLightNavigationExtension.NavigationServiceExtension.Current = this;
26 | }
27 |
28 | public void CloseModal()
29 | {
30 | ActivityBase.CurrentActivity.Finish ();
31 | }
32 |
33 | public void OpenModal(string key)
34 | {
35 | var activityType = _pageKeys[key];
36 |
37 | var intent = new Intent(Application.Context, activityType);
38 | intent.SetFlags(ActivityFlags.NoHistory);
39 | intent.SetFlags (ActivityFlags.NewTask);
40 |
41 | Application.Context.StartActivity(intent);
42 | }
43 |
44 | public void OpenModal(string key, object parameter)
45 | {
46 | var activityType = _pageKeys[key];
47 |
48 | var intent = new Intent(Application.Context, activityType);
49 | intent.SetFlags(ActivityFlags.NoHistory);
50 | intent.SetFlags(ActivityFlags.NewTask);
51 |
52 | var field = this.GetType().BaseType.GetField("_parametersByKey", BindingFlags.Instance | BindingFlags.NonPublic);
53 |
54 | var parameters = field.GetValue(this) as Dictionary;
55 |
56 | var guid = Guid.NewGuid().ToString();
57 | parameters.Add(guid, parameter);
58 | intent.PutExtra(ParameterKeyName, guid);
59 |
60 | Application.Context.StartActivity(intent);
61 | }
62 |
63 | public new void Configure(string key, Type activityType)
64 | {
65 | base.Configure(key, activityType);
66 |
67 | _pageKeys.Add(key, activityType);
68 | }
69 | }
70 | }
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.Droid/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("MvvmLightNavigationExtension.Droid")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("MvvmLightNavigationExtension.Droid")]
14 | [assembly: AssemblyCopyright("Copyright © 2015")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Build and Revision Numbers
27 | // by using the '*' as shown below:
28 | // [assembly: AssemblyVersion("1.0.*")]
29 | [assembly: AssemblyVersion("1.0.0.0")]
30 | [assembly: AssemblyFileVersion("1.0.0.0")]
31 |
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.Droid/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.axml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable/
12 | icon.png
13 |
14 | layout/
15 | main.axml
16 |
17 | values/
18 | strings.xml
19 |
20 | In order to get the build system to recognize Android resources, set the build action to
21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
22 | instead operate on resource IDs. When you compile an Android application that uses resources,
23 | the build system will package the resources for distribution and generate a class called "R"
24 | (this is an Android convention) that contains the tokens for each one of the resources
25 | included. For example, for the above Resources layout, this is what the R class would expose:
26 |
27 | public class R {
28 | public class drawable {
29 | public const int icon = 0x123;
30 | }
31 |
32 | public class layout {
33 | public const int main = 0x456;
34 | }
35 |
36 | public class strings {
37 | public const int first_string = 0xabc;
38 | public const int second_string = 0xbcd;
39 | }
40 | }
41 |
42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first
44 | string in the dictionary file values/strings.xml.
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.Droid/Resources/Resource.Designer.cs:
--------------------------------------------------------------------------------
1 | #pragma warning disable 1591
2 | //------------------------------------------------------------------------------
3 | //
4 | // This code was generated by a tool.
5 | // Runtime Version:4.0.30319.42000
6 | //
7 | // Changes to this file may cause incorrect behavior and will be lost if
8 | // the code is regenerated.
9 | //
10 | //------------------------------------------------------------------------------
11 |
12 | [assembly: global::Android.Runtime.ResourceDesignerAttribute("MvvmLightNavigationExtension.Droid.Resource", IsApplication=false)]
13 |
14 | namespace MvvmLightNavigationExtension.Droid
15 | {
16 |
17 |
18 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
19 | public partial class Resource
20 | {
21 |
22 | static Resource()
23 | {
24 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
25 | }
26 |
27 | public partial class Attribute
28 | {
29 |
30 | static Attribute()
31 | {
32 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
33 | }
34 |
35 | private Attribute()
36 | {
37 | }
38 | }
39 |
40 | public partial class String
41 | {
42 |
43 | // aapt resource value: 0x7f020001
44 | public static int ApplicationName = 2130837505;
45 |
46 | // aapt resource value: 0x7f020000
47 | public static int Hello = 2130837504;
48 |
49 | static String()
50 | {
51 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
52 | }
53 |
54 | private String()
55 | {
56 | }
57 | }
58 | }
59 | }
60 | #pragma warning restore 1591
61 |
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.Droid/Resources/Values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | $projectname$
5 |
6 |
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.Droid/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.Droid/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.Forms/DialogService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using GalaSoft.MvvmLight.Views;
7 |
8 | namespace MvvmLight.XamarinForms
9 | {
10 | public class DialogService : IDialogService
11 | {
12 | public async Task ShowError(Exception error, string title, string buttonText, Action afterHideCallback)
13 | {
14 | await NavigationService.NavigationPage.DisplayAlert(title, error.Message, buttonText);
15 |
16 | if (afterHideCallback != null)
17 | {
18 | afterHideCallback();
19 | }
20 | }
21 |
22 | public async Task ShowError(string message, string title, string buttonText, Action afterHideCallback)
23 | {
24 | await NavigationService.NavigationPage.DisplayAlert(title, message, buttonText);
25 |
26 | if (afterHideCallback != null)
27 | {
28 | afterHideCallback();
29 | }
30 | }
31 |
32 | public async Task ShowMessage(string message, string title)
33 | {
34 | await NavigationService.NavigationPage.DisplayAlert(title, message, "OK");
35 | }
36 |
37 | public async Task ShowMessage(string message, string title, string buttonText, Action afterHideCallback)
38 | {
39 | await NavigationService.NavigationPage.DisplayAlert(title, message, buttonText);
40 |
41 | if (afterHideCallback != null)
42 | {
43 | afterHideCallback();
44 | }
45 | }
46 |
47 | public async Task ShowMessage(string message, string title, string buttonConfirmText, string buttonCancelText, Action afterHideCallback)
48 | {
49 | var result = await NavigationService.NavigationPage.DisplayAlert(title, message, buttonConfirmText, buttonCancelText);
50 |
51 | if (afterHideCallback != null)
52 | {
53 | afterHideCallback(result);
54 | }
55 |
56 | return result;
57 | }
58 |
59 | public async Task ShowMessageBox(string message, string title)
60 | {
61 | await NavigationService.NavigationPage.DisplayAlert(title, message, "OK");
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.Forms/MvvmLight.Extension.Forms.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 10.0
6 | Debug
7 | AnyCPU
8 | {73A56B39-B565-4D02-91F8-BF4224B36BEB}
9 | Library
10 | Properties
11 | MvvmLight.XamarinForms
12 | MvvmLight.XamarinForms
13 | en-US
14 | 512
15 | {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
16 | Profile259
17 | v4.5
18 |
19 |
20 |
21 |
22 | true
23 | full
24 | false
25 | bin\Debug\
26 | DEBUG;TRACE
27 | prompt
28 | 4
29 |
30 |
31 | pdbonly
32 | true
33 | bin\Release\
34 | TRACE
35 | prompt
36 | 4
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | ..\packages\MvvmLightLibs.5.2.0.0\lib\portable-net45+wp8+wpa81+netcore45+monoandroid1+xamarin.ios10\GalaSoft.MvvmLight.dll
46 | True
47 |
48 |
49 | ..\packages\MvvmLightLibs.5.2.0.0\lib\portable-net45+wp8+wpa81+netcore45+monoandroid1+xamarin.ios10\GalaSoft.MvvmLight.Extras.dll
50 | True
51 |
52 |
53 | ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll
54 | True
55 |
56 |
57 | ..\packages\MvvmLightNavigationServiceExtension.1.2.0\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\MvvmLightNavigationExtension.dll
58 | True
59 |
60 |
61 | ..\packages\Xamarin.Forms.2.3.3.180\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Core.dll
62 | True
63 |
64 |
65 | ..\packages\Xamarin.Forms.2.3.3.180\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Platform.dll
66 | True
67 |
68 |
69 | ..\packages\Xamarin.Forms.2.3.3.180\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Xaml.dll
70 | True
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
81 |
82 |
83 |
84 |
91 |
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.Forms/NavigationService.cs:
--------------------------------------------------------------------------------
1 | using GalaSoft.MvvmLight.Views;
2 | using MvvmLightNavigationExtension;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using Xamarin.Forms;
9 |
10 | namespace MvvmLight.XamarinForms
11 | {
12 | public class NavigationService : INavigationService, INavigationServiceExtension
13 | {
14 | internal static NavigationPage NavigationPage { get; private set; }
15 |
16 | private FormsNavigationHelper
17 |
18 | private Stack _navigationStack = new Stack();
19 | public void Initialize(NavigationPage navigationPage)
20 | {
21 |
22 | NavigationServiceExtension.Current = this;
23 |
24 | }
25 |
26 | public void Configure(string key, Type type)
27 | {
28 | lock(_pages)
29 | {
30 | if(_pages.ContainsKey(key))
31 | {
32 | _pages[key] = type;
33 | }
34 | else
35 | {
36 | _pages.Add(key, type);
37 | }
38 |
39 | }
40 | }
41 |
42 | public string CurrentPageKey
43 | {
44 | get { return _navigationStack.Peek(); }
45 | }
46 |
47 | public void CloseModal()
48 | {
49 | _navigation.PopModalAsync();
50 | }
51 |
52 | public void GoBack()
53 | {
54 | _navigationStack.Pop();
55 | _navigation.PopAsync();
56 | }
57 |
58 | public void NavigateTo(string pageKey)
59 | {
60 | NavigateTo(pageKey, null);
61 | }
62 |
63 | public void NavigateTo(string pageKey, object parameter)
64 | {
65 |
66 |
67 | _navigationStack.Push(pageKey);
68 | }
69 |
70 | public void OpenModal(string key)
71 | {
72 |
73 | }
74 |
75 | public void OpenModal(string key, object parameter)
76 | {
77 |
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.Forms/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Resources;
2 | using System.Reflection;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("MvvmLightNavigationExtension.Forms")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("MvvmLightNavigationExtension.Forms")]
14 | [assembly: AssemblyCopyright("Copyright © 2016")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: NeutralResourcesLanguage("en")]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Build and Revision Numbers
27 | // by using the '*' as shown below:
28 | // [assembly: AssemblyVersion("1.0.*")]
29 | [assembly: AssemblyVersion("1.0.0.0")]
30 | [assembly: AssemblyFileVersion("1.0.0.0")]
31 |
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.Forms/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.NetStd/INavigationExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace MvvmLightNavigationExtension
8 | {
9 | public interface INavigationServiceExtension
10 | {
11 | void OpenModal(string key);
12 | void OpenModal(string key, object parameter);
13 | void CloseModal();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.NetStd/MvvmLightNavigationExtension.NetStd.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard1.0
5 | MvvmLightNavigationExtension
6 | MvvmLightNavigationExtension
7 | 2.0.1-pre1
8 | Extends the navigation service in MvvmLight with a OpenModal method.
9 | MvvmLight NavigationService Extension
10 |
11 | Daniel Hindrikes
12 | Converted to .net standard
13 | https://github.com/dhindrik/MvvmLightNavigationExtension
14 | https://github.com/dhindrik/MvvmLightNavigationExtension
15 | GIT
16 | https://opensource.org/licenses/MIT
17 | Daniel Hindrikes
18 | true
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.NetStd/NavigationServiceExtension.cs:
--------------------------------------------------------------------------------
1 | using GalaSoft.MvvmLight.Views;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace MvvmLightNavigationExtension
9 | {
10 | public static class NavigationServiceExtension
11 | {
12 | public static INavigationServiceExtension Current { get; set; }
13 |
14 | public static void OpenModal(this INavigationService navigationService, string key)
15 | {
16 | Current.OpenModal(key);
17 | }
18 |
19 | public static void OpenModal(this INavigationService navigationService, string key, object parameter)
20 | {
21 | Current.OpenModal(key, parameter);
22 | }
23 |
24 | public static void CloseModal(this INavigationService navigationService)
25 | {
26 | Current.CloseModal();
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.Sample.Droid/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with you package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
--------------------------------------------------------------------------------
/MvvmLightNavigationExtension.Sample.Droid/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Android.App;
3 | using Android.Content;
4 | using Android.Runtime;
5 | using Android.Views;
6 | using Android.Widget;
7 | using Android.OS;
8 | using GalaSoft.MvvmLight.Views;
9 | using MvvmLightNavigationExtension.Sample.ViewModels;
10 | using GalaSoft.MvvmLight.Helpers;
11 | using GalaSoft.MvvmLight.Ioc;
12 |
13 | namespace MvvmLightNavigationExtension.Sample.Droid
14 | {
15 | [Activity(Label = "MvvmLightNavigationExtension.Sample.Droid", MainLauncher = true, Icon = "@drawable/icon")]
16 | public class MainActivity : ActivityBase
17 | {
18 | public MainViewModel ViewModel { get; private set; }
19 |
20 | public Button _button;
21 |
22 |
23 | private bool _isInitialized = false;
24 |
25 | protected override void OnCreate(Bundle bundle)
26 | {
27 | base.OnCreate(bundle);
28 |
29 | if (!_isInitialized)
30 | {
31 | var nav = new MvvmLightNavigationExtension.Droid.NavigationServiceExtension();
32 | nav.Initialize();
33 | nav.Configure("Page1", typeof(MainActivity));
34 | nav.Configure("Page2", typeof(PageActivity));
35 | nav.Configure("Page3", typeof(Page3Activity));
36 |
37 | SimpleIoc.Default.Register(() => nav);
38 | SimpleIoc.Default.Register(() => nav);
39 |
40 | SimpleIoc.Default.Register();
41 | SimpleIoc.Default.Register();
42 |
43 | _isInitialized = true;
44 |
45 | ViewModel = SimpleIoc.Default.GetInstance();
46 | }
47 |
48 |
49 |
50 | // Set our view from the "main" layout resource
51 | SetContentView(Resource.Layout.Main);
52 |
53 |
54 |
55 | // Get our button from the layout resource,
56 | // and attach an event to it
57 | _button = FindViewById