Introduction:
In this article we are going to see how to use Application Bar effectively for a Windows Phone 7 Application development. In our earlier article we have seen how to create an application using Visual Studio 2010 IDE and do some rich user interface design changes with Microsoft Expression Blend. In this article also we will create a new application and configure the application bar to make use of it effectively.
Application Bar is a set of Icons that can be configured at the bottom of the application for each page or also we can configure it for multiple pages. These buttons can be used to navigate to frequently used pages across the application which enables users to navigate quickly and easily. Application bar has some set of options along with the buttons we can configure the menu items especially for some navigation which are not that much frequently used. Application bar automatically adjusts its icons and button as the screen orientation changes as and when. [more]
The text based menu items are displayed as a list rather from the icons been shown in the screen. To access the menu items we can directly click the ellipsis at the right corner of the application bar. The menu items are by default be taken in lower case to have a consistent user experience for the end users and developers to create the application. Now let us jump start to see the step by step process on how to add a Application Bar to a new project and configure the application bar with the icons and menu items one by one.
Steps:
Open Visual Studio 2010 and create a new Silverlight for Windows Phone 7 Application named F5debugWp7ApplicationBar as shown in the screen below.
We can now see the project is been created and ready to start with our development task. As we follow some standards, we can change the page header and some small modification so that the page looks unique. Once we are done with the changes to add the application bar go the XAML Page and we can see a commented section as shown in the screen below.
Just we need to uncomment this section to have the application bar ready with some default buttons and menu’s which we can configure it as per our requirements. Once we uncomment these section we can see that we have 2 application bar icons added and 2 menu items added with the default values. Now we will change it to 3 Application bar icons and 3 Menu items. Before we start adding the code we need to have the Application bar icons ready. By default when we install the Windows Phone 7 SDK we have the icons installed to the local development machine and it will be available in the below locations
DriveName\Program Files\Microsoft SDKs\Windows Phone\v7.1\Icons\dark
DriveName\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.1\Icons\dark
We can see the list of ICONS available as shown in the screen below.
Now in the uncommitted application bar code, add the code for 3 buttons and 3 menu items as shown in the screen below. Before that add the icons that are required to use in the application bar to a new Images folder.
Now first we need to make the application icons which we added to the images folder as content, to do that go to the properties of the each image and make the Build Action as Content from Resources. Do the same for all the icons which are added to the images folder.
Once we are done with the above step, now go to the XAML code and make the changes for each button by adding the appropriate icon and the button text as shown in the below XAML code.
|
|
|
|
|
|
Now do the same for the menu items by adding the menu details as shown in the screen below.
|
|
|
|
|
|
Once we are done with the above 2 code process our final application bar code will look like below.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Now we can run the application to see if the application bar is configured correctly and the icons are visible correctly. To build and execute the application just press F5 or select the build solution option from the tool box and we can see the application is loaded into the Windows Phone 7 Emulator as shown in the screen below.
Now we need to have an event handler to trigger each button event. To do that add the event handler code in the XAML and add the event triggering code to the code behind as shown in the code below.
XAML Code:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
C# Code:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Now we have just added a code to trigger a Message Box stating which button is clicked. Once we are done with the above code now press F5 to build and execute the application and click on the Application Bar button to see the expected output as shown in the screen below.
Conclusion:
So in this article we have seen how to use the Application bar and the steps to configure the application bar with the menu items.
No Comments
I quite like cooking ls lolita kingdom dark I dont get why girls and guys think going down on the girl is nasty now. I think the best-tasting shit on the planet is pussy.
Great post. I was checking constantly this blog and I'm impressed! Extremely helpful info specifically the last part I care for such information much. I was seeking this certain information for a long time. Thank you and best of luck.
I like it whenever people get together and share ideas. Great website, continue the good work!
When do you want me to start? little lolita nude videos DAMM THAT BITCH'S FINE ASS MAKES MY GAY COCK SO HARD,I WOULD GIVE ANYTHING TO HAVE THAT BIG BLACK MEAT IN MY MANPUSSY
Pretty! This has been a really wonderful article. Thank you for providing this info.
I live here preteen lolita kid lolicon haha shes just waiting for it to come and coat her face, then she realizes hes pretty much done..weak shot. but besides that, shes smokin, decent scene.