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

Binding: 'TestCommand' property not found on 'ProductClas', target property: 'Xamarin.Forms.Button.

$
0
0

Hello,
Binding my ListView is working fine with my (MyBindableCollection), however, the button binding I'm getting error (Binding: 'TestCommand' property not found on 'ProductClas', target property: 'Xamarin.Forms.Button.). Looks like it's looking a property in my class ProductClas instead a ICommand in my class MyViewModel.

Why?

        <ListView ItemsSource="{Binding MyBindableCollection}" SeparatorColor="Gray" HasUnevenRows="True">
             <ListView.ItemTemplate>
                            <DataTemplate>
                                <ViewCell>
                                    <ViewCell.View>
                        <Label  Text="{Binding Price" />
                                        <Button
                                            Command="{Binding TestCommand}"
                                            BackgroundColor="#ddd" 
                                            Grid.Row="3" Grid.Column="1" Grid.RowSpan="2" 
                                            Text="ADD" TextColor="Green" 
                                            BorderRadius="0">
                                        </Button>
        .....
        .....                                    
        </ListView>

//MyViewModel
public ObservableCollection MyBindableCollection { get; set; }


Viewing all articles
Browse latest Browse all 89864

Trending Articles