For the Windows Phone 7 program, the UI is developed with Sliverlight, but it is not completely the complete set of Sliverlight. It is related to the subset, because there are no APIs or functions on the PC (such as the application bar) On Phone 7, sliverlight on the PC should not be mentioned.
Application Bar is the so-called Menu Bar, which includes two types: Iconbutton and Menu. Iconbutton is equivalent to the toolbar in the Menu bar, which can contain icons; Menu is the Menu, but there is no Level-2 Menu. Before creation, you must add Microsoft. phone. and add xmlns: shell = "clr-namespace: Microsoft. phone. shell; assembly = Microsoft. phone. shell ".
I. IconBar
To create an IconBar, you must have an Icon. Phone7 has strict requirements on the Icon. The size must be a png Image of 48x48 Prime. The image type is centered. The foreground color is generally white and the size is 26X26. with the picture can be created, if there is no relationship, Microsoft provides a set of icon http://www.microsoft.com/downloads/details.aspx? Familyid = 492b20f7-9d30-4cff-8a1b-f80901b2da93 & displaylang = en.
Create Iconbar:
<Navigation: PhoneApplicationPage. ApplicationBar>
<Shell: ApplicationBar IsVisible = "True" IsMenuEnabled = "True">
<Shell: ApplicationBar. Buttons>
<Shell: ApplicationBarIconButton x: Name = "btnTest" Click = "btnTest_Click" IconUri = "appbar.add.rest.png"> </shell: ApplicationBarIconButton>
</Shell: ApplicationBar. Buttons>
</Shell: ApplicationBar>
</Navigation: PhoneApplicationPage. ApplicationBar>
In this way, an Iconbar is created. However, you must note that there are limits on the number of iconbars. You can add up to five Iconbar entries, and 5th Iconbar entries cannot be displayed. That is, you can only add up to four Iconbar entries.
Ii. Menu
Creating a Menu is simple and has no restrictions.
<Navigation: PhoneApplicationPage. ApplicationBar>
<Shell: ApplicationBar IsVisible = "True" IsMenuEnabled = "True">
<Shell: ApplicationBar. MenuItems>
<Shell: ApplicationBarMenuItem x: Name = "mTest" Text = "Text" Click = "mTest_Click"> </shell: ApplicationBarMenuItem>
<Shell: ApplicationBarMenuItem x: Name = "mTes1" Text = "Text" Click = "mTest1_Click"> </shell: ApplicationBarMenuItem>
<Shell: ApplicationBarMenuItem x: Name = "mTest2" Text = "Text" Click = "mTest2_Click"> </shell: ApplicationBarMenuItem>
<Shell: ApplicationBarMenuItem x: Name = "mTest3" Text = "Text" Click = "mTest3_Click"> </shell: ApplicationBarMenuItem>
</Shell: ApplicationBar. MenuItems>
</Shell: ApplicationBar>
</Navigation: PhoneApplicationPage. ApplicationBar>
In addition, the current ApplicationBar is not very stable. Sometimes, after writing code in the response function, it will cause a 2214 error! We hope that the official SDK of Microsoft can be improved.