Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
142908 | Feb 25,2019 04:39 PM UTC | Mar 4,2019 11:37 AM UTC | Xamarin.Forms | 5 |
![]() |
Tags: SfListView |
<syncfusion:SfListView ItemsSource="{Binding contactsinfo}" >
<syncfusion:SfListView.LeftSwipeTemplate>
<DataTemplate x:Name="LeftSwipeTemplate">
<Grid >
<syncfusion:SfListView ItemsSource="{Binding EmployeeEventItems}" AutoFitMode="Height">
<syncfusion:SfListView.LayoutManager>
<syncfusion:GridLayout SpanCount="2"/>
</syncfusion:SfListView.LayoutManager>
<syncfusion:SfListView.ItemTemplate>
<DataTemplate>
<Grid >
<Button Text="{Binding Name}" />
</Grid>
</DataTemplate>
</syncfusion:SfListView.ItemTemplate>
</syncfusion:SfListView>
</Grid>
</DataTemplate>
</syncfusion:SfListView.LeftSwipeTemplate>
</syncfusion:SfListView> |
public class Contacts : INotifyPropertyChanged
{
public List<EmployeeEvent> EmployeeEventItems
{
get { return employeeEventItems; }
set { employeeEventItems = value; }
}
}
public class EmployeeEvent
{
public int ID { get; set; }
public string Name { get; set; }
} |
public class ContactsViewModel : INotifyPropertyChanged
{
public ContactsViewModel()
{
contactsinfo = new ObservableCollection<Contacts>();
for (int i = 0; i < CustomerNames.Count(); i++)
{
var contact = new Contacts();
//add list into swipe template
List<EmployeeEvent> employeeEvents = new List<EmployeeEvent>();
for (int j = 0; j < 10; j++)
employeeEvents.Add(new EmployeeEvent { ID = j, Name = "Event " + j });
contact.EmployeeEventItems = employeeEvents;
contactsinfo.Add(contact);
}
}
} |
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.