diff --git a/samples/NotificationFlyoutSample/Shell.xaml b/samples/NotificationFlyoutSample/Shell.xaml
index 4168d62..4b00e6c 100644
--- a/samples/NotificationFlyoutSample/Shell.xaml
+++ b/samples/NotificationFlyoutSample/Shell.xaml
@@ -7,6 +7,11 @@
Width="330"
Height="500"
Margin="24">
+
+
+
+
+
diff --git a/samples/NotificationFlyoutSample/Shell.xaml.cs b/samples/NotificationFlyoutSample/Shell.xaml.cs
index e9182a1..127099a 100644
--- a/samples/NotificationFlyoutSample/Shell.xaml.cs
+++ b/samples/NotificationFlyoutSample/Shell.xaml.cs
@@ -1,27 +1,26 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices.WindowsRuntime;
-using Windows.Foundation;
-using Windows.Foundation.Collections;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Controls.Primitives;
-using Windows.UI.Xaml.Data;
-using Windows.UI.Xaml.Input;
-using Windows.UI.Xaml.Media;
-using Windows.UI.Xaml.Navigation;
-
-// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
-
-namespace NotificationFlyoutSample
+namespace NotificationFlyoutSample
{
- public sealed partial class Shell : UserControl
+ public sealed partial class Shell
{
public Shell()
{
- this.InitializeComponent();
+ InitializeComponent();
+ }
+
+ private void Theme_SelectionChanged(object sender, Windows.UI.Xaml.Controls.SelectionChangedEventArgs e)
+ {
+ switch (Theme.SelectedIndex)
+ {
+ case 0:
+ RequestedTheme = Windows.UI.Xaml.ElementTheme.Default;
+ break;
+ case 1:
+ RequestedTheme = Windows.UI.Xaml.ElementTheme.Dark;
+ break;
+ case 2:
+ RequestedTheme = Windows.UI.Xaml.ElementTheme.Light;
+ break;
+ }
}
}
}
diff --git a/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyout.Uwp.UI.Controls.csproj b/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyout.Uwp.UI.Controls.csproj
index 883d408..312e3d1 100644
--- a/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyout.Uwp.UI.Controls.csproj
+++ b/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyout.Uwp.UI.Controls.csproj
@@ -12,7 +12,7 @@
Designer
MSBuild:Compile
-
+
Designer
MSBuild:Compile
diff --git a/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyoutHost/NotificationFlyoutHost.xaml b/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyoutHost/NotificationFlyoutHost.xaml
index 101589c..76f7c61 100644
--- a/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyoutHost/NotificationFlyoutHost.xaml
+++ b/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyoutHost/NotificationFlyoutHost.xaml
@@ -54,14 +54,10 @@
FromVerticalOffset="0" />
-
+
-
diff --git a/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyoutPresenter/NotificationFlyoutContentPresenter.cs b/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyoutPresenter/NotificationFlyoutContentPresenter.cs
deleted file mode 100644
index bb1398b..0000000
--- a/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyoutPresenter/NotificationFlyoutContentPresenter.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using Windows.UI.Xaml.Controls;
-
-namespace NotificationFlyout.Uwp.UI.Controls
-{
- public class NotificationFlyoutContentPresenter : ContentControl
- {
- public NotificationFlyoutContentPresenter()
- {
- DefaultStyleKey = typeof(NotificationFlyoutContentPresenter);
- }
- }
-}
\ No newline at end of file
diff --git a/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyoutPresenter/NotificationFlyoutPresenter.cs b/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyoutPresenter/NotificationFlyoutPresenter.cs
new file mode 100644
index 0000000..222e580
--- /dev/null
+++ b/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyoutPresenter/NotificationFlyoutPresenter.cs
@@ -0,0 +1,27 @@
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Data;
+
+namespace NotificationFlyout.Uwp.UI.Controls
+{
+ public class NotificationFlyoutPresenter : ContentControl
+ {
+ public NotificationFlyoutPresenter()
+ {
+ DefaultStyleKey = typeof(NotificationFlyoutPresenter);
+ }
+
+ protected override void OnApplyTemplate()
+ {
+ if (GetTemplateChild("ContentPresenter") is ContentControl contentPresenter)
+ {
+ BindingOperations.SetBinding(this, RequestedThemeProperty, new Binding
+ {
+ Source = contentPresenter.Content,
+ Path = new PropertyPath(nameof(RequestedTheme)),
+ Mode = BindingMode.TwoWay
+ });
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyoutPresenter/NotificationFlyoutContentPresenter.xaml b/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyoutPresenter/NotificationFlyoutPresenter.xaml
similarity index 96%
rename from src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyoutPresenter/NotificationFlyoutContentPresenter.xaml
rename to src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyoutPresenter/NotificationFlyoutPresenter.xaml
index efea53e..7d4f14d 100644
--- a/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyoutPresenter/NotificationFlyoutContentPresenter.xaml
+++ b/src/NotificationFlyout.Uwp.UI.Controls/NotificationFlyoutPresenter/NotificationFlyoutPresenter.xaml
@@ -31,11 +31,11 @@
FallbackColor="{StaticResource SystemAccentColorDark1}"
TintColor="{StaticResource SystemAccentColorDark1}"
TintOpacity="0.8" />
-