1 year ago
#356218

Reza
DevExpress XF CollectionView - how to modify tapped cell
I am using DevExpress's Free Xamarin controls (they don't provide support) and trying to figure out how I can change something of the selected item cell, eg modify the text in the cell.
<dxcv:DXCollectionView TapCommand="{Binding ItemTapCommand}"
ItemsSource="{Binding Data}"
DisplayMember="Name"
DisplayFormat="Contact: {0}">
</dxcv:DXCollectionView>
And the viewmodel:
public List<Contact> Data { get; set; }
public ICommand ItemTapCommand => new Command(ItemTapped);
private void ItemTapped(object obj)
{
}
public CollectionViewModel(INavigationService navigationService) : base(navigationService)
{
DevExpress.XamarinForms.CollectionView.Initializer.Init();
Data = new List<Contact>() {
new Contact("Nancy Davolio", "(206) 555-9857"),
new Contact("Andrew Fuller", "(206) 555-9482"),
new Contact("Janet Leverling", "(206) 555-3412"),
new Contact("Margaret Peacock", "(206) 555-8122"),
new Contact("Steven Buchanan", "(71) 555-4848"),
new Contact("Michael Suyama", "(71) 555-7773"),
new Contact("Robert King", "(71) 555-5598"),
new Contact("Laura Callahan", "(206) 555-1189"),
new Contact("Anne Dodsworth", "(71) 555-4444"),
};
}
}
public class Contact
{
public string Name;
public string Phone;
public Contact(string name, string phone)
{
Name = name;
Phone = phone;
}
}
When I set a breakpoint at the ItemTapped, I get the following for the obj, but not necessarily a way to target the cell.
Is there a way to do this?
xamarin.forms
devexpress
0 Answers
Your Answer