XamarinCommunityToolkit: CameraView issue - EventToCommandBehavior: Couldn't resolve the event

Hello there, I’m using CameraView and EventToCommandBehavior to create some sort of a simple app that makes photos. But I’ve faced with the issue of using EventToCommandBehavior. When running app in Release mode on both android emulator and real device I do see the following error in Application Output:

[MonoDroid] UNHANDLED EXCEPTION: [MonoDroid] Android.Runtime.JavaProxyThrowable: Exception of type ‘Android.Runtime.JavaProxyThrowable’ was thrown. [MonoDroid] — End of managed Android.Runtime.JavaProxyThrowable stack trace — [MonoDroid] android.runtime.JavaProxyThrowable: System.ArgumentException: EventToCommandBehavior: Couldn’t resolve the event. [MonoDroid] Parameter name: EventName

The code itself isn’t that complicated:

<xct:CameraView
               x:Name="CameraView"
               BindingContext="{Binding CameraModel}"
               CameraOptions="{Binding CameraOption}"
               HorizontalOptions="FillAndExpand"
               VerticalOptions="FillAndExpand"
               CaptureMode="Photo">
               <xct:CameraView.Behaviors>
                   <xct:EventToCommandBehavior EventName="MediaCaptured" Command="{Binding CaptureCommand}" />
               </xct:CameraView.Behaviors>
</xct:CameraView>

The Environment is the latest one at this moment:

Visual Studio Community 2019 for Mac Version 8.10.3 (build 15) Installation UUID: c4debf69-38dc-430a-b7ff-71b5f73fb9f3 GTK+ 2.24.23 (Raleigh theme) Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

Package version: 612000140

Mono Framework MDK Runtime: Mono 6.12.0.140 (2020-02/51d876a041e) (64-bit) Package version: 612000140

Roslyn (Language Service) 3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb

NuGet Version: 5.9.0.7134

.NET Core SDK SDK: /usr/local/share/dotnet/sdk/5.0.301/Sdks SDK Versions: 5.0.301

Thanks in advance for helping!!

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 17 (10 by maintainers)

Most upvoted comments

Hi @workgroupengineering 1.3.0-pre2 was just released, please have a look 👍

Hi @workgroupengineering as I thought, 1.3.0-pre1 doesn’t have the fix, it’s merged into dev branch only.

Hi @workgroupengineering, what is the event that you are using? It would be great if you could add more info 👍 one more thing, I will need to double check, but I think the fix is not released yet.

@GUOLDEV I didn’t test either, for now, I’ll assume that issue is general

@pictos do you mean the sample code? If so, you can find it here.