Browse Source

remove unecesary event

pull/2453/head
Dan Walmsley 7 years ago
parent
commit
4e1baec04b
  1. 18
      src/Avalonia.Controls/Notifications/NotificationCard.cs

18
src/Avalonia.Controls/Notifications/NotificationCard.cs

@ -25,7 +25,7 @@ namespace Avalonia.Controls.Notifications
this.GetObservable(IsClosedProperty) this.GetObservable(IsClosedProperty)
.Subscribe(x => .Subscribe(x =>
{ {
if (!IsClosing & !IsClosed) if (!IsClosing && !IsClosed)
{ {
return; return;
} }
@ -88,26 +88,12 @@ namespace Avalonia.Controls.Notifications
public static readonly DirectProperty<NotificationCard, bool> IsClosedProperty = public static readonly DirectProperty<NotificationCard, bool> IsClosedProperty =
AvaloniaProperty.RegisterDirect<NotificationCard, bool>(nameof(IsClosed), o => o.IsClosed, (o, v) => o.IsClosed = v); AvaloniaProperty.RegisterDirect<NotificationCard, bool>(nameof(IsClosed), o => o.IsClosed, (o, v) => o.IsClosed = v);
/// <summary>
/// Defines the <see cref="NotificationCloseInvoked"/> event.
/// </summary>
public static readonly RoutedEvent<RoutedEventArgs> NotificationCloseInvokedEvent =
RoutedEvent.Register<NotificationCard, RoutedEventArgs>(nameof(NotificationCloseInvoked), RoutingStrategies.Bubble);
/// <summary> /// <summary>
/// Defines the <see cref="NotificationClosed"/> event. /// Defines the <see cref="NotificationClosed"/> event.
/// </summary> /// </summary>
public static readonly RoutedEvent<RoutedEventArgs> NotificationClosedEvent = public static readonly RoutedEvent<RoutedEventArgs> NotificationClosedEvent =
RoutedEvent.Register<NotificationCard, RoutedEventArgs>(nameof(NotificationClosed), RoutingStrategies.Bubble); RoutedEvent.Register<NotificationCard, RoutedEventArgs>(nameof(NotificationClosed), RoutingStrategies.Bubble);
/// <summary>
/// Raised when notification close event is invoked.
/// </summary>
public event EventHandler<RoutedEventArgs> NotificationCloseInvoked
{
add { AddHandler(NotificationCloseInvokedEvent, value); }
remove { RemoveHandler(NotificationCloseInvokedEvent, value); }
}
/// <summary> /// <summary>
/// Raised when the <see cref="NotificationCard"/> has closed. /// Raised when the <see cref="NotificationCard"/> has closed.
@ -169,8 +155,6 @@ namespace Avalonia.Controls.Notifications
} }
IsClosing = true; IsClosing = true;
RaiseEvent(new RoutedEventArgs(NotificationCloseInvokedEvent));
} }
} }
} }

Loading…
Cancel
Save