-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Why You put ViewModels folder in Core layer?
I am wondering how to achive clean architecture in my solution. I have projects: Core (Models, Messages, ViewModels), Mobile (Maui project), Shared (Dto projects). I have
<PanGestureRecognizer PanUpdated="PanGestureRecognizer_PanUpdated"/>
in my View, which I pass it to the ViewModel via:
private void PanGestureRecognizer_PanUpdated(object sender, PanUpdatedEventArgs e)
{
var panUpdatedCommand = ((MyViewModel)BindingContext).PanUpdatedCommand;
panUpdatedCommand.Execute(e);
}
Here I pass the EventArgs: PanUpdatedEventArgs which depends on Maui.
Then I can't use RelayCommand in MyViewModel like this:
[RelayCommand]
private void PanUpdated(PanUpdatedEventArgs e)
{
switch (e.StatusType)
{
case GestureStatus.Started:
...
case GestureStatus.Running:
...
case GestureStatus.Canceled:
...
case GestureStatus.Completed:
...
}
}
because PanUpdatedEventArgs and GestureStatus come from Maui library but my ViewModel should be independent due to clean architecture. How can I achive that?
Metadata
Metadata
Assignees
Labels
No labels