Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.

I am creating a ShellToast class in OnInvoke() of ScheduledToast Class from ScheduledToastAgent project type as below.
C#
ShellToast toast = new ShellToast();
toast.Content =  "Hello App.."
toast.Title = "My App:";
toast.Show();
#if DEBUG_AGENT
     ScheduledActionService.LaunchForTest(task.Name, TimeSpan.FromSeconds(15));
#endif


Now i have added this in other phone app project in mainpage.xaml.cs below the IntializeComponent()
C#
PeriodicTask task;
task = ScheduledActionService.Find("ScheduledAgent") as PeriodicTask;
bool found = (task != null);
if (!found)
{
        task = new PeriodicTask("ScheduledAgent");
}
task.Description = "Test app";
task.ExpirationTime = DateTime.Now.AddDays(1);
if (!found)
      ScheduledActionService.Add(task);
 else
{
      ScheduledActionService.Remove(task.Name);
      ScheduledActionService.Add(task);
}
#if DEBUG_AGENT
                ScheduledActionService.LaunchForTest(task.Name, TimeSpan.FromSeconds(15));
#endif


Now Please help me below:

1) As i mentioned 15 seconds time to test the app, toast is not coming for every 15 seconds. Why?

2) Where i need to add this ScheduledActoinService.Add() to get the toast for every 15 seconds in the application like in the App.xaml.cs or mainpage.xaml.cs.?

Please help me in seeing toast at regular interval of time...

Thank you.. :-)
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900