From 24f6729fb64679bb54feca2ed35577c0bf7dcb43 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Mon, 15 Apr 2013 23:38:35 +0400 Subject: add "Recommend" functionality --- Juick/ThreadView.xaml | 13 ++++++------- Juick/ThreadView.xaml.cs | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Juick/ThreadView.xaml b/Juick/ThreadView.xaml index 0665055..14a6f75 100644 --- a/Juick/ThreadView.xaml +++ b/Juick/ThreadView.xaml @@ -76,16 +76,15 @@ - - + - - + - + diff --git a/Juick/ThreadView.xaml.cs b/Juick/ThreadView.xaml.cs index b197a8b..4e1da97 100644 --- a/Juick/ThreadView.xaml.cs +++ b/Juick/ThreadView.xaml.cs @@ -7,6 +7,8 @@ using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using System.Windows.Data; using System.Windows; +using RestSharp; +using System.Net; namespace Juick { @@ -72,5 +74,20 @@ namespace Juick // Reset selected index to -1 (no selection) ((ListBox)sender).SelectedIndex = -1; } + + void RecommendBarMenuItem_Click(object sender, EventArgs e) + { + var request = new RestRequest("/post", Method.POST); + request.AddParameter("body", "! #" + Model.Mid); + App.AppContext.Client.ExecuteAsync(request, response => + { + App.AppContext.IsDataLoading = false; + if (response.StatusCode != HttpStatusCode.OK && !string.IsNullOrEmpty(response.Content)) + { + MessageBox.Show(string.Concat(response.StatusCode, ": ", response.Content)); + } + }); + App.AppContext.IsDataLoading = true; + } } } \ No newline at end of file -- cgit v1.2.3