Browse Source

Remove tree-switching on AncestorType == null

pull/1209/head
Jeremy Koritzinsky 9 years ago
committed by GitHub
parent
commit
1d2d2067c4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/Markup/Avalonia.Markup.Xaml/Data/Binding.cs

6
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) 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( observer = CreateFindAncestorObserver(
@ -228,7 +228,7 @@ namespace Avalonia.Markup.Xaml.Data
Contract.Requires<ArgumentNullException>(target != null); Contract.Requires<ArgumentNullException>(target != null);
return new ExpressionObserver( 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); path);
} }
@ -283,4 +283,4 @@ namespace Avalonia.Markup.Xaml.Data
public RelativeSource RelativeSource { get; set; } public RelativeSource RelativeSource { get; set; }
} }
} }
} }

Loading…
Cancel
Save