Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Corcav.Behaviors - EventToCommand does not work on release mode on android

$
0
0

Hi,
I have a Xamarin.Forms project composed by a PC librairy and 3 platform projects.
On a listview, I put an EventToCommand to the event ItemTapped

<ListView Grid.Row="1" ItemsSource="{Binding ModulesData.Modules}" SelectedItem="{Binding SelectedModule, Mode=TwoWay}" BackgroundColor="Transparent" RowHeight="100">
      <behaviors:Interaction.Behaviors>
        <behaviors:BehaviorCollection>
          <behaviors:EventToCommand EventName="ItemTapped"
                            Command="{Binding GoToDetailCommand}" />
        </behaviors:BehaviorCollection>
      </behaviors:Interaction.Behaviors>

It's work fine in iOS, WIndows Phone and Android in debug mode.
This code doesn't not work on Android with the release mode.

I launched adb logcat to get what's going on, and I got:

`E/mono-rt ( 1273): at System.Linq.Expressions.Expression.CreateLambda (System.Type,System.Linq.Expressions.Expression,string,bool,System.Collections.ObjectModel.ReadOnlyCollection'1<System.Linq.Expressions.ParameterExpression>) <0x0028b>

E/mono-rt ( 1273): at System.Linq.Expressions.Expression.Lambda (System.Type,System.Linq.Expressions.Expression,string,bool,System.Collections.Generic.IEnumerable'1<System.Linq.Expressions.ParameterExpression>) <0x0004f>

E/mono-rt ( 1273): at System.Linq.Expressions.Expression.Lambda (System.Type,System.Linq.Expressions.Expression,System.Collections.Generic.IEnumerable'1<System.Linq.Expressions.ParameterExpression>) <0x0001b>

E/mono-rt ( 1273): at Corcav.Behaviors.EventToCommand.AddEventHandler (System.Reflection.EventInfo,object,System.Action) <0x0016b>

E/mono-rt ( 1273): at Corcav.Behaviors.EventToCommand.OnAttach () <0x00183>

E/mono-rt ( 1273): at Corcav.Behaviors.Behavior.Attach (Xamarin.Forms.BindableObject) <0x0003a>

E/mono-rt ( 1273): at Corcav.Behaviors.Interaction.OnBehaviorsChanged (Xamarin.Forms.BindableObject,object,object) <0x0020f>

E/mono-rt ( 1273): at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty,Xamarin.Forms.BindableObject/BindablePropertyContext,object,bool,Xamarin.Forms.BindableObject/SetValueFlags,bool) <0x00208>

E/mono-rt ( 1273): at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty,object,Xamarin.Forms.BindableObject/SetValueFlags,Xamarin.Forms.BindableObject/SetValuePrivateFlags) <0x00423>

E/mono-rt ( 1273): at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty,object,bool,bool) <0x0011b>

E/mono-rt ( 1273): at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty,object) <0x0001b>

E/mono-rt ( 1273): at Xamarin.Forms.Xaml.ApplyPropertiesVisitor.SetPropertyValue (object,Xamarin.Forms.Xaml.XmlName,object,Xamarin.Forms.BindableObject,Xamarin.Forms.Xaml.INode,Xamarin.Forms.Xaml.HydratationContext,System.Xml.IXmlLineInfo) <0x00a4b>

E/mono-rt ( 1273): at Xamarin.Forms.Xaml.ApplyPropertiesVisitor.Visit (Xamarin.Forms.Xaml.ElementNode,Xamarin.Forms.Xaml.INode) <0x00af3>

E/mono-rt ( 1273): at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor,Xamarin.Forms.Xaml.INode) <0x0018b>

E/mono-rt ( 1273): at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor,Xamarin.Forms.Xaml.INode) <0x000c4>

E/mono-rt ( 1273): at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor,Xamarin.Forms.Xaml.INode) <0x0012d>

E/mono-rt ( 1273): at Xamarin.Forms.Xaml.RootNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor,Xamarin.Forms.Xaml.INode) <0x0012d>

E/mono-rt ( 1273): at Xamarin.Forms.Xaml.XamlLoader.Load (Xamarin.Forms.BindableObject,string) <0x00349>

E/mono-rt ( 1273): at Xamarin.Forms.Xaml.XamlLoader.Load (Xamarin.Forms.BindableObject,System.Type) <0x00047>

E/mono-rt ( 1273): at Xamarin.Forms.Xaml.Extensions.LoadFromXaml<MyApp.Views.MainView> (MyApp.Views.MainView,System.Type) <0x00017>

E/mono-rt ( 1273): at MyApp.Views.MainView.InitializeComponent () <0x0001f>

E/mono-rt ( 1273): at MyApp.Views.MainView..ctor () <0x00023>`

I use the lattest Corcav.Behaviors (2.0.0.0) and Xamarin.Forms (1.3.5.0)

Any idea ?
Thanks !!!


Viewing all articles
Browse latest Browse all 58056

Trending Articles