Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Pin items in a CollectionView

BigMuchachoBigMuchacho Member ✭✭
edited October 15 in Xamarin.Forms

I am building something and want to pin items in a collectionview. I can't seem to get the events to get trapped by the image, the collectionview gets them. I am assuming there is a z order where another object is catching the event. I believe this is the collectionview itself but I'm not sure.

    <ContentView x:Name="cv_Notes_Detail" >
            <StackLayout>
                <!--<RefreshView IsRefreshing="{Binding IsBusy, Mode=OneWay}" Command="{Binding lv_Search_Command}">-->
                <CollectionView  x:Name="lv_Notes_Detail" SelectionChanged="CollectionView_SelectionChanged" ItemsSource="{Binding go_Note_List}" SelectionMode="Single"  WidthRequest="1000" ItemsLayout="VerticalList" >
                    <CollectionView.ItemTemplate>
                        <DataTemplate>
                            <SwipeView>
                                <SwipeView.LeftItems>
                                    <SwipeItems SwipeBehaviorOnInvoked="Close" Mode="Reveal">
                                        <SwipeItem Text="Pin" 
                                            IconImageSource="pushpin_126.png"
                                            BackgroundColor="#F5FAF5"                        
                                            Invoked="Notes_Pin" />

                                        <SwipeItem 
                                           IconImageSource="question_126.png"
                                           BackgroundColor="#F5FAF5"
                                           CommandParameter="{Binding .}"
                                           Invoked="Notes_Help"/>
                                    </SwipeItems>
                                </SwipeView.LeftItems>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>

                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="20"></RowDefinition>
                                        <RowDefinition></RowDefinition>
                                    </Grid.RowDefinitions>

                                    <Image Margin="5,0,0,0" Source="vert_hollow_pin_16.png" BackgroundColor="#F1F1F1"  HeightRequest="16" HorizontalOptions="Start" InputTransparent="True">
                                        <Image.GestureRecognizers>
                                            <TapGestureRecognizer Tapped="Notes_Pin"/>
                                        </Image.GestureRecognizers>



                                    </Image>
                                    <Label Margin="21,0,0,0" Padding="5,0,0,0" Text="{Binding oc_Date}" BackgroundColor="#F1F1F1" FontAttributes="Bold" FontSize="14" HorizontalOptions="Start" WidthRequest="85"  />
                                    <Label Margin="106,0,0,0" Padding="5,0,5,0" Text="{Binding oc_Header}" BackgroundColor="#F1F1F1" FontAttributes="Bold" FontSize="14"/>

                                    <Label Grid.Row="1" Grid.Column="0" Margin="5,0,5,10" Text="{Binding oc_Note}" FontSize="12"/>

                                </Grid>
                            </SwipeView>
                        </DataTemplate>
                    </CollectionView.ItemTemplate>
                </CollectionView>
                <!--</RefreshView>-->
            </StackLayout>
        </ContentView>
    </ContentPage>

Thanks.

Sign In or Register to comment.