点击图像,然后指向IE中的url

本文关键字:IE 中的 url 然后 图像 | 更新日期: 2023-09-27 18:10:57

Windows Phone 8 App

在我的主页。我有以下内容:

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

我想让用户点击这个,然后在IE8中打开一个网站。

在我的mainpage . xml .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)
        {
        }
    }
}  

.............

我是新手,所以我真的很想得到一些帮助,让我的第一个应用程序在测试版。

点击图像,然后指向IE中的url

试试这个:

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();
        }