×
Namespaces

Variants
Actions

Tile to Link 的实现方法

From Nokia Developer Wiki
Jump to: navigation, search
WP Metro Icon UI.png
SignpostIcon XAML 40.png
SignpostIcon WP7 70px.png
Article Metadata

代码示例
兼容于
文章
renlin 在 23 Oct 2012 创建
最后由 hamishwillee 在 02 Jul 2013 编辑

Introduction

某些场合下,我们需要在开始屏幕或应用列表中让用户通过Tile进入网页。

实现方法

  1. 在Mainpage构造函数中添加Load事件的处理方法:
     public MainPage()
    {
    InitializeComponent();
    ...
    Loaded += new RoutedEventHandler(MainPage_Loaded);
    ...
    }
  2. 在Load事件的处理方法中用WebBrowerTask显示网页内容:
    void MainPage_Loaded(object sender, RoutedEventArgs e)
    {
     
    WebBrowserTask wbt = new WebBrowserTask();
    wbt.Uri = new Uri("http://www.developer.nokia.com",UriKind.Absolute);
    wbt.Show();
     
    }
  3. 最后在WMAppManifest.xml中添加相应的Tile图片和Icon图片,加入在Tile中显示的应用程序名称。

代码示例:File:IconLinkTest.zip

相关链接

This page was last modified on 2 July 2013, at 14:06.
149 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×