【问题标题】:Click Image which then directs to a url in IE单击图像,然后指向 IE 中的 url
【发布时间】:2014-07-02 14:14:25
【问题描述】:

Windows Phone 8 应用

在我的 MainPage.xaml 中,我有以下内容:

<Image HorizontalAlignment="Left" Height="215" VerticalAlignment="Top" Width="450" Margin="10,299,-40,0" Source="/Assets/Images/MTCOB.jpg"/>

我想要的是用户点击它,然后在 IE8 中打开一个网站。

在我的 MainPage.xmal.cs 中,我有以下内容:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using GamesWithGold.Resources;
using Microsoft.Phone.Tasks;
using System.Windows.Interop;

namespace GamesWithGold
{
    public partial class MainPage : PhoneApplicationPage
    {

        public MainPage()
        {
            InitializeComponent();
        }

        private void Image_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {

        }

    }
}  

......

我是这方面的新手,所以非常希望有人帮助我将我的第一个应用程序推出测试版。

【问题讨论】:

标签: c# xaml windows-phone-8


【解决方案1】:

试试这个:

private void Image_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            WebBrowserTask BrowserTask = new WebBrowserTask();
            BrowserTask.Uri = new Uri("http://www.google.com",UriKind.Absolute);
            BrowserTask.Show();
        }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多