From 72fff339e1652564c53d9c639c7af13617fb6fc9 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 16 Apr 2013 00:00:11 +0400 Subject: navigate to thread from toast --- Juick/MainPage.xaml.cs | 10 ++++++---- Juick/ViewModels/AppViewModel.cs | 2 +- 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); -- cgit v1.2.3