The Command
is coming from the page's ViewModel, whereas the CommandParameter
from the data that is passed to the DataTemplate
. Therefore, I can't just set x:DataType on TapGestureRecognizer, because the parameters have different contexts. Does anyone know how to solve this?
\n\n@MitchBomcanhao the missing knowledge how to do that! would you be so kind to show me an example?
\n
I'd just do something like
\n<TapGestureRecognizer Command=\"{Binding BindingContext.AutomationSelectedCommand, Source={x:Reference Page}}, x:DataType=morestuff:heretoo\"\n CommandParameter=\"{Binding ., x:DataType=stuff:here}\" />\n
that's how it is working on my app
","upvoteCount":0,"url":"https://github.com/dotnet/maui/discussions/30374#discussioncomment-13660344"}}}-
I get lots of compiler warnings for not setting x:DataType on my TapGestureRecognizers.
The |
Beta Was this translation helpful? Give feedback.
-
what is stopping you from defining the datatype directly inside the Command or CommandParameter declarations? |
Beta Was this translation helpful? Give feedback.
I'd just do something like
that's how it is working on my app