Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
144873 | May 27,2019 10:25 AM UTC | May 28,2019 01:55 PM UTC | Xamarin.Forms | 1 |
![]() |
Tags: SfListView |
MessageInfoModel.cs
public class MessageInfo : INotifyPropertyChanged
{
public Command<object> SampleCommand { get; }
public MessageInfo()
{
SampleCommand = new Command<object>(OnGridTapped);
}
private void OnGridTapped(object obj)
{
var param = obj as MessageInfo;
App.Current.MainPage.DisplayAlert("Message","Tapped Item :"+param.Text,"Ok");
}
}
IncomingTextTemplate.xaml
<ViewCell >
<Grid ColumnSpacing="2" x:Name="Grid">
<Grid.GestureRecognizers>
<TapGestureRecognizer Command="{Binding Source={x:ReferenceGrid}, Path=BindingContext.SampleCommand}" CommandParameter="{Binding Source={x:Reference Grid}, Path=BindingContext}"/>
</Grid.GestureRecognizers>
</ViewCell >
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.