diff --git a/samples/NotificationFlyoutSample/SampleFlyout.xaml b/samples/NotificationFlyoutSample/SampleFlyout.xaml
index b9104df..21d2a66 100644
--- a/samples/NotificationFlyoutSample/SampleFlyout.xaml
+++ b/samples/NotificationFlyoutSample/SampleFlyout.xaml
@@ -2,17 +2,26 @@
x:Class="NotificationFlyoutSample.SampleFlyout"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:controls="using:TheXamlGuy.NotificationFlyout.Uwp.UI.Controls"
- Placement="Auto">
+ xmlns:controls="using:TheXamlGuy.NotificationFlyout.Uwp.UI.Controls">
-
-
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/NotificationFlyoutSample/SampleFlyout.xaml.cs b/samples/NotificationFlyoutSample/SampleFlyout.xaml.cs
index 9fc124d..873cf12 100644
--- a/samples/NotificationFlyoutSample/SampleFlyout.xaml.cs
+++ b/samples/NotificationFlyoutSample/SampleFlyout.xaml.cs
@@ -1,4 +1,6 @@
-using Windows.UI.Xaml;
+using TheXamlGuy.NotificationFlyout.Uwp.UI.Controls;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
namespace NotificationFlyoutSample
{
@@ -14,5 +16,32 @@ namespace NotificationFlyoutSample
var app = GetApplication();
app.Exit();
}
+
+ private void ToggleSwitch_Toggled(object sender, RoutedEventArgs e)
+ {
+ var toggleSwitch = sender as ToggleSwitch;
+ if (toggleSwitch.IsOn)
+ {
+ this.IsLightDismissEnabled = true;
+ }
+ else
+ {
+ this.IsLightDismissEnabled = false;
+ }
+ }
+
+ private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ var comboBox = sender as ComboBox;
+
+ if (comboBox.SelectedIndex == 0)
+ {
+ this.Placement = NotificationFlyoutPlacement.Auto;
+ }
+ else
+ {
+ this.Placement = NotificationFlyoutPlacement.FullRight;
+ }
+ }
}
}
\ No newline at end of file
diff --git a/src/TheXamlGuy.NotificationFlyout.Shared.UI/INotificationFlyoutApplication.cs b/src/TheXamlGuy.NotificationFlyout.Shared.UI/INotificationFlyoutApplication.cs
index ae63d49..346217a 100644
--- a/src/TheXamlGuy.NotificationFlyout.Shared.UI/INotificationFlyoutApplication.cs
+++ b/src/TheXamlGuy.NotificationFlyout.Shared.UI/INotificationFlyoutApplication.cs
@@ -6,6 +6,10 @@ namespace TheXamlGuy.NotificationFlyout.Shared.UI
{
void Exit();
+ void OpenFlyout();
+
+ void CloseFlyout();
+
void OpenAsWindow() where TUIElement : UIElement;
}
}
\ No newline at end of file
diff --git a/src/TheXamlGuy.NotificationFlyout.Uwp.UI.Controls/NotificationFlyout/NotificationFlyout.cs b/src/TheXamlGuy.NotificationFlyout.Uwp.UI.Controls/NotificationFlyout/NotificationFlyout.cs
index 2a38fb0..13a188e 100644
--- a/src/TheXamlGuy.NotificationFlyout.Uwp.UI.Controls/NotificationFlyout/NotificationFlyout.cs
+++ b/src/TheXamlGuy.NotificationFlyout.Uwp.UI.Controls/NotificationFlyout/NotificationFlyout.cs
@@ -32,18 +32,28 @@ namespace TheXamlGuy.NotificationFlyout.Uwp.UI.Controls
typeof(NotificationFlyoutPlacement), typeof(NotificationFlyout),
new PropertyMetadata(NotificationFlyoutPlacement.Auto));
+ public static readonly DependencyProperty TemplateSettingsProperty =
+ DependencyProperty.Register(nameof(TemplateSettings),
+ typeof(NotificationFlyoutTemplateSettings), typeof(NotificationFlyout),
+ new PropertyMetadata(null));
+
private const double OffsetValue = 1;
private static INotificationFlyoutApplication _applicationInstance;
private Border _backgroundElement;
+
private UIElement _child;
private Border _container;
private Popup _popup;
- public NotificationFlyout() => DefaultStyleKey = typeof(NotificationFlyout);
+ public NotificationFlyout()
+ {
+ DefaultStyleKey = typeof(NotificationFlyout);
+ TemplateSettings = new NotificationFlyoutTemplateSettings();
+ }
public event EventHandler