Exemple #1
0
        private async void DoLoadResponsesAsync(object obj)
        {
            Responses = new ObservableCollection <QueryResponseVM>();
            if (FormQuery != null && FormQuery.Id > 0)
            {
                try
                {
                    var result = await RestHub.Responses(FormQuery.Id);

                    if (result.UserObject != null)
                    {
                        foreach (var response in result.UserObject as List <QueryResponseDTO> )
                        {
                            Responses.Add(new QueryResponseVM
                            {
                                Id        = response.Id,
                                Response  = response.Response,
                                Timestamp = response.TimeStamp,
                                User      = response.User
                            });
                        }
                    }
                    else
                    {
                        MessageBox.Show("Can't Load Responses . .");
                    }
                }
                catch (Exception ex)
                {
                    AppErrorBox.ShowErrorMessage("Error while Loading Responses . .", ex.ToString());
                }
            }
        }