init
This commit is contained in:
+41
@@ -0,0 +1,41 @@
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Controls.Primitives;
|
||||
|
||||
namespace NotificationFlyout.Uwp.UI.Controls
|
||||
{
|
||||
public class NotificationFlyoutPresenter : ContentControl
|
||||
{
|
||||
private Grid _root;
|
||||
|
||||
public NotificationFlyoutPresenter()
|
||||
{
|
||||
DefaultStyleKey = typeof(NotificationFlyoutPresenter);
|
||||
}
|
||||
|
||||
public void HideFlyout()
|
||||
{
|
||||
if (_root == null) return;
|
||||
var flyout = FlyoutBase.GetAttachedFlyout(_root);
|
||||
flyout.Hide();
|
||||
}
|
||||
|
||||
public void ShowFlyout(FlyoutPlacementMode placementMode)
|
||||
{
|
||||
if (_root == null) return;
|
||||
var flyout = FlyoutBase.GetAttachedFlyout(_root);
|
||||
flyout.ShowAt(_root, new FlyoutShowOptions { Placement = placementMode });
|
||||
}
|
||||
|
||||
public void ShowFlyout()
|
||||
{
|
||||
if (_root == null) return;
|
||||
var flyout = FlyoutBase.GetAttachedFlyout(_root);
|
||||
flyout.ShowAt(_root);
|
||||
}
|
||||
|
||||
protected override void OnApplyTemplate()
|
||||
{
|
||||
_root = GetTemplateChild("Root") as Grid;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user