コード例 #1
0
        private async void ShareViaWeChatMethod()
        {
            if (null == _social || this.Detail == null || this.Detail.Question == null)
            {
                return;
            }

            #region Checking Network

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

                return;
            }

            #endregion

            var result = await _social.ShareViaWeChat(Utility.Instance.WeChatAppId,
                                                      this.Detail.Question.Title,
                                                      this.Detail.Excerpt,
                                                      String.Format("http://www.zhihu.com/question/{0}/answer/{1}", this.Detail.Question.Id, this.Detail.Id));
        }
コード例 #2
0
        private async void ShareToWeChatTimelineMethod()
        {
            if (null == _social || this.Detail == null || this.Detail.Column == null ||
                this.Detail.Id == 0 || String.IsNullOrEmpty(this.Detail.Title) || String.IsNullOrEmpty(this.Detail.Column.Id))
            {
                return;
            }

            #region Checking Network

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

                return;
            }

            #endregion

            var result = await _social.ShareViaWeChat(Utility.Instance.WeChatAppId,
                                                      this.Detail.Title,
                                                      String.Empty,
                                                      String.Format("http://zhuanlan.zhihu.com/{0}/{1}", this.Detail.Column.Id, this.Detail.Id));
        }