Browse Source
Merge branch 'master' into fix-black-area-inside-window
pull/2211/head
ahopper
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
14 additions and
0 deletions
-
src/Avalonia.Base/Data/Core/ExpressionNode.cs
-
tests/Avalonia.Base.UnitTests/Data/Core/ExpressionObserverTests_Property.cs
|
|
|
@ -147,6 +147,7 @@ namespace Avalonia.Data.Core |
|
|
|
private void StopListening() |
|
|
|
{ |
|
|
|
StopListeningCore(); |
|
|
|
_listening = false; |
|
|
|
} |
|
|
|
|
|
|
|
private BindingNotification TargetNullNotification() |
|
|
|
|
|
|
|
@ -563,6 +563,19 @@ namespace Avalonia.Base.UnitTests.Data.Core |
|
|
|
Assert.Null(result.Item2.Target); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public void Should_Not_Throw_Exception_On_Unsubscribe_When_Already_Unsubscribed() |
|
|
|
{ |
|
|
|
var source = new Class1 { Foo = "foo" }; |
|
|
|
var target = new PropertyAccessorNode("Foo", false); |
|
|
|
Assert.NotNull(target); |
|
|
|
target.Target = new WeakReference(source); |
|
|
|
target.Subscribe(_ => { }); |
|
|
|
target.Unsubscribe(); |
|
|
|
target.Unsubscribe(); |
|
|
|
Assert.True(true); |
|
|
|
} |
|
|
|
|
|
|
|
private interface INext |
|
|
|
{ |
|
|
|
int PropertyChangedSubscriptionCount { get; } |
|
|
|
|