I'm developing and app with Xamarin and I'm trying to follow this guide in order to implement and interface for Xamarin Forms for UWP.
So I wrote in PCL this interface:
namespace MyApp {
public interface ISimplePdfLoader {
void OpenLocal(string uri);
void Load(object pdfDoc);
}
}
and in MyApp.UWP I created a class:
[assembly: Dependency(typeof(SimplePdfLoader))]
namespace MyApp.UWP {
public class SimplePdfLoader : ISimplePdfLoader {
public async void OpenLocal(string uri) {
...
Load(doc);
}
public async void Load(object pdfObj) {
...
}
}
}
}
But it continues to show the error CS7036 No arguments matching the mandatory formal parameter 'loadHintArgument' of 'DependencyAttribute.DependencyAttribute (string, LoadHint)' were specified MyApp.UWP C:\Users...\workspace\my-app\MyApp\MyApp.UWP\SimplePdfLoader.cs 19
and I can not compile the project.
edit: The error is show underlying the line [assembly: Dependency(typeof(SimplePdfLoader))]
Remove the below line from top usings section
using System.Runtime.CompilerServices;
and add the below
using Xamarin.Forms;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With