0

Windows Phone 8 App

In my MainPage.xaml I have the following:

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

What I want is for the user to tap this and then a website open in IE8.

In my MainPage.xmal.cs I have the following:

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)
        {

        }

    }
}  

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

I am new to this so would really like some help getting my first app out in BETA.

Keith K
  • 129
  • 9
  • check this link http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.tasks.webbrowsertask%28v=vs.105%29.aspx you can create a instance of WebBrowsertask and assign a URI property to it – Karthik Ganesan Jul 01 '14 at 19:57
  • check this http://stackoverflow.com/questions/14191793/wp7-how-do-i-hide-or-remove-header-div-for-web-page – PEO Jul 01 '14 at 20:03
  • Just throw it in a [HyperlinkButton](http://msdn.microsoft.com/en-us/library/windowsphone/develop/system.windows.controls.hyperlinkbutton(v=vs.105).aspx) – Chris W. Jul 01 '14 at 20:16

1 Answers1

0

Try this:

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();
        }
Amit Bhatiya
  • 2,621
  • 1
  • 12
  • 20