summaryrefslogtreecommitdiff
path: root/Juick/ViewModels
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/ViewModels')
-rw-r--r--Juick/ViewModels/AppViewModel.cs14
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();
+ }
}
}