的Windows Phone7:打开按钮,点击网页? [英] Windows phone7: Open a webpage on button click?

查看:93
本文介绍了的Windows Phone7:打开按钮,点击网页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是搜查,但没有找到一种方法来创建在我的Windows Phone7应用程序的Web链接。在Android中的TextView有的android:自动链接=网页在Windows Phone7的文字块,我没有找到任何有关财产。

I just searched, but didn't find a way to create a web link in my Windows phone7 Application. In Android TextView has android:autoLink='Web' In Windows phone7 textblock I didn't find any relevant property.

尝试添加了超链接的NavigateURI财产,它提供了一个例外。 NavigateUri =http://www.google.com

Tried adding the NavigateURI property in the Hyperlink and it gives an exception. NavigateUri="http://www.google.com"

很感激,如果有人建议可以怎么做这个。在此先感谢... !!!!!

Really appreciate If someone Can suggest How to do this. Thanks in Advance...!!!!!

推荐答案

使用只是HyperLinkBut​​ton控制。

Use just the HyperLinkButton Control.

和这个属性添加到您的控制:

And add this property to your control:

<HyperlinkButton TargetName="_blank" Content="Go To" Click="HyperlinkButton_Click"/>



最后添加单击事件处理程序使用BrowserTask启动浏览器:

Finally add the click event handler to launch the browser using the BrowserTask :

 private void HyperlinkButton_Click(object sender, RoutedEventArgs e)
 {
     WebBrowserTask webBrowserTask = new WebBrowserTask();
     webBrowserTask.Uri = new Uri("http://www.google.com");
     webBrowserTask.Show();
 }

这篇关于的Windows Phone7:打开按钮,点击网页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆