Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

can't access to controls into XAML ListView ??

$
0
0

Hi everyone,
I have a strange issue with xamarin forms, which is tha I can't access to some controls into a xaml ListView. This is my code:

`

    <ListView x:Name="VehiclesListView" HasUnevenRows="True" ItemSelected="VehiclesListView_OnItemSelected" >
        <ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                    <StackLayout Orientation="Horizontal" Padding="5">
                        <Image Source="{Binding ImageSource}"/>
                        <StackLayout>
                            <Label x:Name="VehicleName_Label" Text="{Binding Name}" FontAttributes="Bold"/>
                            <Label x:Name="VehicleRN_Label" Text="{Binding RegistrationNumber}" TextColor="Gray"/>
                        </StackLayout>
                    </StackLayout>
                    <ViewCell.ContextActions>
                        <MenuItem Text="Call"/>
                        <MenuItem Text="Delete" IsDestructive="True"/>
                    </ViewCell.ContextActions>
                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>
</StackLayout>`

In my code behind I can't access neither to VehicleName_Label nor to VehicleRN_Label !!
error message : the Name VehicleName_Label does not exist in the current context.
Any suggestion plz?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>