I'd like to call a method that is located in a class LoginViewModel but it is inacessible. How can I render it accessible from the Login.xaml.cs code behind so that i can call the Connexion() method ?
Login.xaml
<Button StyleId="btn_connexion" Text="Connexion" Clicked="Connexion_click" /> Login.xaml.cs
private void Connexion_click(object sender, EventArgs e) { //here is where i'd like to call the connexion method } LoginViewModel.cs
public async Task Connexion() { List<Visiteur> listeTest = CreerListeVisiteurDur(); if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password)) { foreach (Visiteur unVisiteur in listeTest) { string login = unVisiteur.login; string pass = unVisiteur.mdp; if (login == username && pass == password) { App.Current.MainPage = new CreerVisite(); } } }