private void DoubanSend()
{
String finalID = m_itemViewModel.ID;
if (m_itemViewModel.ForwardItem != null)
finalID = m_itemViewModel.ForwardItem.ID;
if (String.IsNullOrEmpty(finalID))
return;
String commentText = StatusMessageBox.Text;
if(String.IsNullOrEmpty(commentText))
{
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
MessageBox.Show("内容为空!");
});
return;
}
App.DoubanAPI.AddComments(finalID, commentText, (DoubanEventArgs args) =>
{
if (args.errorCode == DoubanSdkErrCode.SUCCESS)
{
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
if (args.errorCode == DoubanSdkErrCode.SUCCESS)
{
MessageBox.Show("发送成功!");
// go back to CommentView.
// CommentView should refresh itself to show the newly added comment
NavigationService.GoBack();
}
});
}
else
{
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
MessageBox.Show("发送失败!");
// go back to CommentView.
// CommentView should refresh itself to show the newly added comment
NavigationService.GoBack();
});
}
});
}