コード例 #1
0
        public async Task SendStatus()
        {
            IsLoading = true;
            if (string.IsNullOrEmpty(Status) || Status.Length > 500)
            {
                return;
            }
            IEnumerable <int> mediaIds = null;

            if (PhotoList.Any())
            {
                mediaIds = PhotoList.Select(node => node.Attachment.Id);
            }
            int?replyId = null;

            if (ReplyStatus != null)
            {
                replyId = ReplyStatus.Id;
            }
            try
            {
                var result = await Client.PostStatus(Status, StatusVisibility, replyId, mediaIds, Sensitive, SpoilerText.Any()?SpoilerText : null);

                await NavigationService.NavigateAsync(typeof(MainPage), "home");
            }
            catch (Exception e)
            {
                await MessageDialogMaker.SendMessageDialogAsync(e.Message, false);
            }
            IsLoading = false;
        }