Morning all,
I am working on a little crossplatform webview project in Xamarin.Forms. I have the webview working but I want to add in a toolbar which has a Back and Forward buttons.
I tried a number of different ways but nothing seems to be working particularly well. I tried to implement this feature by following this guys post Navigation Toolbar
I will attach my code below and if someone could give me a hand with this or a solution that would be great!
And if this question has already been answered previously by another user then I apologize.
App.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xamarin.Forms;
namespace DisplayWebPage
{
public class App : Application
{
public App()
{
// The root page of your application
MainPage = new WebPage();
}
protected override void OnStart()
{
// Handle when your app starts
}
protected override void OnSleep()
{
// Handle when your app sleeps
}
protected override void OnResume()
{
// Handle when your app resumes
}
}
}
WebPage.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using Xamarin.Forms;
namespace DisplayWebPage
{
public class WebPage : ContentPage
{
public WebPage()
{
Content = new StackLayout
{
Children = {
new WebView
{
Source = "http://www.google.com"
}
}
};
}
}
}
Looking forward to getting an answer to this as ive been stuck on it for quite awhile now.
Kind regards