├── .gitignore ├── App.xaml ├── App.xaml.cs ├── Droid ├── Assets │ └── AboutAssets.txt ├── HamburgerMenuExample.Droid.csproj ├── MainActivity.cs ├── 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 └── packages.config ├── HamburgerMenuExample.csproj ├── HamburgerMenuExample.sln ├── Properties └── AssemblyInfo.cs ├── ViewModels └── MenuPageViewModel.cs ├── Views ├── HomePage.xaml ├── HomePage.xaml.cs ├── MenuPage.xaml ├── MenuPage.xaml.cs ├── RootPage.cs ├── RootPage.xaml ├── SecondPage.xaml └── SecondPage.xaml.cs ├── iOS ├── AppDelegate.cs ├── Assets.xcassets │ ├── AppIcons.appiconset │ │ └── Contents.json │ └── Contents.json ├── Entitlements.plist ├── HamburgerMenuExample.iOS.csproj ├── Info.plist ├── LaunchScreen.storyboard ├── Main.cs └── packages.config └── packages.config /.gitignore: -------------------------------------------------------------------------------- 1 | #Autosave files 2 | *~ 3 | 4 | #build 5 | [Oo]bj/ 6 | [Bb]in/ 7 | packages/ 8 | TestResults/ 9 | 10 | # globs 11 | Makefile.in 12 | *.DS_Store 13 | *.sln.cache 14 | *.suo 15 | *.cache 16 | *.pidb 17 | *.userprefs 18 | *.usertasks 19 | config.log 20 | config.make 21 | config.status 22 | aclocal.m4 23 | install-sh 24 | autom4te.cache/ 25 | *.user 26 | *.tar.gz 27 | tarballs/ 28 | test-results/ 29 | Thumbs.db 30 | 31 | #Mac bundle stuff 32 | *.dmg 33 | *.app 34 | 35 | #resharper 36 | *_Resharper.* 37 | *.Resharper 38 | 39 | #dotCover 40 | *.dotCover 41 | -------------------------------------------------------------------------------- /App.xaml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /App.xaml.cs: -------------------------------------------------------------------------------- 1 | using Xamarin.Forms; 2 | 3 | namespace HamburgerMenuExample { 4 | public partial class App : Application { 5 | 6 | // ********************************************************************* 7 | // TODO: wrap in a global Navigation Service (for example purposes only) 8 | // https://wolfprogrammer.com/2016/07/22/navigation-using-mvvm-light/ 9 | public static NavigationPage NavigationPage { get; private set; } 10 | private static RootPage RootPage; 11 | public static bool MenuIsPresented { 12 | get { 13 | return RootPage.IsPresented; 14 | } 15 | set { 16 | RootPage.IsPresented = value; 17 | } 18 | } 19 | // ********************************************************************* 20 | 21 | public App() { 22 | InitializeComponent(); 23 | var menuPage = new MenuPage(); 24 | NavigationPage = new NavigationPage(new HomePage()); 25 | RootPage = new RootPage(); 26 | RootPage.Master = menuPage; 27 | RootPage.Detail = NavigationPage; 28 | MainPage = RootPage; 29 | } 30 | 31 | protected override void OnStart() { 32 | // Handle when your app starts 33 | } 34 | 35 | protected override void OnSleep() { 36 | // Handle when your app sleeps 37 | } 38 | 39 | protected override void OnResume() { 40 | // Handle when your app resumes 41 | } 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /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/HamburgerMenuExample.Droid.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {A7C08F89-D2F1-43D3-9CDC-FB4311BF05D1} 7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 8 | Library 9 | HamburgerMenuExample.Droid 10 | HamburgerMenuExample.Droid 11 | v6.0 12 | True 13 | Resources\Resource.designer.cs 14 | Resource 15 | Properties\AndroidManifest.xml 16 | Resources 17 | Assets 18 | true 19 | 20 | 21 | true 22 | full 23 | false 24 | bin\Debug 25 | DEBUG; 26 | prompt 27 | 4 28 | false 29 | None 30 | 31 | 32 | true 33 | bin\Release 34 | prompt 35 | 4 36 | false 37 | false 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | ..\packages\Xamarin.Android.Support.v4.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll 46 | 47 | 48 | ..\packages\Xamarin.Android.Support.v7.AppCompat.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.v7.AppCompat.dll 49 | 50 | 51 | ..\packages\Xamarin.Android.Support.Design.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.Design.dll 52 | 53 | 54 | ..\packages\Xamarin.Android.Support.v7.CardView.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.v7.CardView.dll 55 | 56 | 57 | ..\packages\Xamarin.Android.Support.v7.MediaRouter.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.v7.MediaRouter.dll 58 | 59 | 60 | ..\packages\Xamarin.Forms.2.0.1.6495\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll 61 | 62 | 63 | ..\packages\Xamarin.Forms.2.0.1.6495\lib\MonoAndroid10\FormsViewGroup.dll 64 | 65 | 66 | ..\packages\Xamarin.Forms.2.0.1.6495\lib\MonoAndroid10\Xamarin.Forms.Core.dll 67 | 68 | 69 | ..\packages\Xamarin.Forms.2.0.1.6495\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll 70 | 71 | 72 | ..\packages\Xamarin.Forms.2.0.1.6495\lib\MonoAndroid10\Xamarin.Forms.Platform.dll 73 | 74 | 75 | 76 | 77 | {1A8D3DEC-3045-4050-99ED-4EC9AC4CCEDB} 78 | HamburgerMenuExample 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /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 | 11 | namespace HamburgerMenuExample.Droid { 12 | [Activity(Label = "HamburgerMenuExample.Droid", Icon = "@drawable/icon", Theme = "@style/MyTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] 13 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity { 14 | protected override void OnCreate(Bundle bundle) { 15 | TabLayoutResource = Resource.Layout.Tabbar; 16 | ToolbarResource = Resource.Layout.Toolbar; 17 | 18 | base.OnCreate(bundle); 19 | 20 | global::Xamarin.Forms.Forms.Init(this, bundle); 21 | 22 | LoadApplication(new App()); 23 | } 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /Droid/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /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("HamburgerMenuExample.Droid")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("")] 13 | [assembly: AssemblyCopyright("thomas")] 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 | 29 | -------------------------------------------------------------------------------- /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/twolfprogrammer/Xamarin.Forms-Hamburger-Menu-Example/fcff09e149f1a3083fe48d39edcc0bf926c98518/Droid/Resources/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Droid/Resources/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twolfprogrammer/Xamarin.Forms-Hamburger-Menu-Example/fcff09e149f1a3083fe48d39edcc0bf926c98518/Droid/Resources/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /Droid/Resources/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twolfprogrammer/Xamarin.Forms-Hamburger-Menu-Example/fcff09e149f1a3083fe48d39edcc0bf926c98518/Droid/Resources/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /Droid/Resources/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twolfprogrammer/Xamarin.Forms-Hamburger-Menu-Example/fcff09e149f1a3083fe48d39edcc0bf926c98518/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/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /HamburgerMenuExample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {1A8D3DEC-3045-4050-99ED-4EC9AC4CCEDB} 7 | {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 8 | true 9 | Library 10 | HamburgerMenuExample 11 | HamburgerMenuExample 12 | v4.5 13 | Profile78 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug 20 | DEBUG; 21 | prompt 22 | 4 23 | false 24 | 25 | 26 | true 27 | bin\Release 28 | prompt 29 | 4 30 | false 31 | 32 | 33 | 34 | 35 | 36 | MSBuild:UpdateDesignTimeXaml 37 | 38 | 39 | MSBuild:UpdateDesignTimeXaml 40 | 41 | 42 | MSBuild:UpdateDesignTimeXaml 43 | 44 | 45 | 46 | 47 | App.xaml 48 | 49 | 50 | 51 | RootPage.xaml 52 | 53 | 54 | HomePage.xaml 55 | 56 | 57 | SecondPage.xaml 58 | 59 | 60 | MenuPage.xaml 61 | 62 | 63 | 64 | 65 | 66 | packages\Xamarin.Forms.2.0.1.6495\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll 67 | 68 | 69 | packages\Xamarin.Forms.2.0.1.6495\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Xaml.dll 70 | 71 | 72 | packages\Xamarin.Forms.2.0.1.6495\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Platform.dll 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /HamburgerMenuExample.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HamburgerMenuExample", "HamburgerMenuExample.csproj", "{1A8D3DEC-3045-4050-99ED-4EC9AC4CCEDB}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HamburgerMenuExample.iOS", "iOS\HamburgerMenuExample.iOS.csproj", "{CFFCCD81-7821-4002-87B3-7288C2B3FDBC}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HamburgerMenuExample.Droid", "Droid\HamburgerMenuExample.Droid.csproj", "{A7C08F89-D2F1-43D3-9CDC-FB4311BF05D1}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | Debug|iPhoneSimulator = Debug|iPhoneSimulator 15 | Release|iPhone = Release|iPhone 16 | Release|iPhoneSimulator = Release|iPhoneSimulator 17 | Debug|iPhone = Debug|iPhone 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {1A8D3DEC-3045-4050-99ED-4EC9AC4CCEDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {1A8D3DEC-3045-4050-99ED-4EC9AC4CCEDB}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {1A8D3DEC-3045-4050-99ED-4EC9AC4CCEDB}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {1A8D3DEC-3045-4050-99ED-4EC9AC4CCEDB}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {1A8D3DEC-3045-4050-99ED-4EC9AC4CCEDB}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 25 | {1A8D3DEC-3045-4050-99ED-4EC9AC4CCEDB}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 26 | {1A8D3DEC-3045-4050-99ED-4EC9AC4CCEDB}.Release|iPhone.ActiveCfg = Release|Any CPU 27 | {1A8D3DEC-3045-4050-99ED-4EC9AC4CCEDB}.Release|iPhone.Build.0 = Release|Any CPU 28 | {1A8D3DEC-3045-4050-99ED-4EC9AC4CCEDB}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 29 | {1A8D3DEC-3045-4050-99ED-4EC9AC4CCEDB}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 30 | {1A8D3DEC-3045-4050-99ED-4EC9AC4CCEDB}.Debug|iPhone.ActiveCfg = Debug|Any CPU 31 | {1A8D3DEC-3045-4050-99ED-4EC9AC4CCEDB}.Debug|iPhone.Build.0 = Debug|Any CPU 32 | {CFFCCD81-7821-4002-87B3-7288C2B3FDBC}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator 33 | {CFFCCD81-7821-4002-87B3-7288C2B3FDBC}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator 34 | {CFFCCD81-7821-4002-87B3-7288C2B3FDBC}.Release|Any CPU.ActiveCfg = Debug|iPhoneSimulator 35 | {CFFCCD81-7821-4002-87B3-7288C2B3FDBC}.Release|Any CPU.Build.0 = Debug|iPhoneSimulator 36 | {CFFCCD81-7821-4002-87B3-7288C2B3FDBC}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator 37 | {CFFCCD81-7821-4002-87B3-7288C2B3FDBC}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator 38 | {CFFCCD81-7821-4002-87B3-7288C2B3FDBC}.Release|iPhone.ActiveCfg = Release|iPhone 39 | {CFFCCD81-7821-4002-87B3-7288C2B3FDBC}.Release|iPhone.Build.0 = Release|iPhone 40 | {CFFCCD81-7821-4002-87B3-7288C2B3FDBC}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator 41 | {CFFCCD81-7821-4002-87B3-7288C2B3FDBC}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator 42 | {CFFCCD81-7821-4002-87B3-7288C2B3FDBC}.Debug|iPhone.ActiveCfg = Debug|iPhone 43 | {CFFCCD81-7821-4002-87B3-7288C2B3FDBC}.Debug|iPhone.Build.0 = Debug|iPhone 44 | {A7C08F89-D2F1-43D3-9CDC-FB4311BF05D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 45 | {A7C08F89-D2F1-43D3-9CDC-FB4311BF05D1}.Debug|Any CPU.Build.0 = Debug|Any CPU 46 | {A7C08F89-D2F1-43D3-9CDC-FB4311BF05D1}.Release|Any CPU.ActiveCfg = Release|Any CPU 47 | {A7C08F89-D2F1-43D3-9CDC-FB4311BF05D1}.Release|Any CPU.Build.0 = Release|Any CPU 48 | {A7C08F89-D2F1-43D3-9CDC-FB4311BF05D1}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 49 | {A7C08F89-D2F1-43D3-9CDC-FB4311BF05D1}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 50 | {A7C08F89-D2F1-43D3-9CDC-FB4311BF05D1}.Release|iPhone.ActiveCfg = Release|Any CPU 51 | {A7C08F89-D2F1-43D3-9CDC-FB4311BF05D1}.Release|iPhone.Build.0 = Release|Any CPU 52 | {A7C08F89-D2F1-43D3-9CDC-FB4311BF05D1}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 53 | {A7C08F89-D2F1-43D3-9CDC-FB4311BF05D1}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 54 | {A7C08F89-D2F1-43D3-9CDC-FB4311BF05D1}.Debug|iPhone.ActiveCfg = Debug|Any CPU 55 | {A7C08F89-D2F1-43D3-9CDC-FB4311BF05D1}.Debug|iPhone.Build.0 = Debug|Any CPU 56 | EndGlobalSection 57 | EndGlobal 58 | -------------------------------------------------------------------------------- /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("HamburgerMenuExample")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("thomas")] 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 | -------------------------------------------------------------------------------- /ViewModels/MenuPageViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Input; 3 | using Xamarin.Forms; 4 | 5 | namespace HamburgerMenuExample { 6 | public class MenuPageViewModel { 7 | 8 | public ICommand GoHomeCommand { get; set; } 9 | public ICommand GoSecondCommand { get; set; } 10 | 11 | public MenuPageViewModel() { 12 | GoHomeCommand = new Command(GoHome); 13 | GoSecondCommand = new Command(GoSecond); 14 | } 15 | 16 | void GoHome(object obj) { 17 | App.NavigationPage.Navigation.PopToRootAsync(); 18 | App.MenuIsPresented = false; 19 | } 20 | 21 | void GoSecond(object obj) { 22 | App.NavigationPage.Navigation.PushAsync(new SecondPage()); 23 | App.MenuIsPresented = false; 24 | } 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /Views/HomePage.xaml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /Views/HomePage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using Xamarin.Forms; 5 | 6 | namespace HamburgerMenuExample { 7 | public partial class HomePage : ContentPage { 8 | public HomePage() { 9 | InitializeComponent(); 10 | } 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /Views/MenuPage.xaml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 |