daniel-luberda / DLToolkit.Forms.Controls

Xamarin.Forms Custom Controls
Apache License 2.0
393 stars 182 forks source link

FlowItemTappedCommand get trigged twice #233

Open JoacimWall opened 6 years ago

JoacimWall commented 6 years ago

i get strange behaviour first i trigger and i get the selected item. then i trigger once for a outer item in the list that i did't tapped.
//Binding <flv:FlowListView Margin="0,10,0,0" x:Name="PhotoBookFlowListView" Grid.Row="5" Grid.ColumnSpan="3" Grid.RowSpan="2" BackgroundColor="Transparent" FlowColumnCount="2" SeparatorVisibility="Default" HasUnevenRows="true" FlowItemTappedCommand="{Binding ListItemSelectCommand}" FlowLastTappedItem="{Binding LastTappedItem}" FlowItemsSource="{Binding CurrentPhotoBook.Pages}">

//ViewModel public ICommand ListItemSelectCommand => new Command(InitListItemSelectCommand); private void InitListItemSelectCommand(object e) { if (e == null) return; if (IsBusy) return; var selectPage = (ApiService.ResponseModels.Page)e; if (!selectPage.IsMilestone) return; var mileStone = CurrentPhotoBook.Milestones.FirstOrDefault(x => x.Id == selectPage.Id); mileStone.FamilyMemberProfileId = CurrentPhotoBook.FamilyMemberProfileId; if (!mileStone.Used) { FirebasAnalytics.LogEvent(FireBaseAnalyticsEvents.EventPhotoBookCreateMileStone); NavigationService.NavigateToAsync(mileStone); } }