private async Task GetPollings(int parentId, int campusId) { //get poll Data PollResponseModel pollResponse = await DashBoardService.GetPolls(campusId, parentId, Enums.Views.DashBoard); PollData = pollResponse.data; foreach (var data in PollData) { int i = 65; foreach (var option in data.Options) { option.OptionIndex = ((char)i).ToString() + " "; i = i + 1; } ; } }
private async void optionSelected_Clicked(object sender, EventArgs e) { Frame optionFrame = (Frame)sender; var item = (TapGestureRecognizer)optionFrame.GestureRecognizers[0]; object[] parameters = (object[])item.CommandParameter; PollData pollData = (PollData)parameters[0]; if (pollData.IsAnswerSubmitted == false) { int optionValue = (int)parameters[1]; PollOption selectedOption = pollData.Options.Where(x => x.Value == optionValue).FirstOrDefault(); if (!selectedOption.IsSelected) { selectedOption.IsSelected = true; } PollResponseModel pollResponseModel = await DashBoardService.AddPoll(pollId : Convert.ToInt32(pollData.id), parentId : ParentkidsDetails.id, selectedOption.Name); } }