I'm using the WebView control in a Metro app. I'd like to implement a "Back" button function, but can't seem to locate an inbuilt one. Can anyone tell me if there is one, or do I need to roll my own (admittedly not the most complex coding task, but I don't want to reinvent the wheel)?
0
votes
3 Answers
1
votes
1
votes
The suggested code works. Here it is more complete:
in the xaml
<Button Content="Back" HorizontalAlignment="Left" Margin="580,98,0,0" VerticalAlignment="Top" Click="Button_Click_1"/>
in the xaml.cs
private void Button_Click_1(object sender, RoutedEventArgs e)
{
webView.InvokeScript("eval", new[] { "history.go(-1)" });
}