├── .droidres └── .prismunitysample.droidres.db ├── .vs └── PrismUnitySample │ └── xs │ └── UserPrefs.xml ├── AuthenticationModule ├── AuthenticationModule.cs ├── AuthenticationModule.csproj ├── Properties │ └── AssemblyInfo.cs ├── ViewModels │ ├── LoginPageViewModel.cs │ └── RegisterPageViewModel.cs ├── Views │ ├── LoginPage.xaml │ ├── LoginPage.xaml.cs │ ├── RegisterPage.xaml │ └── RegisterPage.xaml.cs └── packages.config ├── Droid ├── Assets │ └── AboutAssets.txt ├── MainActivity.cs ├── PrismUnitySample.Droid.csproj ├── Properties │ ├── AndroidManifest.xml │ └── AssemblyInfo.cs ├── Resources │ ├── AboutResources.txt │ ├── drawable-hdpi │ │ └── icon.png │ ├── drawable-xhdpi │ │ └── icon.png │ ├── drawable-xxhdpi │ │ └── icon.png │ ├── drawable │ │ └── icon.png │ ├── layout │ │ ├── Tabbar.axml │ │ └── Toolbar.axml │ └── values │ │ └── styles.xml ├── Services │ └── BatteryService.cs ├── obj │ └── .cache │ │ └── com.customrenderers.prismunitysample.flag └── packages.config ├── PrismUnitySample.sln ├── PrismUnitySample ├── App.xaml ├── App.xaml.cs ├── Events │ └── UpdateNavBarEvent.cs ├── PrismUnitySample.csproj ├── Properties │ └── AssemblyInfo.cs ├── Services │ └── IBatteryService.cs ├── ViewModels │ ├── CustomMasterDetailPageViewModel.cs │ ├── HomePageViewModel.cs │ ├── LoginPageViewModel.cs │ └── Test1PageViewModel.cs ├── Views │ ├── CustomMasterDetailPage.xaml │ ├── CustomMasterDetailPage.xaml.cs │ ├── CustomNavigationPage.cs │ ├── CustomTabbedPage.xaml │ ├── CustomTabbedPage.xaml.cs │ ├── HomePage.xaml │ ├── HomePage.xaml.cs │ ├── LoginPage.xaml │ ├── LoginPage.xaml.cs │ ├── Test1Page.xaml │ ├── Test1Page.xaml.cs │ ├── Test2Page.xaml │ └── Test2Page.xaml.cs └── packages.config ├── README.md └── iOS ├── AppDelegate.cs ├── Assets.xcassets ├── AppIcon.appiconset │ └── Contents.json └── Contents.json ├── Entitlements.plist ├── Info.plist ├── LaunchScreen.storyboard ├── Main.cs ├── PrismUnitySample.iOS.csproj ├── Services └── BatteryService.cs └── packages.config /.droidres/.prismunitysample.droidres.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrossGeeks/PrismV7Sample/c7dfd1f8de6de8c929362dcb96d925f0c3eb70a9/.droidres/.prismunitysample.droidres.db -------------------------------------------------------------------------------- /.vs/PrismUnitySample/xs/UserPrefs.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /AuthenticationModule/AuthenticationModule.cs: -------------------------------------------------------------------------------- 1 | using AuthenticationModule.ViewModels; 2 | using AuthenticationModule.Views; 3 | using Prism.Ioc; 4 | using Prism.Modularity; 5 | 6 | namespace AuthenticationModule 7 | { 8 | public class AuthenticationModule : IModule 9 | { 10 | public void Initialize() { } 11 | 12 | public void OnInitialized() { } 13 | 14 | public void RegisterTypes(IContainerRegistry containerRegistry) 15 | { 16 | containerRegistry.RegisterForNavigation(); 17 | containerRegistry.RegisterForNavigation(); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /AuthenticationModule/AuthenticationModule.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {76BA6124-1C40-4BE6-B6FE-1C08D9602DE4} 7 | {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 8 | true 9 | Library 10 | AuthenticationModule 11 | AuthenticationModule 12 | v4.5 13 | Profile111 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug 20 | DEBUG; 21 | prompt 22 | 4 23 | 24 | 25 | true 26 | bin\Release 27 | prompt 28 | 4 29 | 30 | 31 | 32 | 33 | 34 | LoginPage.xaml 35 | 36 | 37 | 38 | RegisterPage.xaml 39 | 40 | 41 | 42 | 43 | 44 | MSBuild:UpdateDesignTimeXaml 45 | 46 | 47 | MSBuild:UpdateDesignTimeXaml 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll 60 | 61 | 62 | ..\packages\Prism.Core.7.0.0.362\lib\netstandard1.0\Prism.dll 63 | 64 | 65 | ..\packages\Unity.5.5.5\lib\netstandard1.0\CommonServiceLocator.dll 66 | 67 | 68 | ..\packages\Unity.5.5.5\lib\netstandard1.0\Unity.Abstractions.dll 69 | 70 | 71 | ..\packages\Unity.5.5.5\lib\netstandard1.0\Unity.Container.dll 72 | 73 | 74 | ..\packages\Unity.5.5.5\lib\netstandard1.0\Unity.ServiceLocation.dll 75 | 76 | 77 | ..\packages\Xamarin.Forms.2.5.0.122203\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Core.dll 78 | 79 | 80 | ..\packages\Xamarin.Forms.2.5.0.122203\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Platform.dll 81 | 82 | 83 | ..\packages\Xamarin.Forms.2.5.0.122203\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Xaml.dll 84 | 85 | 86 | ..\packages\Prism.Forms.7.0.0.362\lib\netstandard1.0\Prism.Forms.dll 87 | 88 | 89 | ..\packages\Prism.Unity.Forms.7.0.0.362\lib\netstandard1.0\Prism.Unity.Forms.dll 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /AuthenticationModule/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("AuthenticationModule")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("(c) Rendy Del Rosario")] 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 | -------------------------------------------------------------------------------- /AuthenticationModule/ViewModels/LoginPageViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace AuthenticationModule.ViewModels 3 | { 4 | public class LoginPageViewModel 5 | { 6 | public LoginPageViewModel() 7 | { 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /AuthenticationModule/ViewModels/RegisterPageViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace AuthenticationModule.ViewModels 3 | { 4 | public class RegisterPageViewModel 5 | { 6 | public RegisterPageViewModel() 7 | { 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /AuthenticationModule/Views/LoginPage.xaml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /AuthenticationModule/Views/LoginPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using Xamarin.Forms; 5 | 6 | namespace AuthenticationModule 7 | { 8 | public partial class LoginPage : ContentPage 9 | { 10 | public LoginPage() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /AuthenticationModule/Views/RegisterPage.xaml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /AuthenticationModule/Views/RegisterPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using Xamarin.Forms; 5 | 6 | namespace AuthenticationModule.Views 7 | { 8 | public partial class RegisterPage : ContentPage 9 | { 10 | public RegisterPage() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /AuthenticationModule/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /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 your 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"); 20 | -------------------------------------------------------------------------------- /Droid/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Android.App; 4 | using Android.Content; 5 | using Android.Content.PM; 6 | using Android.Runtime; 7 | using Android.Views; 8 | using Android.Widget; 9 | using Android.OS; 10 | using PrismUnitySample.Droid.Services; 11 | using PrismUnitySample.Services; 12 | using Prism; 13 | using Prism.Ioc; 14 | 15 | namespace PrismUnitySample.Droid 16 | { 17 | [Activity(Label = "PrismUnitySample.Droid", Icon = "@drawable/icon", Theme = "@style/MyTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] 18 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity 19 | { 20 | static BatteryService batteryService = new BatteryService(); 21 | protected override void OnCreate(Bundle bundle) 22 | { 23 | TabLayoutResource = Resource.Layout.Tabbar; 24 | ToolbarResource = Resource.Layout.Toolbar; 25 | 26 | base.OnCreate(bundle); 27 | 28 | global::Xamarin.Forms.Forms.Init(this, bundle); 29 | 30 | LoadApplication(new App(new AndroidInitializer())); 31 | 32 | } 33 | 34 | public class AndroidInitializer : IPlatformInitializer 35 | { 36 | public void RegisterTypes(IContainerRegistry containerRegistry) 37 | { 38 | containerRegistry.RegisterInstance(batteryService); 39 | 40 | } 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /Droid/PrismUnitySample.Droid.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {56F6AAAC-E885-432D-9058-61DEBF1635A2} 8 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 9 | Library 10 | PrismUnitySample.Droid 11 | PrismUnitySample.Droid 12 | v8.0 13 | True 14 | Resources\Resource.designer.cs 15 | Resource 16 | Properties\AndroidManifest.xml 17 | Resources 18 | Assets 19 | true 20 | 21 | 22 | true 23 | full 24 | false 25 | bin\Debug 26 | DEBUG; 27 | prompt 28 | 4 29 | None 30 | 31 | 32 | true 33 | pdbonly 34 | true 35 | bin\Release 36 | prompt 37 | 4 38 | true 39 | false 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | ..\packages\Prism.Core.7.0.0.362\lib\netstandard2.0\Prism.dll 48 | 49 | 50 | ..\packages\Xamarin.Forms.2.5.0.122203\lib\MonoAndroid10\FormsViewGroup.dll 51 | 52 | 53 | ..\packages\Xamarin.Forms.2.5.0.122203\lib\MonoAndroid10\Xamarin.Forms.Core.dll 54 | 55 | 56 | ..\packages\Xamarin.Forms.2.5.0.122203\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll 57 | 58 | 59 | ..\packages\Xamarin.Forms.2.5.0.122203\lib\MonoAndroid10\Xamarin.Forms.Platform.dll 60 | 61 | 62 | ..\packages\Xamarin.Forms.2.5.0.122203\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll 63 | 64 | 65 | ..\packages\Prism.Forms.7.0.0.362\lib\netstandard2.0\Prism.Forms.dll 66 | 67 | 68 | ..\packages\Unity.5.5.5\lib\netstandard2.0\CommonServiceLocator.dll 69 | 70 | 71 | ..\packages\Unity.5.5.5\lib\netstandard2.0\Unity.Abstractions.dll 72 | 73 | 74 | ..\packages\Unity.5.5.5\lib\netstandard2.0\Unity.Container.dll 75 | 76 | 77 | ..\packages\Unity.5.5.5\lib\netstandard2.0\Unity.ServiceLocation.dll 78 | 79 | 80 | ..\packages\Xamarin.Android.Support.Annotations.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Annotations.dll 81 | 82 | 83 | ..\packages\Xamarin.Android.Arch.Core.Common.1.0.0\lib\MonoAndroid80\Xamarin.Android.Arch.Core.Common.dll 84 | 85 | 86 | ..\packages\Xamarin.Android.Arch.Lifecycle.Common.1.0.1\lib\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Common.dll 87 | 88 | 89 | ..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.0.0\lib\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Runtime.dll 90 | 91 | 92 | ..\packages\Xamarin.Android.Support.Compat.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Compat.dll 93 | 94 | 95 | ..\packages\Xamarin.Android.Support.Core.UI.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Core.UI.dll 96 | 97 | 98 | ..\packages\Xamarin.Android.Support.Core.Utils.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Core.Utils.dll 99 | 100 | 101 | ..\packages\Xamarin.Android.Support.Fragment.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Fragment.dll 102 | 103 | 104 | ..\packages\Xamarin.Android.Support.Media.Compat.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Media.Compat.dll 105 | 106 | 107 | ..\packages\Xamarin.Android.Support.Transition.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Transition.dll 108 | 109 | 110 | ..\packages\Xamarin.Android.Support.v4.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.v4.dll 111 | 112 | 113 | ..\packages\Xamarin.Android.Support.v7.CardView.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.v7.CardView.dll 114 | 115 | 116 | ..\packages\Xamarin.Android.Support.v7.Palette.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.v7.Palette.dll 117 | 118 | 119 | ..\packages\Xamarin.Android.Support.v7.RecyclerView.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.v7.RecyclerView.dll 120 | 121 | 122 | ..\packages\Xamarin.Android.Support.Vector.Drawable.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Vector.Drawable.dll 123 | 124 | 125 | ..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Animated.Vector.Drawable.dll 126 | 127 | 128 | ..\packages\Xamarin.Android.Support.v7.AppCompat.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.v7.AppCompat.dll 129 | 130 | 131 | ..\packages\Xamarin.Android.Support.Design.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Design.dll 132 | 133 | 134 | ..\packages\Xamarin.Android.Support.v7.MediaRouter.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.v7.MediaRouter.dll 135 | 136 | 137 | ..\packages\Prism.Unity.Forms.7.0.0.362\lib\netstandard2.0\Prism.Unity.Forms.dll 138 | 139 | 140 | 141 | 142 | {F8CCB828-6B8F-4145-A940-002C0DAF9477} 143 | PrismUnitySample 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | -------------------------------------------------------------------------------- /Droid/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Droid/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using Android.App; 4 | 5 | // Information about this assembly is defined by the following attributes. 6 | // Change them to the values specific to your project. 7 | 8 | [assembly: AssemblyTitle("PrismUnitySample.Droid")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("")] 13 | [assembly: AssemblyCopyright("(c) Rendy Del Rosario")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 18 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 19 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 20 | 21 | [assembly: AssemblyVersion("1.0.0")] 22 | 23 | // The following attributes are used to specify the signing key for the assembly, 24 | // if desired. See the Mono documentation for more information about signing. 25 | 26 | //[assembly: AssemblyDelaySign(false)] 27 | //[assembly: AssemblyKeyFile("")] 28 | -------------------------------------------------------------------------------- /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. 45 | -------------------------------------------------------------------------------- /Droid/Resources/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrossGeeks/PrismV7Sample/c7dfd1f8de6de8c929362dcb96d925f0c3eb70a9/Droid/Resources/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Droid/Resources/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrossGeeks/PrismV7Sample/c7dfd1f8de6de8c929362dcb96d925f0c3eb70a9/Droid/Resources/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /Droid/Resources/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrossGeeks/PrismV7Sample/c7dfd1f8de6de8c929362dcb96d925f0c3eb70a9/Droid/Resources/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /Droid/Resources/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrossGeeks/PrismV7Sample/c7dfd1f8de6de8c929362dcb96d925f0c3eb70a9/Droid/Resources/drawable/icon.png -------------------------------------------------------------------------------- /Droid/Resources/layout/Tabbar.axml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /Droid/Resources/layout/Toolbar.axml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /Droid/Resources/values/styles.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 5 | 6 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /Droid/Services/BatteryService.cs: -------------------------------------------------------------------------------- 1 | using Android.App; 2 | using Android.Content; 3 | using Android.OS; 4 | using PrismUnitySample.Services; 5 | 6 | namespace PrismUnitySample.Droid.Services 7 | { 8 | public class BatteryService : IBatteryService 9 | { 10 | public string GetBatteryStatus() 11 | { 12 | try 13 | { 14 | using (var filter = new IntentFilter(Intent.ActionBatteryChanged)) 15 | { 16 | using (var battery = Application.Context.RegisterReceiver(null, filter)) 17 | { 18 | int status = battery.GetIntExtra(BatteryManager.ExtraStatus, -1); 19 | var isCharging = status == (int)BatteryStatus.Charging || status == (int)BatteryStatus.Full; 20 | 21 | var chargePlug = battery.GetIntExtra(BatteryManager.ExtraPlugged, -1); 22 | var usbCharge = chargePlug == (int)BatteryPlugged.Usb; 23 | var acCharge = chargePlug == (int)BatteryPlugged.Ac; 24 | bool wirelessCharge = false; 25 | wirelessCharge = chargePlug == (int)BatteryPlugged.Wireless; 26 | 27 | isCharging = (usbCharge || acCharge || wirelessCharge); 28 | if (isCharging) 29 | return "Charging"; 30 | 31 | switch (status) 32 | { 33 | case (int)BatteryStatus.Charging: 34 | return "Charging"; 35 | case (int)BatteryStatus.Discharging: 36 | return "Discharging"; 37 | case (int)BatteryStatus.Full: 38 | return "Full"; 39 | case (int)BatteryStatus.NotCharging: 40 | return "NotCharging"; 41 | default: 42 | return "Unknown"; 43 | } 44 | } 45 | } 46 | } 47 | catch 48 | { 49 | System.Diagnostics.Debug.WriteLine("Ensure you have android.permission.BATTERY_STATS"); 50 | throw; 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Droid/obj/.cache/com.customrenderers.prismunitysample.flag: -------------------------------------------------------------------------------- 1 | DebugAnyCPU-s 192.168.123.101:5555 2 | -------------------------------------------------------------------------------- /Droid/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /PrismUnitySample.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrismUnitySample", "PrismUnitySample\PrismUnitySample.csproj", "{F8CCB828-6B8F-4145-A940-002C0DAF9477}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrismUnitySample.iOS", "iOS\PrismUnitySample.iOS.csproj", "{9E6370AF-2947-47FC-A57B-0C10910CF06D}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrismUnitySample.Droid", "Droid\PrismUnitySample.Droid.csproj", "{56F6AAAC-E885-432D-9058-61DEBF1635A2}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{2C05F83E-1902-4737-9CC9-21FDDB99D677}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationModule", "AuthenticationModule\AuthenticationModule.csproj", "{76BA6124-1C40-4BE6-B6FE-1C08D9602DE4}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Release|Any CPU = Release|Any CPU 18 | Debug|iPhoneSimulator = Debug|iPhoneSimulator 19 | Release|iPhone = Release|iPhone 20 | Release|iPhoneSimulator = Release|iPhoneSimulator 21 | Debug|iPhone = Debug|iPhone 22 | EndGlobalSection 23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 24 | {F8CCB828-6B8F-4145-A940-002C0DAF9477}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {F8CCB828-6B8F-4145-A940-002C0DAF9477}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {F8CCB828-6B8F-4145-A940-002C0DAF9477}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {F8CCB828-6B8F-4145-A940-002C0DAF9477}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {F8CCB828-6B8F-4145-A940-002C0DAF9477}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 29 | {F8CCB828-6B8F-4145-A940-002C0DAF9477}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 30 | {F8CCB828-6B8F-4145-A940-002C0DAF9477}.Release|iPhone.ActiveCfg = Release|Any CPU 31 | {F8CCB828-6B8F-4145-A940-002C0DAF9477}.Release|iPhone.Build.0 = Release|Any CPU 32 | {F8CCB828-6B8F-4145-A940-002C0DAF9477}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 33 | {F8CCB828-6B8F-4145-A940-002C0DAF9477}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 34 | {F8CCB828-6B8F-4145-A940-002C0DAF9477}.Debug|iPhone.ActiveCfg = Debug|Any CPU 35 | {F8CCB828-6B8F-4145-A940-002C0DAF9477}.Debug|iPhone.Build.0 = Debug|Any CPU 36 | {9E6370AF-2947-47FC-A57B-0C10910CF06D}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator 37 | {9E6370AF-2947-47FC-A57B-0C10910CF06D}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator 38 | {9E6370AF-2947-47FC-A57B-0C10910CF06D}.Release|Any CPU.ActiveCfg = Release|iPhone 39 | {9E6370AF-2947-47FC-A57B-0C10910CF06D}.Release|Any CPU.Build.0 = Release|iPhone 40 | {9E6370AF-2947-47FC-A57B-0C10910CF06D}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator 41 | {9E6370AF-2947-47FC-A57B-0C10910CF06D}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator 42 | {9E6370AF-2947-47FC-A57B-0C10910CF06D}.Release|iPhone.ActiveCfg = Release|iPhone 43 | {9E6370AF-2947-47FC-A57B-0C10910CF06D}.Release|iPhone.Build.0 = Release|iPhone 44 | {9E6370AF-2947-47FC-A57B-0C10910CF06D}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator 45 | {9E6370AF-2947-47FC-A57B-0C10910CF06D}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator 46 | {9E6370AF-2947-47FC-A57B-0C10910CF06D}.Debug|iPhone.ActiveCfg = Debug|iPhone 47 | {9E6370AF-2947-47FC-A57B-0C10910CF06D}.Debug|iPhone.Build.0 = Debug|iPhone 48 | {56F6AAAC-E885-432D-9058-61DEBF1635A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 49 | {56F6AAAC-E885-432D-9058-61DEBF1635A2}.Debug|Any CPU.Build.0 = Debug|Any CPU 50 | {56F6AAAC-E885-432D-9058-61DEBF1635A2}.Release|Any CPU.ActiveCfg = Release|Any CPU 51 | {56F6AAAC-E885-432D-9058-61DEBF1635A2}.Release|Any CPU.Build.0 = Release|Any CPU 52 | {56F6AAAC-E885-432D-9058-61DEBF1635A2}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 53 | {56F6AAAC-E885-432D-9058-61DEBF1635A2}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 54 | {56F6AAAC-E885-432D-9058-61DEBF1635A2}.Release|iPhone.ActiveCfg = Release|Any CPU 55 | {56F6AAAC-E885-432D-9058-61DEBF1635A2}.Release|iPhone.Build.0 = Release|Any CPU 56 | {56F6AAAC-E885-432D-9058-61DEBF1635A2}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 57 | {56F6AAAC-E885-432D-9058-61DEBF1635A2}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 58 | {56F6AAAC-E885-432D-9058-61DEBF1635A2}.Debug|iPhone.ActiveCfg = Debug|Any CPU 59 | {56F6AAAC-E885-432D-9058-61DEBF1635A2}.Debug|iPhone.Build.0 = Debug|Any CPU 60 | {76BA6124-1C40-4BE6-B6FE-1C08D9602DE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 61 | {76BA6124-1C40-4BE6-B6FE-1C08D9602DE4}.Debug|Any CPU.Build.0 = Debug|Any CPU 62 | {76BA6124-1C40-4BE6-B6FE-1C08D9602DE4}.Release|Any CPU.ActiveCfg = Release|Any CPU 63 | {76BA6124-1C40-4BE6-B6FE-1C08D9602DE4}.Release|Any CPU.Build.0 = Release|Any CPU 64 | {76BA6124-1C40-4BE6-B6FE-1C08D9602DE4}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 65 | {76BA6124-1C40-4BE6-B6FE-1C08D9602DE4}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 66 | {76BA6124-1C40-4BE6-B6FE-1C08D9602DE4}.Release|iPhone.ActiveCfg = Release|Any CPU 67 | {76BA6124-1C40-4BE6-B6FE-1C08D9602DE4}.Release|iPhone.Build.0 = Release|Any CPU 68 | {76BA6124-1C40-4BE6-B6FE-1C08D9602DE4}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 69 | {76BA6124-1C40-4BE6-B6FE-1C08D9602DE4}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 70 | {76BA6124-1C40-4BE6-B6FE-1C08D9602DE4}.Debug|iPhone.ActiveCfg = Debug|Any CPU 71 | {76BA6124-1C40-4BE6-B6FE-1C08D9602DE4}.Debug|iPhone.Build.0 = Debug|Any CPU 72 | EndGlobalSection 73 | GlobalSection(NestedProjects) = preSolution 74 | {76BA6124-1C40-4BE6-B6FE-1C08D9602DE4} = {2C05F83E-1902-4737-9CC9-21FDDB99D677} 75 | EndGlobalSection 76 | EndGlobal 77 | -------------------------------------------------------------------------------- /PrismUnitySample/App.xaml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /PrismUnitySample/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Prism; 3 | using Prism.Ioc; 4 | using Prism.Modularity; 5 | using Prism.Unity; 6 | using PrismUnitySample.ViewModels; 7 | using PrismUnitySample.Views; 8 | using Xamarin.Forms; 9 | 10 | namespace PrismUnitySample 11 | { 12 | public partial class App : PrismApplication 13 | { 14 | public App(IPlatformInitializer initializer = null) : base(initializer) { } 15 | 16 | protected override void OnInitialized() 17 | { 18 | InitializeComponent(); 19 | 20 | 21 | //Uncomment this list to Test Prism Tabbed Page 22 | NavigationService.NavigateAsync(new System.Uri("/NavigationPage/CustomTabbedPage?selectedTab=Test2Page", System.UriKind.Absolute)); 23 | 24 | //Uncomment this list to Test Prism Master DetailPage 25 | // NavigationService.NavigateAsync(new System.Uri("/CustomMasterDetailPage/NavigationPage/Test2Page", System.UriKind.Absolute)); 26 | 27 | //Uncomment this list to Test Prism general concepts as Custom NavigationPage/Modules/DelegateCommands/Services 28 | //NavigationService.NavigateAsync(new System.Uri("http://www.MyTestApp/CustomNavigationPage/LoginPage", System.UriKind.Absolute)); 29 | 30 | 31 | } 32 | 33 | protected override void RegisterTypes(IContainerRegistry containerRegistry) 34 | { 35 | containerRegistry.RegisterForNavigation(); 36 | containerRegistry.RegisterForNavigation(); 37 | 38 | containerRegistry.RegisterForNavigation(); 39 | 40 | containerRegistry.RegisterForNavigation(); 41 | containerRegistry.RegisterForNavigation(); 42 | containerRegistry.RegisterForNavigation(); 43 | 44 | containerRegistry.RegisterForNavigation(); 45 | containerRegistry.RegisterForNavigation(); 46 | 47 | } 48 | 49 | protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog) 50 | { 51 | Type authenticationModuleType = typeof(AuthenticationModule.AuthenticationModule); 52 | moduleCatalog.AddModule( 53 | new ModuleInfo(authenticationModuleType) 54 | { 55 | ModuleName = authenticationModuleType.Name, 56 | InitializationMode = InitializationMode.OnDemand 57 | }); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /PrismUnitySample/Events/UpdateNavBarEvent.cs: -------------------------------------------------------------------------------- 1 | using Prism.Events; 2 | 3 | namespace PrismUnitySample.Events 4 | { 5 | public class UpdateNavBarEvent : PubSubEvent 6 | { 7 | 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /PrismUnitySample/PrismUnitySample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {F8CCB828-6B8F-4145-A940-002C0DAF9477} 7 | {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 8 | true 9 | Library 10 | PrismUnitySample 11 | PrismUnitySample 12 | v4.5 13 | Profile111 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug 20 | DEBUG; 21 | prompt 22 | 4 23 | 24 | 25 | true 26 | bin\Release 27 | prompt 28 | 4 29 | 30 | 31 | 32 | 33 | MSBuild:UpdateDesignTimeXaml 34 | 35 | 36 | MSBuild:UpdateDesignTimeXaml 37 | 38 | 39 | MSBuild:UpdateDesignTimeXaml 40 | 41 | 42 | MSBuild:UpdateDesignTimeXaml 43 | 44 | 45 | MSBuild:UpdateDesignTimeXaml 46 | 47 | 48 | MSBuild:UpdateDesignTimeXaml 49 | 50 | 51 | 52 | 53 | App.xaml 54 | 55 | 56 | 57 | 58 | HomePage.xaml 59 | 60 | 61 | LoginPage.xaml 62 | 63 | 64 | 65 | 66 | 67 | 68 | CustomTabbedPage.xaml 69 | 70 | 71 | Test1Page.xaml 72 | 73 | 74 | Test2Page.xaml 75 | 76 | 77 | CustomMasterDetailPage.xaml 78 | 79 | 80 | 81 | 82 | 83 | 84 | ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll 85 | 86 | 87 | ..\packages\Prism.Core.7.0.0.362\lib\netstandard1.0\Prism.dll 88 | 89 | 90 | ..\packages\Xamarin.Forms.2.5.0.122203\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Core.dll 91 | 92 | 93 | ..\packages\Xamarin.Forms.2.5.0.122203\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Platform.dll 94 | 95 | 96 | ..\packages\Xamarin.Forms.2.5.0.122203\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Xaml.dll 97 | 98 | 99 | ..\packages\Prism.Forms.7.0.0.362\lib\netstandard1.0\Prism.Forms.dll 100 | 101 | 102 | ..\packages\Unity.5.5.5\lib\netstandard1.0\Unity.Abstractions.dll 103 | 104 | 105 | ..\packages\Unity.5.5.5\lib\netstandard1.0\Unity.Container.dll 106 | 107 | 108 | ..\packages\Unity.5.5.5\lib\netstandard1.0\Unity.ServiceLocation.dll 109 | 110 | 111 | ..\packages\Prism.Unity.Forms.7.0.0.362\lib\netstandard1.0\Prism.Unity.Forms.dll 112 | 113 | 114 | ..\packages\CommonServiceLocator.2.0.2\lib\netstandard1.0\CommonServiceLocator.dll 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | {76BA6124-1C40-4BE6-B6FE-1C08D9602DE4} 129 | AuthenticationModule 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /PrismUnitySample/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("PrismUnitySample")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("(c) Rendy Del Rosario")] 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 | -------------------------------------------------------------------------------- /PrismUnitySample/Services/IBatteryService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace PrismUnitySample.Services 3 | { 4 | public interface IBatteryService 5 | { 6 | string GetBatteryStatus(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /PrismUnitySample/ViewModels/CustomMasterDetailPageViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Prism.Commands; 3 | using Prism.Navigation; 4 | 5 | namespace PrismUnitySample.ViewModels 6 | { 7 | public class CustomMasterDetailPageViewModel 8 | { 9 | INavigationService _navigationService; 10 | public DelegateCommand OnNavigateCommand { get; set; } 11 | public CustomMasterDetailPageViewModel(INavigationService navigationService) 12 | { 13 | _navigationService = navigationService; 14 | OnNavigateCommand = new DelegateCommand(NavigateAync); 15 | } 16 | 17 | async void NavigateAync(string page){ 18 | await _navigationService.NavigateAsync(new Uri(page, UriKind.Relative)); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /PrismUnitySample/ViewModels/HomePageViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Input; 3 | using Prism.Commands; 4 | using Prism.Common; 5 | using Prism.Modularity; 6 | using Prism.Mvvm; 7 | using Prism.Navigation; 8 | using Prism.Services; 9 | using PrismUnitySample.Services; 10 | 11 | namespace PrismUnitySample.ViewModels 12 | { 13 | public class HomePageViewModel : BindableBase,INavigatedAware 14 | { 15 | private string _userName; 16 | public string UserName 17 | { 18 | get { return _userName; } 19 | set { SetProperty(ref _userName, value); } 20 | } 21 | 22 | INavigationService _navigationService; 23 | IBatteryService _batteryService; 24 | IPageDialogService _pageDialogService; 25 | 26 | public ICommand GetBatteryStatusCommand { get; set; } 27 | 28 | public bool AllFieldsAreValid { get; set; } = true; 29 | 30 | 31 | IModuleManager _moduleManager; 32 | public HomePageViewModel(IModuleManager moduleManager, INavigationService navigationService, IBatteryService batteryService, IPageDialogService pageDialogService) 33 | { 34 | _moduleManager = moduleManager; 35 | _navigationService = navigationService; 36 | _batteryService = batteryService; 37 | _pageDialogService = pageDialogService; 38 | 39 | GetBatteryStatusCommand = new DelegateCommand(GetBatteryStatus).ObservesCanExecute(() => AllFieldsAreValid); 40 | } 41 | 42 | async void GetBatteryStatus(){ 43 | 44 | var batteryStatus = _batteryService.GetBatteryStatus(); 45 | await _pageDialogService.DisplayAlertAsync("Battery Status", batteryStatus, "Ok"); 46 | 47 | } 48 | 49 | void INavigatedAware.OnNavigatedFrom(NavigationParameters parameters) 50 | { 51 | 52 | 53 | } 54 | 55 | void INavigatedAware.OnNavigatedTo(NavigationParameters parameters) 56 | { 57 | if(parameters.ContainsKey("UserName")){ 58 | UserName = parameters.GetValue("UserName"); 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /PrismUnitySample/ViewModels/LoginPageViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Prism.Commands; 4 | using Prism.Common; 5 | using Prism.Mvvm; 6 | using Prism.Navigation; 7 | using Prism.Services; 8 | 9 | namespace PrismUnitySample.ViewModels 10 | { 11 | public class LoginPageViewModel: BindableBase 12 | { 13 | public DelegateCommand OnLoginCommand { get; set;} 14 | INavigationService _navigationService; 15 | IPageDialogService _pageDialogService; 16 | 17 | private string _userName; 18 | public string UserName 19 | { 20 | get { return _userName; } 21 | set { SetProperty(ref _userName, value); } 22 | } 23 | 24 | public LoginPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService) 25 | { 26 | _navigationService = navigationService; 27 | _pageDialogService = pageDialogService; 28 | OnLoginCommand = new DelegateCommand(async()=> await GoHome()); 29 | } 30 | 31 | async Task GoHome(){ 32 | if (string.IsNullOrEmpty(UserName)) 33 | await _pageDialogService.DisplayAlertAsync("Error","UserName is required", "Ok"); 34 | else 35 | await _navigationService.NavigateAsync(new Uri($"HomePage?UserName={UserName}", UriKind.Relative)); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /PrismUnitySample/ViewModels/Test1PageViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Prism; 4 | using Prism.Commands; 5 | using Prism.Mvvm; 6 | using Prism.Navigation; 7 | 8 | namespace PrismUnitySample.ViewModels 9 | { 10 | public class Test1PageViewModel: BindableBase, IActiveAware 11 | { 12 | INavigationService _navigationService; 13 | 14 | public event EventHandler IsActiveChanged; 15 | 16 | public DelegateCommand OnLoginCommand { get; set; } 17 | private bool _isActive; 18 | public bool IsActive 19 | { 20 | get { return _isActive; } 21 | set { SetProperty(ref _isActive, value, RaiseIsActiveChanged); } 22 | } 23 | public Test1PageViewModel(INavigationService navigationService) 24 | { 25 | _navigationService = navigationService; 26 | OnLoginCommand = new DelegateCommand(GoHome); 27 | } 28 | 29 | protected virtual void RaiseIsActiveChanged() 30 | { 31 | IsActiveChanged?.Invoke(this, EventArgs.Empty); 32 | } 33 | async void GoHome() 34 | { 35 | await _navigationService.NavigateAsync(new Uri($"HomePage", UriKind.Relative), null, false); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /PrismUnitySample/Views/CustomMasterDetailPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 |