Prism icon indicating copy to clipboard operation
Prism copied to clipboard

TargetInvocationException using DelegateCommand on Xamarin.iOS

Open yarmenteros opened this issue 8 years ago • 4 comments

Description

There is any approach in order to use DelegateCommand implementation in a cross-platform app?

Basic Information

  • Xamarin.Forms version: 2.5.1.444934
  • IDE: VS 2017

Thank you in advance,

yarmenteros avatar Apr 26 '18 21:04 yarmenteros

You provided no information on your issue, or the required reproduction app, so I am closing this issue.

Yes, DelegateCommand should work on any NetStandard compatible project.

brianlagunas avatar Apr 26 '18 22:04 brianlagunas

what issue are you having? Can you fill out the issue in full with reproduction steps?

ChaseFlorell avatar Apr 26 '18 22:04 ChaseFlorell

I have a Xamarin project with iOS and in my ViewModel I have the following code using DelegateCommand. In Android works fine but in iOS I'm getting an TargetInvocationException. I took a look into the DelegateCommand's code and I saw that uses Reflection.

private DelegateCommand<string> _SideMenuTappedCommand; public DelegateCommand<string> SideMenuTappedCommand => _SideMenuTappedCommand ?? (_SideMenuTappedCommand = new DelegateCommand<string>(ExecuteSideMenuTappedCommand, CanExecuteSideMenuTappedCommand) .ObservesProperty(() => IsBusy));

I'm only using the commands implementation from prism.

Thanks

yarmenteros avatar Apr 26 '18 22:04 yarmenteros

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jan 29 '20 05:01 lock[bot]