private static void AddSwipeButtons(SwipeButtonDirection buttonType, ExtendedSwipeAbleCell swipeableNativeCell, IList <SwipeButton> buttons) { var swipeableButtonsCount = buttons.Count(); var swipeButtons = new UIButton[swipeableButtonsCount]; for (int i = 0; i < swipeableButtonsCount; i++) { var formsButton = buttons[i]; var uiButton = new UIButton { BackgroundColor = formsButton.Color.ToUIColor() }; uiButton.SetImage(UIImage.FromBundle(formsButton.ImageSource.File), UIControlState.Normal); uiButton.SetTitle(formsButton.Text, UIControlState.Normal); swipeButtons[i] = uiButton; } if (buttonType == SwipeButtonDirection.Right) { swipeableNativeCell.RightUtilityButtons = swipeButtons; } else { swipeableNativeCell.LeftUtilityButtons = swipeButtons; } }
private void CreateAndAddSwipeButtons(ExtendedSwipeAbleCell swipeableNativeCell, BaseSwipeableProductCell swipeableFormsCell) { if (!swipeableFormsCell.IsTapable) { return; } AddSwipeButtons(SwipeButtonDirection.Right, swipeableNativeCell, swipeableFormsCell.RightSwipeButtons); AddSwipeButtons(SwipeButtonDirection.Left, swipeableNativeCell, swipeableFormsCell.LeftSwipeButtons); }