I am creating login functionality and I need to send my information of user from my xaml.cs to my ViewModels SO when I am clicking on the button I to need show other window with my data
How can I do that
My Click function from LoginPage.xaml.cs
private void LoginButton_OnClick(object sender, RoutedEventArgs e)
{
LoginPageViewModels ViewModel = new LoginPageViewModels();
SqlHelper Sql = new SqlHelper();
string ConnectionState = Sql.SqlConnectionState();
// Check connection;
if (ConnectionState == "Connected")
{
List<User> User = new List<User>();
string username = UsernameInput.Text;
string password = PasswordInput.Password;
User = ViewModel.Auth(username, password);
if (User.Count >= 1)
{
MainPage mainPage = new MainPage();
mainPage.Show();
this.Close();
}
else
{
AuthResultMessage.Text = "User not found";
}
}
else
{
AuthResultMessage.Text = ConnectionState;
}
}
I need to send List<User> User
to my new MainPage mainPage
and then I need bind User to mainPage