Namespaces
Variants
Actions
Revision as of 08:39, 30 November 2012 by hamishwillee (Talk | contribs)

Tile to Link 的实现方法

Jump to: navigation, search
WP Metro Icon Chinese.png
文章信息

代码示例
文章
renlin 在 23 Oct 2012 创建
最后由 hamishwillee 在 30 Nov 2012 编辑

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

相关链接

136 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved