Skip to content

Instantly share code, notes, and snippets.

@FrayxRulez

FrayxRulez/Background.cs

Last active Mar 4, 2016
Embed
What would you like to do?
Interactive toast notifications with Silverlight and Runtime 8.1 apps
using System;
using Windows.ApplicationModel.Background;
using Windows.Foundation.Collections;
using Windows.Foundation.Metadata;
namespace TestInteractive.Tasks
{
public sealed class InteractiveTask : IBackgroundTask
{
public void Run(IBackgroundTaskInstance taskInstance)
{
var details = taskInstance.TriggerDetails as IToastNotificationActionTriggerDetail;
}
}
[Guid(2487554906, 14579, 17142, 150, 170, 121, 85, 176, 240, 61, 162)]
public interface IToastNotificationActionTriggerDetail
{
string Argument { get; }
ValueSet UserInput { get; }
}
}
var type = typeof(IBackgroundTrigger).Assembly.GetType("Windows.ApplicationModel.Background.ToastNotificationActionTrigger");
if (type != null)
{
var trigger = (IBackgroundTrigger)Activator.CreateInstance(type);
var builder = new BackgroundTaskBuilder();
builder.Name = "InteractiveTask";
builder.TaskEntryPoint = "TestInteractive.Tasks.InteractiveTask";
builder.SetTrigger(trigger);
builder.Register();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.