I Have a Login ViewModel something like this below
public class LoginViewModel : ViewModelBase
{
private readonly IAuthenticationService _authenticationService;
public LoginViewModel(IAuthenticationService authenticationService)
{
_authenticationService = authenticationService;
}
}
And i'm Binding like this in XAML
<ContentPage.BindingContext>
<viewModels:LoginViewModel />
</ContentPage.BindingContext>
When i Compile i'm getting "Given Key Not Present in Dictionary"
But when i add an Empty Constructor to My ViewModel like this
public LoginViewModel ()
{
}
It working fine ,so is there any workaround for this other than instantiating from Code behind of my ViewPage ?