2
I’m studying C# and I’m having to develop a WPF application with the MVVM standard. One question I have about this pattern is in relation to events, I have read in some places that it is not recommended to use events and also that we can not access components directly, through viewmodel.
But there are situations that we really need to access elements of the view, for this I created an interface containing the methods I need, implement it in the view and connect it to viewmodel. So I don’t access the elements directly, this would be a good solution?
// interface
public interface IWindowServices
{
void ToggleWindow();
void MinimizeWindow();
void ExitWindow();
}
What about the events, should I really avoid? I am in a situation where I need to allow the click 2x on a view element, its properties to change...