Last active
March 4, 2016 16:28
-
-
Save FrayxRulez/77209ffaf7af41213b2b to your computer and use it in GitHub Desktop.
Interactive toast notifications with Silverlight and Runtime 8.1 apps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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