From 1d2d2067c4430b1b85b1b8d91b4625bc3de8d122 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Sun, 19 Nov 2017 17:29:21 -0600 Subject: [PATCH] Remove tree-switching on AncestorType == null --- src/Markup/Avalonia.Markup.Xaml/Data/Binding.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Markup/Avalonia.Markup.Xaml/Data/Binding.cs b/src/Markup/Avalonia.Markup.Xaml/Data/Binding.cs index 2a65504347..8ba637de50 100644 --- a/src/Markup/Avalonia.Markup.Xaml/Data/Binding.cs +++ b/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(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; } } } -} \ No newline at end of file +}