Hyperlinkbutton controls
The Hyperlinkbutton control is a button that is displayed as a hyperlink text, and you can set a URI address for its NavigateUri property, and when you click the Hyperlink text button, the URI address page defined in the Hyperlinkbutton control is opened using the browser.
In a XAML file, the use of the Hyperlinkbutton control is as follows:
- or -
<!-- Adding child elements -
</HyperlinkButton>
- or -
<!-- Add a String -
</HyperlinkButton>
The following describes the common properties of the Hyperlinkbutton control:
- The content property, Gets or sets the text contents of the Hyperlinkbutton control.
- Foreground property, Gets or sets the text color of the Hyperlinkbutton control.
- NavigateUri property, Gets or sets the URI address to navigate to another page when you click the Hyperlinkbutton control.
Next, a sample demonstrates how to use the NavigateUri property of the Hyperlinkbutton control. Create a new Windows store blank application project and name Hyperlinkbuttondemo to add the following code to the grid element of the MainPage.xaml file.
Click to learn more about Microsoft "fontsize=" foreground= "white" navigateuri= "http://www.microsoft.com/zh-cn/default.aspx" margin= " 101,405,0,292 "height="/>
The above code defines the NavigateUri property value of the Hyperlinkbutton control as http://www.microsoft.com/zh-cn/ Default.aspx, when you click the Hyperlinkbutton control to display the hyperlink text, the browser opens the URI address page of the NavigateUri property setting.
start debugging, as shown in result 4-3. After clicking the "click to learn more Microsoft Information" hyperlink text, the browser will open the Microsoft China Official website page, shown in 4-4.
Figure 4-3 The use of the NavigateUri attribute figure 4-4 Microsoft China Official website page
WIN10 series: C # App Control Basics 2