ListView Binding Error

When i bind data to the listView and then run the application it show be error .
Xamarin.Forms.Xaml.XamlParseException: Position 10:14. Type StacKLayout not found in xmlns http://xamarin.com/schemas/2014/forms

below is my Code

public static ObservableCollection ProductList = new ObservableCollection() {
new ProductModel {ID=1, Name="Mobile", UnitCost=19.50m },
new ProductModel {ID=2, Name="Deskyop Computer", UnitCost=19.50m }
};

    <ContentPage.Content>
<ListView x:Name="ListProduct" RowHeight="60">
  <ListView.ItemTemplate>
    <DataTemplate>
      <ViewCell>
        <StacKLayout Orientation="Horizontal" Padding="5">
          <Label Text="{Binding Name}" />
          <Label Text="{Binding UnitCost}" TextColor="Green" FontSize="Small"/>
        </StacKLayout>
      </ViewCell>
    </DataTemplate>
  </ListView.ItemTemplate>
</ListView>

</ContentPage.Content>

Tagged:

Best Answer

Answers

  • awaisshabirawaisshabir USMember ✭✭

    but stacklayout is there in my code

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    In XAML you have write K instead of k

  • awaisshabirawaisshabir USMember ✭✭

    check my Xml

    <?xml version="1.0" encoding="utf-8" ?>

    <ContentPage.Content>

    <ListView.ItemTemplate>



  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    @awaisshabir said:
    check my Xml

    <?xml version="1.0" encoding="utf-8" ?>

    <ContentPage.Content>

    <ListView.ItemTemplate>



    Ok now it's correct

Sign In or Register to comment.