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

Help Me whit a Binding to List View

$
0
0

i need binding in a list view but, y cant, can i help me?

`

                    <StackLayout Grid.Row="0" Grid.Column="0">
                        <!--<Image Source="icoR.png"/>-->
                    </StackLayout>
                    <Frame Grid.Row="0" Grid.Column="1">
                        <StackLayout>
                            <StackLayout Orientation="Horizontal" Spacing="25">
                                <StackLayout Orientation="Horizontal">
                                    <Label Text="{Binding Name}"/>
                                </StackLayout>
                                <StackLayout Orientation="Horizontal">
                                    <Label Text="Habitacion"/>
                                    <Label Text="{Binding Room}"/>
                                </StackLayout>
                                <StackLayout Orientation="Horizontal">
                                    <Label Text="Codigo"/>
                                    <Label Text="{Binding Code}"/>
                                </StackLayout>
                                <StackLayout Orientation="Horizontal">
                                    <Label Text="Estancia"/>
                                    <Label Text="{Binding Stay}"/>
                                </StackLayout>
                            </StackLayout>

                            <StackLayout Orientation="Horizontal" Spacing="25">
                                <StackLayout Orientation="Horizontal">
                                    <Label Text="Adultos"/>
                                    <Label Text="{Binding Adult}"/>
                                </StackLayout>
                                <StackLayout Orientation="Horizontal">
                                    <Label Text="Menores"/>
                                    <Label Text="{Binding Kid}"/>
                                </StackLayout>
                                <StackLayout Orientation="Horizontal">
                                    <Label Text="Noches"/>
                                    <Label Text="{Binding Name}"/>
                                </StackLayout>
                            </StackLayout>
                        </StackLayout>
                    </Frame>
                </Grid>

                            </ViewCell.View>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
            </StackLayout>
         </Frame>

         <StackLayout Orientation="Horizontal" Spacing="10">
            <Button Text="Cerrar" BackgroundColor="#CB2026" HorizontalOptions="FillAndExpand"/>
            <Button Text="Siguiente" Clicked="OnNextButtonClicked" BackgroundColor="#2980B9" HorizontalOptions="FillAndExpand"/>
        </StackLayout>
</StackLayout>`

and its code behind

`public CheckIn ()
{
InitializeComponent ();
SearchEntry.Placeholder = "Search Check In";
}

    protected override void OnAppearing()
    {
        List<CheckIns> Check = new List<CheckIns> {
            new CheckIns {Name = "Francisco Salas Santos", Room = 5225, Code = "i23242j",
                Stay = DateTime.Now.ToString ("yy-MM-dd") + "-" + DateTime.Now.AddDays (3).ToString ("yy-MM-dd"),
                Adult = 2, kid = 0, Night = 2
            },

            new CheckIns {Name = "Enrique Nuñez Rodriguez", Room = 1324, Code = "i3456a",
                Stay = DateTime.Now.ToString ("yy-MM-dd") + "-" + DateTime.Now.AddDays (6).ToString ("yy-MM-dd"),
                Adult = 3, kid = 2, Night = 5
            },

            new CheckIns {Name = "Roberto Silos Robles", Room = 6446, Code = "q1423e",
                Stay = DateTime.Now.ToString ("yy-MM-dd") + "-" + DateTime.Now.AddDays (7).ToString ("yy-MM-dd"),
                Adult = 5, kid = 0, Night = 4
            }
        };
    }

    async void OnNextButtonClicked(object sender, EventArgs args)
    {
        await App.Navigation.PushAsync (new ViewCheckIn ());
    }`

Missing something?

thanks you


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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