Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IEnumerable<StartParticularSurvey> _questionList;
- IEnumerable<StartParticularSurvey> _answerList;
- var response = e.Result.ToString();
- var result = StartParticularSurvey.FromJson(response);
- if (result[0][0].bit_HasError == true)
- {
- Device.BeginInvokeOnMainThread(() =>
- {
- Navigation.PushAsync(new UserSurveyList());
- DisplayAlert("Alert!", result[0][0].vchar_ErrorMsg, "Ok");
- });
- }
- else
- {
- Device.BeginInvokeOnMainThread(() =>
- {
- var questionDataset = result[1][0];
- var answerDataset = result[2][0];
- _questionList = questionDataset as IEnumerable<StartParticularSurvey>;
- _answerList = answerDataset as IEnumerable<StartParticularSurvey>;
- lvSurveyQuestion.ItemsSource = _questionList;
- lvSurveyAnswer.itemSource = _answerList; //Here is where the .cs is not picking up and i know why.
- });
- }
- <ListView x:Name="lvSurveyQuestion">
- <ListView.ItemTemplate>
- <DataTemplate>
- <ViewCell>
- <StackLayout>
- <Label Text="{binding data here}"/>
- <ListView x:Name="lvSurveyAnswer">
- <ListView.ItemTemplate>
- <DataTemplate>
- <ViewCell>
- <StackLayout>
- <Label Text="{binding data here}"/>
- <Label Text="{binding data here}"/>
- </StackLayout>
- </ViewCell>
- </DataTemplate>
- </ListView.ItemTemplate>
- </ListView>
- </StackLayout>
- </ViewCell>
- </DataTemplate>
- </ListView.ItemTemplate>
- </ListView>
- namespace IVSConnectMobile.Model
- {
- public partial class StartParticularSurvey
- {
- [JsonProperty("bit_HasError", NullValueHandling = NullValueHandling.Ignore)]
- public bool? bit_HasError { get; set; }
- [JsonProperty("vchar_ErrorMsg", NullValueHandling = NullValueHandling.Ignore)]
- public string vchar_ErrorMsg { get; set; }
- [JsonProperty("int_SurveyQuestionID", NullValueHandling = NullValueHandling.Ignore)]
- public long? int_SurveyQuestionID { get; set; }
- [JsonProperty("vchar_Description", NullValueHandling = NullValueHandling.Ignore)]
- public string vchar_Description { get; set; }
- [JsonProperty("vchar_Instruction")]
- public string vchar_Instruction { get; set; }
- [JsonProperty("int_AnswerType", NullValueHandling = NullValueHandling.Ignore)]
- public long? int_AnswerType { get; set; }
- [JsonProperty("vchar_Option", NullValueHandling = NullValueHandling.Ignore)]
- public string vchar_Option { get; set; }
- }
- public partial class StartParticularSurvey
- {
- public static List<List<StartParticularSurvey>> FromJson(string json) => JsonConvert.DeserializeObject<List<List<StartParticularSurvey>>>(json, IVSConnectMobile.Model.Converter.Settings);
- }
- public static class Serialize
- {
- public static string ToJson(this List<List<StartParticularSurvey>> self) => JsonConvert.SerializeObject(self, IVSConnectMobile.Model.Converter.Settings);
- }
- internal static class Converter
- {
- public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
- {
- MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
- DateParseHandling = DateParseHandling.None,
- Converters = {
- new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
- },
- };
- }
- }
Add Comment
Please, Sign In to add comment