Corcav.Behaviors icon indicating copy to clipboard operation
Corcav.Behaviors copied to clipboard

CurrentPageChanged event crashed the XF app

Open dbeylkhanov opened this issue 8 years ago • 1 comments

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:

image

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>

dbeylkhanov avatar Dec 20 '16 22:12 dbeylkhanov

+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>

Goncharuk-Nikita avatar Mar 19 '18 10:03 Goncharuk-Nikita