private static void CreateButtons(CustomDialog control, ButtonModel[] models) { var colums = 0; foreach (var model in models) { var button = new Button { Text = model.Text, ImageSource = model.Icon, TextColor = model.TextColor, BackgroundColor = model.BackgroundColor, }; if (colums == 0) { button.Clicked += control.OKButton_Clicked; } else { button.Clicked += control.CancelButton_Clicked; } control.Footer.Children.Add(button, colums++, 0); } }