It's mixed views in a Frame, the Frame's command binding suppose to use view model itself as the parameter.
However, following code gave me error of "Exception has been thrown by the target of an invocation" at runtime.
var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.SetBinding<ViewModel>( TapGestureRecognizer.CommandProperty, x => x.TapCommand ); tapGestureRecognizer.SetBinding<ViewModel>( TapGestureRecognizer.CommandParameterProperty, x => x ); // This line causes error when page renders. GestureRecognizers.Add( tapGestureRecognizer );
Thanks in advance.