Как привязать выбранные данные элемента к команде кнопки в формах xamarin - PullRequest
0 голосов
/ 18 февраля 2020

У меня есть кнопка команды в представлении списка синхронизации, я запустил команду на модели представления, но я не знаю, как передать данные выбранного элемента. Вот что у меня

 <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
         }           
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...