For Windows Phone 7ProgramFor example, the UI is developed using 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, it is said thatCodeYou can also generate ApplicationBar, but I have not succeeded. 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.