【发布时间】:2020-06-02 21:22:43
【问题描述】:
我在同步融合列表视图中有一个命令按钮,我在视图模型上触发了命令,但我不知道如何传递所选项目的数据。这就是我所拥有的
<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
}
【问题讨论】:
标签: listview button inotifypropertychanged syncfusion 2-way-object-databinding