Skip to content

Instantly share code, notes, and snippets.

/c#

Created May 26, 2016 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/0bc5729ece9b264d3d3f27a32acb7b6d to your computer and use it in GitHub Desktop.
Save anonymous/0bc5729ece9b264d3d3f27a32acb7b6d to your computer and use it in GitHub Desktop.
public DispatcherTimer _timer;
public GeneralWindowViewModel()
{
_timer = new DispatcherTimer(DispatcherPriority.Render);
_timer.Interval = TimeSpan.FromSeconds(15);
_timer.Tick += new EventHandler(timer1_Tick);
_timer.Start();
}
public void timer1_Tick(object sender, EventArgs e)
{
MessengerInstance.Send<NotificationMessage>(new NotificationMessage("fingerprintTimer"));
MessengerInstance.Send<NotificationMessage>(new NotificationMessage("RebootFriends"));
}
MessengerInstance.Register<NotificationMessage>(this, (message) =>
{ // Checks the actual content of the message.
switch (message.Notification)
{
case "fingerprintTimer":
au = AuthSingleton.Instance.getAuthUser();
friends.Clear();
auxCheckins.Clear();
Friends.Clear();
loadFriends();
break;
default:
break;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment