Browse Source

Use Take(1) to unsubscribe the event.

pull/2453/head
Dan Walmsley 7 years ago
parent
commit
f7fe5380b4
  1. 6
      src/Avalonia.Controls/Notifications/WindowNotificationManager.cs

6
src/Avalonia.Controls/Notifications/WindowNotificationManager.cs

@ -59,13 +59,9 @@ namespace Avalonia.Controls.Notifications
}
else
{
IDisposable stopListening = null;
stopListening = Observable.FromEventPattern<TemplateAppliedEventArgs>(host, nameof(host.TemplateApplied))
Observable.FromEventPattern<TemplateAppliedEventArgs>(host, nameof(host.TemplateApplied)).Take(1)
.Subscribe(_ =>
{
stopListening.Dispose();
Install(host);
});
}

Loading…
Cancel
Save