Windows Phone 8.1/10/UWP Sidemenu without Splitview

How hard can it be to create a simple sidemenu which is supported on WinRT, Silverlight and UWP apps? Following article is based on a custom self implemented side menu, which is just a prove of concept with lirerly no optimizations and beautiful coding. The following screen recordings access the same code base, just with different XAMLs for the animations.

SideMenuSideMenu2SideMenu3SideMenu4Animation

Basic idea

The main page contains a grid, which split the whole view up into 2 pieces. The side menu and the content view. Based on the interaction the side menu is able to expand itself over the content view. Once interacted with the side menu (click on an icon) only the content view changes. That’s it!

 

Navigation

Because there is no page navigation, the main page has to handle each hardware input by its own. A very simple navigation stack gets that work done properly.

Animations

For the animations I used Blend vor VS 2015. The XAML code for the main page consists of 90% animations, 10% actual code.

Disadvantages

  • No actual page navigation. Content view is just hot swapped
  • Because of the missing page navigation, most methods won’t be called on startup. (OnNavigatedTo…)

Advantages

  • Every UIElement is content view compatible
  • 100% control over the navigation stack, without relying on pre implementations
  • Very easy to customize and change the UI layout.

Schreibe einen Kommentar

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.