Windows 8.1 新增控件之 Hyperlink
生活随笔
收集整理的這篇文章主要介紹了
Windows 8.1 新增控件之 Hyperlink
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Windows 8.1 新增控件之 Hyperlink 原文:Windows 8.1 新增控件之 Hyperlink
Hyperlink 控件應該不用過多介紹大家肯定十分清楚其作用,它的功能就像HTML中的<a href=””>標簽一樣,只不過是在XAML中實現。
使用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
posted on 2014-03-08 15:01 NET未來之路 閱讀(...) 評論(...) 編輯 收藏轉載于:https://www.cnblogs.com/lonelyxmas/p/3587932.html
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的Windows 8.1 新增控件之 Hyperlink的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 九度 1474:矩阵幂(二分法)
- 下一篇: Gridview中实现求和统计功能