|
|
@@ -3,6 +3,7 @@
|
|
|
|
|
|
using System;
|
|
|
using System.Linq;
|
|
|
+using System.Reactive.Disposables;
|
|
|
using System.Runtime.CompilerServices;
|
|
|
using Avalonia.Collections;
|
|
|
using Avalonia.Controls.Presenters;
|
|
|
@@ -75,6 +76,12 @@ namespace Avalonia.Controls.Mixins
|
|
|
null,
|
|
|
presenter.GetValue(ContentPresenter.ChildProperty));
|
|
|
|
|
|
+ if (subscriptions.Value.TryGetValue(sender, out IDisposable previousSubscription))
|
|
|
+ {
|
|
|
+ subscription = new CompositeDisposable(previousSubscription, subscription);
|
|
|
+ subscriptions.Value.Remove(sender);
|
|
|
+ }
|
|
|
+
|
|
|
subscriptions.Value.Add(sender, subscription);
|
|
|
}
|
|
|
}
|