Receiving Input with Buttons

In most Windows Phone XAML apps, buttons are the most commonly used element for receiving user input. Ordinarily, a button initiates an action when a user taps it. Unlike Silverlight for the browser, the minimum size of the Button has been increased, making it more amenable to touch. The shape is usually rectangular, and the standard layout allows for either text or an image to be displayed as content. Buttons support three visibility states: rest (the default state), pressed, and disabled. Unlike Silverlight for the browser, however, there is no visible focus state.

The inherited FrameworkElement.HorizonalAlignment and VerticalAlignment properties both default to Stretch. The Button’s Horizontal and Vertical size, ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.