Browse Source
Remove tree-switching on AncestorType == null
pull/1209/head
Jeremy Koritzinsky
9 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
3 deletions
-
src/Markup/Avalonia.Markup.Xaml/Data/Binding.cs
|
|
|
@ -131,7 +131,7 @@ namespace Avalonia.Markup.Xaml.Data |
|
|
|
{ |
|
|
|
if (RelativeSource.Tree == TreeType.Visual && RelativeSource.AncestorType == null) |
|
|
|
{ |
|
|
|
throw new InvalidOperationException("AncestorType must be set for RelativeSourceModel.FindAncestor when searching the visual tree."); |
|
|
|
throw new InvalidOperationException("AncestorType must be set for RelativeSourceMode.FindAncestor when searching the visual tree."); |
|
|
|
} |
|
|
|
|
|
|
|
observer = CreateFindAncestorObserver( |
|
|
|
@ -228,7 +228,7 @@ namespace Avalonia.Markup.Xaml.Data |
|
|
|
Contract.Requires<ArgumentNullException>(target != null); |
|
|
|
|
|
|
|
return new ExpressionObserver( |
|
|
|
ControlLocator.Track(target, relativeSource.AncestorType != null ? relativeSource.Tree : TreeType.Logical, relativeSource.AncestorLevel - 1, relativeSource.AncestorType), |
|
|
|
ControlLocator.Track(target, relativeSource.Tree, relativeSource.AncestorLevel - 1, relativeSource.AncestorType), |
|
|
|
path); |
|
|
|
} |
|
|
|
|
|
|
|
@ -283,4 +283,4 @@ namespace Avalonia.Markup.Xaml.Data |
|
|
|
public RelativeSource RelativeSource { get; set; } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|