<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);
}
}
} |