diff --git a/samples/NotificationFlyoutSample.Host/Program.cs b/samples/NotificationFlyoutSample.Host/Program.cs
index 2501313..b6b01c8 100644
--- a/samples/NotificationFlyoutSample.Host/Program.cs
+++ b/samples/NotificationFlyoutSample.Host/Program.cs
@@ -13,7 +13,7 @@ namespace NotificationFlyoutSample.Host
var app = new App();
new NotificationFlyoutApplication
{
- Flyout = new Shell()
+ Flyout = new NowPlayingFlyout()
};
app.Run();
}
diff --git a/samples/NotificationFlyoutSample/Class1.cs b/samples/NotificationFlyoutSample/Class1.cs
new file mode 100644
index 0000000..a574a9f
--- /dev/null
+++ b/samples/NotificationFlyoutSample/Class1.cs
@@ -0,0 +1,253 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Text;
+using System.Threading.Tasks;
+using Windows.System;
+
+namespace NotificationFlyoutSample
+{
+ public static class DispatcherQueueExtensions
+ {
+ ///
+ /// Indicates whether or not is available.
+ ///
+ private static bool IsHasThreadAccessPropertyAvailable => true;
+
+ public static Task EnqueueAsync(this DispatcherQueue dispatcher, Action function, DispatcherQueuePriority priority = DispatcherQueuePriority.Normal)
+ {
+ // Run the function directly when we have thread access.
+ // Also reuse Task.CompletedTask in case of success,
+ // to skip an unnecessary heap allocation for every invocation.
+ if (IsHasThreadAccessPropertyAvailable && dispatcher.HasThreadAccess)
+ {
+ try
+ {
+ function();
+
+ return Task.CompletedTask;
+ }
+ catch (Exception e)
+ {
+ return Task.FromException(e);
+ }
+ }
+
+ static Task TryEnqueueAsync(DispatcherQueue dispatcher, Action function, DispatcherQueuePriority priority)
+ {
+ var taskCompletionSource = new TaskCompletionSource