Please see the code below:
public partial class MyContentPage : ContentPage
{
public CreditCardView()
{
InitializeComponent();
}
}
It works as expected. Now say I want to inject a dependancy:
public partial class MyContentPage : ContentPage
{
private readonly IMyService _myService;
public CreditCardView(IMyService myService)
{
InitializeComponent();
_myService=myService;
}
}
With the second excerpt of code I see a compilation error: "The given key was not present in the dictionary". What is the problem? I have registered the dependancy.