Listview 如何将项选定数据绑定到xamarin表单中的按钮命令
我在syncfusion列表视图中有一个命令按钮,我在视图模型上启动了该命令,但我不知道如何传递所选项目的数据。这就是我所拥有的Listview 如何将项选定数据绑定到xamarin表单中的按钮命令,listview,button,inotifypropertychanged,syncfusion,2-way-object-databinding,Listview,Button,Inotifypropertychanged,Syncfusion,2 Way Object Databinding,我在syncfusion列表视图中有一个命令按钮,我在视图模型上启动了该命令,但我不知道如何传递所选项目的数据。这就是我所拥有的 <syncfusion:SfListView x:Name="listView" SelectionBackgroundColor="Transparent" ItemsSource="{Binding AvailableData}" ItemSpacing="10" &g
<syncfusion:SfListView x:Name="listView"
SelectionBackgroundColor="Transparent"
ItemsSource="{Binding AvailableData}" ItemSpacing="10" >
<syncfusion:SfListView.ItemTemplate>
<DataTemplate>
<Label text="{Binding id requests}"/>
<Button Text="Cancel" Command="{Binding Source={x:Reference RequestsPage}, Path=BindingContext.CancelCommand}" ></Button>
</DataTemplate>
</syncfusion:SfListView.ItemTemplate>
</syncfusion:SfListView>
请参考以下链接
public ICommand CancelCommand
{
get;
set;
}
CancelCommand = new Command(CancelBooking);
void CancelBooking()
{
I need to capture the item source this button is inside each item that is
displayed in the list , I need to capture the data from this selection
}