I want to show toast notification from my app with the code not from push notifications.
Like My app was running and I opened the call task and after 5 secs I want to show toast notification on that call screen As My app is running on background and its obscured state.
Here is My Code and I am using Coding4fun toolkit:
private void RunBackgroundWorker()
{
PhoneCallTask callTask = new PhoneCallTask();
callTask.PhoneNumber = "03336329631";
callTask.DisplayName = "Arslan";
callTask.Show();
BackgroundWorker backroungWorker = new BackgroundWorker();
backroungWorker.DoWork += ((s, args) =>
{
Thread.Sleep(5000);
});
backroungWorker.RunWorkerCompleted += ((s, args) =>
{
this.Dispatcher.BeginInvoke(() =>
{
var toast = new ToastPrompt
{
Title = "Simple usage",
Message = "Message",
ImageSource = new BitmapImage(new Uri("..\\ApplicationIcon.png", UriKind.RelativeOrAbsolute))
};
toast.Show();
}
);
});
backroungWorker.RunWorkerAsync();
}