IT tutorials
 
Mobile
 

Windows Phone 8 : Receiving Input with Buttons - Tap and Click Events, Button Click Mode, Hyperlink Button

11/25/2014 3:19:53 AM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

Tap and Click Events

Since the release of the Windows Phone 7.1 SDK, the Click event of the ButtonBase class has been superseded by a UIElement event named Tap. The Tap event is designed for touch input, while the Click event relies on legacy code that handles mouse state.


Note

While the ButtonBase Click event is still present in the SDK, unless your UI code needs to be shared with Silverlight for the browser projects, use the Tap event.


The following is an example of a UIElement.Tap event handler.

void Button_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
...
}


Note

There is another public GestureEventArgs class residing in the Windows Phone Toolkit that is, unfortunately, located in the Microsoft.Phone.Controls namespace. If you are using the Windows Phone Toolkit, be mindful that the correct type needs to be specified or a runtime exception will be raised.

Either use the namespace qualified type name, as shown in the previous example, or add a type alias to the top of your class file, like so:

using GestureEventArgs = System.Windows.Input.GestureEventArgs;

Button Click Mode

If you need to use the Button.Click event, rather than the Tap event for whatever reason, you can tailor the type of user interaction that is required to raise the Button’s Click event using the Button.ClickMode property.

The following is a list of the three possible ClickMode values:

- PressThe Click event is raised as soon as the user touches the button.

- ReleaseThe Click event is not raised until the user lifts his finger off the button. This is the default value.

- HoverHas the same effect as Press. As there is currently no support for detecting when the user hovers over a control on a Windows Phone device, this value serves no purpose and exists to maintain compatibility with Silverlight for the browser.

Hyperlink Button

The HyperlinkButton allows you to embed hypertext links in a page.

As previously stated, all UIElements have a Tap event, which can be used to perform navigation within an event handler. Performing navigation in this manner, however, can be cumbersome, and the HyperlinkButton provides an easier way to navigate to pages within your app without having to subscribe to an event or use an ICommand.

The HyperlinkButton includes a NavigateUri property. When a user presses the HyperlinkButton, the button takes care of performing the navigation.

The default appearance of the HyperlinkButton does not resemble a button at all. In fact, the default style of a HyperlinkButton is underlined text, not unlike an HTML hyperlink.

 
Others
 
- Windows Phone 8 : Receiving Input with Buttons
- Windows Phone 8 : Content Controls - Defining the Default Content Property
- Windows Phone 8 : Control Type Taxonomy - Identifying Controls Not Supported or Absent in Windows Phone
- Windows Phone 8 : Working with People - Facebook Integration (part 5) - Viewing a Friend’s Facebook Albums
- Windows Phone 8 : Working with People - Facebook Integration (part 4) - Writing on a Friend’s Facebook Wall , Viewing Facebook Wall Photos
- Windows Phone 8 : Working with People - Facebook Integration (part 3) - Commenting on a Wall Post
- Windows Phone 8 : Working with People - Facebook Integration (part 2) - Viewing a Wall Post, Viewing Comments to Wall Posts
- Windows Phone 8 : Working with People - Facebook Integration (part 1) - Connecting to Facebook
- Windows Phone 8 : Working with People - Rooms (part 8) - Adding an Appointment to the Shared Calendar , Creating a New Shared Note, Viewing Shared Notes
- Windows Phone 8 : Working with People - Rooms (part 7) - Viewing Shared Photos and Videos, Viewing the Shared Calendar
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us