How to use Application Bar in windows 8

Application bar is one of the interesting feature for any Metro style applications. Application bar allows you to define standard set of options that your application needs to use at certain context. Metro style applications are generally very clean and does not have any visual portion sharing between toolbars or application options. The app bar is the options that appear dynamically to the user when the user swipe up in the device or use Windows +Z from the keyboard.

Generally we create one application bar for the whole application, but you can also make more than one while developing an application. If you are developing an application with one bar, it is recommended to align it at bottom.

How to add an appbar on your own application

Lets take a look how you can add an appbar into your application. ApplicationBar is inherited from ContentControl, which supports swipe behaviour, also it adds up one control in its child as content. You are allowed to add more than one element as Content using StackPanel or any other panel you want to use.

<ApplicationBar VerticalAlignment="Bottom" DismissMode="LightDismiss">
             <StackPanel Orientation="Horizontal">
              <Button Click="btnStartTracking_Click" />
              <Button Click="btnEndTracking_Click" />
          </StackPanel>
         </ApplicationBar>

Here the applictionbar is added at the bottom of the application which will have two buttons. You need to create a style for these buttons if you wish this to look better. Among many other properties of applicationbar, one of the most important on is DismissMode. DismissMode determines when the application bar is going to dismiss. You can use TimeDelay, to automatically dismiss the appbar after certain amount of time, you can use EdgeSwipe which will dismiss when the application edge is swiped, but the preferred one is LightDismiss. This option will dismiss the applicationbar as soon as the user taps anywhere outside of the application.

I hope the tips comes handy. Stay tune for more.

Abhishek Sur

Abhishek Sur is a Microsoft MVP since year 2011. He is an architect in the .NET platform. He has profound theoretical insight and years of hands on experience in different .NET products and languages. He leads the Microsoft User Group in Kolkata named KolkataGeeks, and regularly organizes events and seminars in various places for spreading .NET awareness. He is associated with the Microsoft Insider list on WPF and C#, and is in constant touch with product group teams. He blogs at http://www.abhisheksur.com His Book : Visual Studio 2012 and .NET 4.5 Expert Development Cookbook. Follow Abhishek at Twitter : @abhi2434

One Comment to “How to use Application Bar in windows 8”

  1. Windows 8 isn’t far behind and comes with the latest version
    of Internet Explorer, IE10 that is also high on safety
    measures. Though the quantity of apps compatible with the Windows 8 OS platform is still low in the market, it
    is expected to boom in the near future with the increased acceptance of
    the operating system. Select the shutdown icon (or any icon
    of your choosing) and click OK to close out of the Change Icon window and then click OK to close the Properties window.
    ” A dialog will appear asking if you want to “Save information for workspace.
    Unlike Window XP, the administrator account in Windows
    Vista and 7 is disabled by default. These improvements to the Elements 8 software include features that make the whole image editing processes a lot easier.

Comments are closed.