summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2013-04-16 00:00:11 +0400
committerGravatar Vitaly Takmazov2013-04-16 00:00:11 +0400
commit72fff339e1652564c53d9c639c7af13617fb6fc9 (patch)
tree2b768e51606971442a784155c4e85edc9c900f2b
parente3409abca917fbc5fd49d6366276fff0e0f60d3e (diff)
navigate to thread from toast
-rw-r--r--Juick/MainPage.xaml.cs10
-rw-r--r--Juick/ViewModels/AppViewModel.cs2
2 files changed, 7 insertions, 5 deletions
diff --git a/Juick/MainPage.xaml.cs b/Juick/MainPage.xaml.cs
index 23418ff..20beef5 100644
--- a/Juick/MainPage.xaml.cs
+++ b/Juick/MainPage.xaml.cs
@@ -1,12 +1,8 @@
using System;
using System.Collections.Generic;
-using System.Text;
using System.Windows;
-using System.Windows.Controls;
using System.Windows.Data;
-using Juick.Controls;
using Microsoft.Phone.Controls;
-using Microsoft.Phone.Notification;
using Microsoft.Phone.Shell;
using Juick.ViewModels;
using RestSharp;
@@ -76,6 +72,12 @@ namespace Juick
{
NavigationService.Navigate(new Uri(navigateUri, UriKind.Relative));
}
+ if (queryStrings.ContainsKey("mid"))
+ {
+ var mid = queryStrings["mid"];
+ navigateUri = string.Format("/ThreadView.xaml?mid={0}", mid);
+ ((App)Application.Current).NavigateTo(new Uri(navigateUri, UriKind.Relative), true);
+ }
App.AppContext.Client.Authenticator = new HttpBasicAuthenticator(App.AppContext.Account.UserName, App.AppContext.Account.Password);
}
diff --git a/Juick/ViewModels/AppViewModel.cs b/Juick/ViewModels/AppViewModel.cs
index 29e2a6b..7d5006c 100644
--- a/Juick/ViewModels/AppViewModel.cs
+++ b/Juick/ViewModels/AppViewModel.cs
@@ -144,7 +144,7 @@ namespace Juick.ViewModels
if (!Account.IsAuthenticated) return;
Client.Authenticator = new HttpBasicAuthenticator(Account.UserName, Account.Password);
Debug.WriteLine(Url.ToString());
- if (string.IsNullOrEmpty(Account.NotificationUri) || Account.NotificationUri != Url)
+ if (string.IsNullOrEmpty(Account.NotificationUri) || Account.NotificationUri == Url)
{
Account.NotificationUri = Url;
RegisterNotificationUrl(Url);