From 98700f28bb208f7bdc741397b1c9993bfd051d8d Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 27 Nov 2013 00:48:37 +0400 Subject: Refresh only current page, fixes issue #18 --- Juick/ViewModels/AppViewModel.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Juick/ViewModels') diff --git a/Juick/ViewModels/AppViewModel.cs b/Juick/ViewModels/AppViewModel.cs index 2aff819..ba33625 100644 --- a/Juick/ViewModels/AppViewModel.cs +++ b/Juick/ViewModels/AppViewModel.cs @@ -10,6 +10,7 @@ using RestSharp; using Microsoft.Phone.Notification; using System.Diagnostics; using System.Text; +using System.Windows.Controls; namespace Juick.ViewModels { @@ -98,7 +99,8 @@ namespace Juick.ViewModels } Debug.WriteLine("Received: " + message.ToString()); }; - } + } + CheckNewDataCommand = new DelegateCommand(CheckNewData, () => Account.IsAuthenticated); } private ObservableCollection _pages; public ObservableCollection Pages @@ -133,6 +135,8 @@ namespace Juick.ViewModels } } + public DelegateCommand CheckNewDataCommand { get; private set; } + private AccountManager _acc; public AccountManager Account @@ -172,6 +176,12 @@ namespace Juick.ViewModels if (pushChannel.IsShellToastBound) pushChannel.UnbindToShellToast(); Account.NotificationUri = string.Empty; - } + } + + public void CheckNewData(SelectionChangedEventArgs param) + { + var page = param.AddedItems[0] as PageViewModel; + page.RefreshData(); + } } } -- cgit v1.2.3