Exemplo n.º 1
0
        private async void CreateAnswerMethod(String answerContent)
        {
            #region Checking Network

            if (false == Utility.Instance.IsNetworkAvailable)
            {
                ToasteIndicator.Instance.Show(String.Empty, "网络连接已中断", null, 3);

                return;
            }

            #endregion

            if (null == _questionService)
            {
                return;
            }

            var result = await _questionService.AnswerAsync(LoginUser.Current.Token, Id, answerContent);

            if (result == null)
            {
                return;
            }

            if (null != result.Error)
            {
                ToasteIndicator.Instance.Show(String.Empty, result.Error.Message, null, 3);

                Debug.WriteLine(Regex.Unescape(result.Error.Message));

                return;
            }

            if (Detail == null)
            {
                return;
            }

            Detail.AnswerCount += 1;

            ToasteIndicator.Instance.Show(String.Empty, "回答已提交", null, 3);

            _relationLoaded = false;

            GetRelationshipMethod();
        }