Corcav.Behaviors
Corcav.Behaviors copied to clipboard
CurrentPageChanged event crashed the XF app
Hi @corcav
I have Tabbed page in my XF app
And If I attach behavior to CurrentPageChanged event, then my app at starting is crashes
See image with error below:
this is my xaml of tabbed page:
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:merchandise_app.Views;assembly=merchandise_app"
xmlns:mvvm="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
xmlns:behaviors="clr-namespace:Corcav.Behaviors;assembly=Corcav.Behaviors"
x:Class="merchandise_app.Views.MasterDetail">
<behaviors:Interaction.Behaviors>
<behaviors:BehaviorCollection>
<behaviors:EventToCommand EventName="CurrentPageChanged" Command="{Binding NavigateCommand}" CommandParameter="PageChanged" />
</behaviors:BehaviorCollection>
</behaviors:Interaction.Behaviors>
+1, it also crashed on CarouselPage:
<base:CarouselBasePage x:Class="MDOSchedule.UI.Pages.AllJobs.CarouselAllJobsWeekPage" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:b="clr-namespace:Corcav.Behaviors;assembly=Corcav.Behaviors" xmlns:base="clr-namespace:MDOSchedule.UI.Pages.Base;assembly=MDOSchedule" xmlns:templates="clr-namespace:MDOSchedule.UI.Templates;assembly=MDOSchedule" xmlns:week="clr-namespace:MDOSchedule.UI.Views.Week;assembly=MDOSchedule" x:Name="This" Title="{Binding CurrentDate, StringFormat='{0:MMMM}'}" ItemsSource="{Binding Weeks}">
<b:Interaction.Behaviors>
<b:BehaviorCollection>
<b:EventToCommand
CommandName="CurrentPageChangedCommand"
CommandNameContext="{b:RelativeContext This}"
EventName="CurrentPageChanged" />
</b:BehaviorCollection>
</b:Interaction.Behaviors>
</base:CarouselBasePage>