小编r2d*_*igo的帖子

在XAML中使用Xamarin.Forms.Behaviors会在iOS中导致TargetInvocationException,但在Android中不会

我正在做一个Xamarin.Forms应用程序,我需要使用行为。我已经将Xamarin.Forms.Behaviors包添加到项目中,并且将行为添加到一页的XAML中,因此在选择ListView更改时将执行命令:

<b:Interaction.Behaviors>
    <b:BehaviorCollection>
        <b:EventToCommand Command="{Binding ItemSelectedCommand}" EventName="ItemSelected" />
    </b:BehaviorCollection>
</b:Interaction.Behaviors>
Run Code Online (Sandbox Code Playgroud)

这在Android上很好用,但TargetInvocationException在iOS下导航到同一页面时,同一项目会抛出。是什么原因造成的?

xaml xamarin.ios xamarin xamarin.forms

0
推荐指数
1
解决办法
336
查看次数

标签 统计

xamarin ×1

xamarin.forms ×1

xamarin.ios ×1

xaml ×1