Ejemplo n.º 1
0
        private async Task <bool> ExecuteSpeciesCommandAsync()
        {
            var buttons = new List <IActionSheetButton>()
            {
                ActionSheetButton.CreateButton("---Select species---", WriteLine, "Select option"),

                ActionSheetButton.CreateCancelButton("Cancel", WriteLine, "Cancel")
            };
            var Species = await _complaintService.GetAllSpecies(_settings.UserId);

            foreach (var item in Species)
            {
                buttons.Add(ActionSheetButton.CreateButton(item.SpeciesName, WriteLine, item.SpeciesName));
            }
            await PageDialogService.DisplayActionSheetAsync("Select species", buttons.ToArray());

            return(_species.Validate());
        }