2
I am too young for WPF I am doing a project using MVVM and Entity Framework and it has been suggested not to have any event Click
to a button in the code behind a window, for what reason? What is the alternative to replace the below event without breaking the suggested rules?
private void Button_Click(object sender, RoutedEventArgs e)
{
WindowMenuPrincipal wmp = new WindowMenuPrincipal();
wmp.ShowDialog();
}
Can quote references?
– vinibrsl
https://blog.magnusmontin.net/2013/03/24/custom-authorization-in-wpf/
– Felipe Vieira
the article talks about
authorization
, where exactly you say there should be no event ?– Rovann Linhalis
This previously informed article was given in response to how to use wpf with mvvm without using events, but it was not justified why the event could not be used. Follow the original link for further clarification https://social.msdn.microsoft.com/Forums/vstudio/en-US/72d4eced-f3b8-4898-a7ff-5f8f6e763f0e/wpf-and-mvvm-with-login-authentication?forum=wpf Where it reads "suggested not to have any Click Events"
– Felipe Vieira
Eu sou muito novo para o WPF
But you’re wise beyond your years, so don’t give up.– Oralista de Sistemas
Here’s another question with an example
– Bruno Costa