Windows 8.1 新增控件之 Hyperlink
2014-03-08 15:01
281 查看
原文:Windows 8.1 新增控件之 HyperlinkHyperlink 控件应该不用过多介绍大家肯定十分清楚其作用,它的功能就像HTML中的<a href=””>标签一样,只不过是在XAML中实现。
使用Hyperlink 标记的文字在应用中会以特殊颜色显示,当用户点击或触碰该文字时就会自动转到NavigateUri 指向的地址链接。如下代码所示:
我们把段落中一句文字用NavigateUri 指向特定网站链接,链接颜色默认显示为紫色,可以用Foreground 属性调整颜色。
点击Hyperlink 后应用会打开网页,如下图所示:
关于Hyperlink 的其他属性可参考:
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.documents.hyperlink.aspx
使用Hyperlink 标记的文字在应用中会以特殊颜色显示,当用户点击或触碰该文字时就会自动转到NavigateUri 指向的地址链接。如下代码所示:
<TextBlock FontSize="50" FontWeight="Bold">Getting started tutorials for Windows</TextBlock> <TextBlock FontSize="25" FontWeight="Bold">New to Windows 8.1 or Windows RT 8.1?</TextBlock> <RichTextBlock FontSize="30" Width="800" HorizontalAlignment="Left"> <Paragraph> You're at the right place. Whether you're brand new to Windows 8.1 or Windows RT 8.1, or just want a refresher, <Hyperlink NavigateUri="http://windows.microsoft.com/en-us/windows/how-to?ocid=GA8-1_O_WOL_Hero_Home_HowTo_Pos2_01"> these 10 tutorials will show you the basics.</Hyperlink> </Paragraph> </RichTextBlock>
我们把段落中一句文字用NavigateUri 指向特定网站链接,链接颜色默认显示为紫色,可以用Foreground 属性调整颜色。
点击Hyperlink 后应用会打开网页,如下图所示:
关于Hyperlink 的其他属性可参考:
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.documents.hyperlink.aspx
相关文章推荐
- Windows 8.1 新增控件之 Hyperlink
- 重新想象 Windows 8.1 Store Apps (75) - 新增控件: Hub, Hyperlink
- 重新想象 Windows 8.1 Store Apps (75) - 新增控件: Hub, Hyperlink
- Windows 8.1 新增控件之 CommandBar
- Windows 8.1 应用再出发 (WinJS) - 几种新增控件(2)
- 重新想象 Windows 8.1 Store Apps (72) - 新增控件: AppBar, CommandBar
- Windows 8.1 新增控件之 TimePicker
- Windows 8.1 应用再出发 - 几种新增控件(2)
- Windows 8.1 应用再出发 - 几种新增控件(1)
- Windows 8.1 新增控件之 AppBar
- Windows 8.1 应用再出发 (WinJS) - 几种新增控件(1)
- Windows 8.1 新增控件之 DatePicker
- Windows 8.1 应用再出发 - 几种新增控件(2)
- Windows 8.1 新增控件之 CommandBar
- 重新想象 Windows 8.1 Store Apps (76) - 新增控件: SearchBox
- 重新想象 Windows 8.1 Store Apps (73) - 新增控件: DatePicker, TimePicker
- Windows 8.1 新增控件之 MenuFlyout
- Windows 8.1 新增控件之 DatePicker
- Windows 8.1 新增控件之 Flyout
- 重新想象 Windows 8.1 Store Apps (72) - 新增控件: AppBar, CommandBar