Coder Social home page Coder Social logo

windows-phone-navigation-drawer's Introduction

Navigation Drawer Layout for Windows Phone 8.1

'One Drive like' Navigation Drawer Layout for Windows Phone 8.1.

Navigation Drawer

Features

How to Use

  • Clone (download) the project

  • Add the project (or just the .cs file) to your existing solution

  • Add reference in your Windows Phone project

  • In your MainPage.xaml, add a namespace

 xmlns:drawerLayout="using:DrawerLayout"
  • Replace the root Grid layout with the DrawerLayout

  • Create two child Grid controls inside the DrawerLayout. First control will contain the main content and the second will contain the navigation drawer. Your MainPage.xaml code should look like this:

  <drawerLayout:DrawerLayout x:Name="DrawerLayout">
        <Grid>
            <!-- Main content goes here -->
        </Grid>
        <Grid>
            <!-- Navigation Drwawer goes here -->
        </Grid>
    </drawerLayout:DrawerLayout>

The final step is to initialize the layout in your MainPage constructor:

 public MainPage()
        {
            this.InitializeComponent();
            DrawerLayout.InitializeDrawerLayout();
        }

Documentation

1. Properties

  • IsDrawerOpened - returns true if drawer opened, else returns false.

2. Methods

  • InitializeDrawerLayout - initializes the drawer layout. Method must be called inside constructor.

  • OpenDrawer - opens the navigation drawer.

  • CloseDrawer - closes the navigation drawer.

3. Events

Drawer Layout raises two (self explanatory) events:

  1. DrawerOpened - raised when you swipe the drawer to the right or call OpenDrawer.

  2. DrawerClosed - raises when you swipe the drawer to the left or call CloseDrawer.

Demo & Tutorial

Demo app on Windows Phone Store: http://www.windowsphone.com/s?appid=d0264913-cfa2-4273-91c5-8372a5347084

Tutorial available on http://www.c-sharpcorner.com/UploadFile/cb386b/implementing-navigation-drawer-for-windows-phone-8-1/

NuGet

Navigation Drawer Layout is also available as NuGet Package https://www.nuget.org/packages/DrawerLayout/

Windows Phone 8 Support

For Silverlight version, check out the port on https://github.com/jgannaway/windows-phone-navigation-drawer

Credits: Jeremy Gannaway (https://github.com/jgannaway)

Licence

http://opensource.org/licenses/MIT

windows-phone-navigation-drawer's People

Contributors

amarmesic avatar konradbartecki avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.