I would like to maintain the advantages of the SfListView but being able to use the native element of the listView.
What I mean is that the native XamarinForms listView when you do a longPress on an item, creates a bar with different options (see photo), however, the SfListView does not allow it. It only lets you create a small menu, but that's not what we're looking for.
A cordial greeting.
|
private void ListView_ItemHolding(object sender, ItemHoldingEventArgs e)
{
item = e.ItemData as Contacts;
popupLayout = new SfPopupLayout();
popupLayout.PopupView.HeightRequest = 50;
popupLayout.PopupView.HorizontalOptions = LayoutOptions.FillAndExpand;
popupLayout.PopupView.ContentTemplate = new DataTemplate(() =>
{
var mainStack = new StackLayout() { Orientation = StackOrientation.Horizontal};
mainStack.BackgroundColor = Color.Teal;
var deletedButton = new Button()
{
Text = "Delete",
HeightRequest=50,
BackgroundColor=Color.Teal,
TextColor = Color.White
};
deletedButton.Clicked += DeletedButton_Clicked;
var sortButton = new Button()
{
Text = "Sort",
HeightRequest = 50,
BackgroundColor = Color.Teal,
TextColor=Color.White
};
sortButton.Clicked += SortButton_Clicked;
mainStack.Children.Add(deletedButton);
mainStack.Children.Add(sortButton);
return mainStack;
});
popupLayout.PopupView.ShowHeader = false;
popupLayout.PopupView.ShowFooter = false;
popupLayout.Show(0, 0);
} |
Thanks you.