How to create login form using XAML in WPF and redirect to another page?
Loading
How to create login form using XAML in WPF and redirect to another page?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit MohantyRank #112 · 20K reputationPosted Feb 12, 2024, 12:34 AM EST
Please review the following articles.
https://medium.com/@mpcodes/how-to-create-a-login-layout-using-wpf-xaml-c5261fbef534
https://www.c-sharpcorner.com/UploadFile/prathore/login-and-registration-process-in-wpf-application/
https://www.c-sharpcorner.com/UploadFile/0c1bb2/login-form-in-wpf-application-using-Asp-Net-C-Sharp/
https://stackoverflow.com/questions/6622408/to-redirect-from-one-page-to-another-page-in-wpf
Jayraj ChhayaRank #304 · 8.2K reputationPosted Feb 12, 2024, 1:32 AM EST
To create a login form in WPF using XAML and redirect to another page, you can follow these steps:
private void LoginButton_Click(object sender, RoutedEventArgs e) { // Validate user credentials if (IsValidUser()) { // Create an instance of the target page TargetPage targetPage = new TargetPage(); // Set the target page as the MainWindow's content Application.Current.MainWindow.Content = targetPage; } else { // Show an error message MessageBox.Show("Invalid credentials. Please try again."); } }