How to resolve the CS1061 error in the code below: Code to open a local webview on each Xamarin.Forms platform
public partial class MapViewDetail : ContentPage
{
public interface IBaseUrl { string Get(); }
public MapViewDetail()
{
InitializeComponent();
var urlSource = new UrlWebViewSource();
string url = DependencyService.Get<IBaseUrl>().BaseUrl();
string TempUrl = Path.Combine(url, "mapas.html");
urlSource.Url = TempUrl;
Browser.Source = urlSource;
}
}
[assembly: Xamarin.Forms.Dependency(typeof(BaseUrl))]
namespace AppFrete.UWP
{
public class BaseUrl : IBaseUrl
{
public string Get()
{
return "ms-appx-web:///";
}
}
}
Displayed Error
Severity Code Description Project File Line Suppression State Error CS1061 'MapViewDetail.IBaseUrl' does not contain a definition for 'BaseUrl' and no extension method 'BaseUrl' accepting a first argument of type 'MapViewDetail.IBaseUrl' could be found (are you missing a using directive or an assembly reference?) AppFrete C: \ Users \ vinic \ source \ repos \ AppFrete \ MapMVC \ AppFrete \ AppFrete \ View \ Map \ MapViewDetail.xaml.cs 28 Active