I have a c# Application where I call a user control with a click event. This user control provides the authentication to a MySQL database.
I dont want them to be able to use any of the other controls if they did not authenticate.
How can I make the rest of the Application aware that this user is authenticated. Can I somehow set a property in the main window ?
You could
bindtheIsEnabled(or similar) properties of the controls to anIsAuthenticatedProperty of the Window / ViewModel. This would be the simplest because then you don’t have to manually set the properties and just set theIsAuthenticatedvalue to true / false.The other option would be to manually set all of the IsEnabled to true / false depending on if authentication worked.