|
|
|
@ -3,9 +3,6 @@ |
|
|
|
|
|
|
|
using System; |
|
|
|
using System.Linq; |
|
|
|
using System.Reactive.Linq; |
|
|
|
using System.Reflection; |
|
|
|
using Avalonia.Controls; |
|
|
|
using Avalonia.Reactive; |
|
|
|
|
|
|
|
namespace Avalonia.LogicalTree |
|
|
|
@ -25,7 +22,7 @@ namespace Avalonia.LogicalTree |
|
|
|
private readonly ILogical _relativeTo; |
|
|
|
private readonly int _ancestorLevel; |
|
|
|
private readonly Type _ancestorType; |
|
|
|
ILogical _value; |
|
|
|
private ILogical _value; |
|
|
|
|
|
|
|
public ControlTracker(ILogical relativeTo, int ancestorLevel, Type ancestorType) |
|
|
|
{ |
|
|
|
@ -69,7 +66,7 @@ namespace Avalonia.LogicalTree |
|
|
|
private void Update() |
|
|
|
{ |
|
|
|
_value = _relativeTo.GetLogicalAncestors() |
|
|
|
.Where(x => _ancestorType?.GetTypeInfo().IsAssignableFrom(x.GetType().GetTypeInfo()) ?? true) |
|
|
|
.Where(x => _ancestorType?.IsAssignableFrom(x.GetType()) ?? true) |
|
|
|
.ElementAtOrDefault(_ancestorLevel); |
|
|
|
} |
|
|
|
} |
|
|
|
|