diff options
author | Vitaly Takmazov | 2013-11-27 00:48:37 +0400 |
---|---|---|
committer | Vitaly Takmazov | 2013-11-27 00:48:37 +0400 |
commit | 98700f28bb208f7bdc741397b1c9993bfd051d8d (patch) | |
tree | 91789a8f6416d2c1e4edf655f61a03ed6e86b4db /Juick/ViewModels | |
parent | c07cfc51d2e8f195533ed605d71d33b4fd8bca61 (diff) |
Refresh only current page, fixes issue #18
Diffstat (limited to 'Juick/ViewModels')
-rw-r--r-- | Juick/ViewModels/AppViewModel.cs | 14 |
1 files changed, 12 insertions, 2 deletions
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<SelectionChangedEventArgs>(CheckNewData, () => Account.IsAuthenticated); } private ObservableCollection<PageViewModel> _pages; public ObservableCollection<PageViewModel> Pages @@ -133,6 +135,8 @@ namespace Juick.ViewModels } } + public DelegateCommand<SelectionChangedEventArgs> 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(); + } } } |