public async Task <QuestionBinding> GetQuestion(int userId, int userClientId, int dictionaryId, int questionTypeId)
        {
            HttpClient httpClient = new HttpClient();

            httpClient.DefaultRequestHeaders.Add("Accept", "application/json");

            //httpClient.BaseAddress = new Uri(configuration.ApiBaseAddress);
            //httpClient.BaseAddress = new Uri("https://httpbin.org");

            //string requestUri = string.Format("q/GetQuestion/{0}/{1}/{2}/{3}", userClientId, userId, dictionaryId, questionTypeId);


            HttpRequestMessage httpRequest = new HttpRequestMessage(HttpMethod.Get, Configurations.ApiBaseAddress + "/q/GetQuestion/1/1/1/1");

            var response = httpClient.SendAsync(httpRequest).Result;

            if (response.IsSuccessStatusCode)
            {
                string jsonContent = await response.Content.ReadAsStringAsync();

                QuestionBinding questionBinding = JsonConvert.DeserializeObject <QuestionBinding>(jsonContent);

                return(questionBinding);
            }
            else
            {
                return(null);
            }
        }
        private void GetNextQuestion()
        {
            var questionBindingTask = questionConsumer.GetQuestion(1, 1, 1, 1);

            questionBindingTask.Wait();
            var      questionBinding = questionBindingTask.Result;
            TextView questionText    = FindViewById <TextView>(Resource.Id.questionTitle);

            if (questionBinding.Question.QuestionWordNumber == 1)
            {
                questionText.SetText(questionBinding.Question.InLanguage1, TextView.BufferType.Normal);
            }
            else
            {
                questionText.SetText(questionBinding.Question.InLanguage2, TextView.BufferType.Normal);
            }
            GenerateAnswerButtons(questionBinding);
            currentQuestion = questionBinding;
        }
        private void GenerateAnswerButtons(QuestionBinding questionBinding)
        {
            LinearLayout buttonLayout = FindViewById <LinearLayout>(Resource.Id.questionContentLayout);
            var          layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent);

            layoutParams.SetMargins(20, 10, 20, 10);
            var idGenerator = new Random(int.MaxValue);

            buttonLayout.RemoveViews(1, buttonLayout.ChildCount - 1);
            foreach (var item in questionBinding.WrongPairs)
            {
                EasyWordButton btn = new EasyWordButton(this);
                var            id  = idGenerator.Next();
                btn.Id = id;
                if (questionBinding.Question.QuestionWordNumber == 1)
                {
                    btn.SetText(item.InLanguage2, TextView.BufferType.Normal);
                }
                else
                {
                    btn.SetText(item.InLanguage1, TextView.BufferType.Normal);
                }

                if (item.PairID == questionBinding.Question.PairID)
                {
                    btn.IsQuestionAnswer = true;
                }
                else
                {
                    btn.IsQuestionAnswer = false;
                }
                btn.PairItem = item;
                btn.Click   += AnswerButtonClicked;
                buttonLayout.AddView(btn);
            }
        }