I need to create a website “launcher” application for Windows Phone 7.
Basically, it only has to be an icon in the application list, that opens the webbrowser and loads a url given within the application.
I am completely ignorant about microsoft dev… I’m a php/java developer and had so far nearly succeeded in avoiding any contact with microsoft products/languages… 🙂 So please be kind.
I installed the microsoft dev tools and got the sample “Mini-Browser” from here (bottom of the list):
http://msdn.microsoft.com/en-us/library/ff431744(v=vs.92).aspx
This does pretty much exactly what I want, except I dont want a text box and a go button.
I just want to open the browser with a specific url and that’s it, then the user can navigate through the site…
I removed the textbox and button, but I can’t find a way to load the url (or in this case to call the button1_Click function) automatically, I’m looking for something like “onLoad” in html, for this xaml tag: (line26)
<phone:WebBrowser HorizontalAlignment="Stretch" Name="webBrowser1" VerticalAlignment="Stretch" Width="Auto" />
So what I want is that when this tag is loaded, it fires the function from MainPage.xaml.cs…
Can someone help?
In your MainPage.xaml.cs you can add the following line to the constructor:
Then in the handler:
You may need to give the browser a name using the
x:Name="MyBrowser"attribute in the XAML and then you can just sayMyBrowser.Navigate()…