Icon Button and Menu Item

,

The ApplicationBarIconButton and ApplicationBarMenuItem classes have many things in common. Apart from the ApplicationBarIconButton class’s IconUri property, both ApplicationBarIconButton and ApplicationBarMenuItem classes contain the same set of identically named properties.

Both ApplicationBarIconButton and ApplicationBarMenuItem classes have a Text property, which is displayed on the application bar. At runtime the text for both menu items and icon buttons is transformed to lowercase to conform to the Microsoft Design Language aesthetic.

Icon button text is displayed beneath the icon when the user expands the application bar. If the length of the string exceeds 7 to 13 characters, depending on the width of the characters that make up the string, it is clipped.

Menu item text does not wrap and should be limited to 14 to 20 characters in length, depending on the width of the characters.


Tip

Many languages use different amounts of space to convey the same meaning. Therefore, when choosing menu item or button text, consider the different lengths of the text strings for the language your app will be in. Assume that an average of 30% more space will be required for any text. Depending on the language and the phrase, the localized string might even require twice as much space.


The ApplicationBarIconButton.IconUri is used to specify the location of the icon image. This value must be a relative URI, pointing to either a JPG or PNG image in the same project.


Note

When including an icon image in your project, be sure to set its build action to Content. Icon images must have a build action set to Content. If an image’s build action is set to Resource, the image will not be resolved at runtime, and a default broken icon will be displayed in its place.


To disable a menu item or button, set its IsEnabled property to false.

Both ApplicationBarIconButton and ApplicationBarMenuItem have a Click event, allowing you to place a handler in your code-beside.


Note

If the NavigationService reports that navigation is in process, Click events will not be raised by your menu items or buttons. This prevents event handlers from interfering with your control or page during navigation, when it may be in an inconsistent state.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.181.66