using Avalonia.Controls.Notifications;
namespace Avalonia.Xaml.Interactions.Custom;
///
///
///
public class CloseNotificationAction : Avalonia.Xaml.Interactivity.Action
{
///
///
///
public static readonly StyledProperty NotificationCardProperty =
AvaloniaProperty.Register(nameof(NotificationCard));
///
///
///
public NotificationCard? NotificationCard
{
get => GetValue(NotificationCardProperty);
set => SetValue(NotificationCardProperty, value);
}
///
///
///
///
///
///
public override object Execute(object? sender, object? parameter)
{
if (!IsEnabled)
{
return false;
}
if (NotificationCard is null)
{
return false;
}
NotificationCard.Close();
return true;
}
}