feat: update per review.
This commit is contained in:
@@ -5,7 +5,7 @@ namespace Ursa.Common;
|
|||||||
|
|
||||||
public static class LogicalHelpers
|
public static class LogicalHelpers
|
||||||
{
|
{
|
||||||
public static int CalculateDistanceFromLogicalParent<T, TItem>(TItem? item, int @default = -1)
|
public static int CalculateDistanceFromLogicalParent<T, TItem>(TItem? item, int defaultValue = -1)
|
||||||
where T : class
|
where T : class
|
||||||
where TItem : ILogical
|
where TItem : ILogical
|
||||||
{
|
{
|
||||||
@@ -16,6 +16,6 @@ public static class LogicalHelpers
|
|||||||
if (logical is TItem) result++;
|
if (logical is TItem) result++;
|
||||||
logical = logical.LogicalParent;
|
logical = logical.LogicalParent;
|
||||||
}
|
}
|
||||||
return item is not null ? result : @default;
|
return item is not null ? result : defaultValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -201,7 +201,8 @@ public class Anchor : ItemsControl
|
|||||||
protected override void OnUnloaded(RoutedEventArgs e)
|
protected override void OnUnloaded(RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnUnloaded(e);
|
base.OnUnloaded(e);
|
||||||
TargetContainer?.RemoveHandler(UnloadedEvent, OnTargetContainerLoaded);
|
TargetContainer?.RemoveHandler(LoadedEvent, OnTargetContainerLoaded);
|
||||||
|
TargetContainer?.RemoveHandler(ScrollViewer.ScrollChangedEvent, OnScrollChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnTargetContainerLoaded(object? sender, RoutedEventArgs e)
|
private void OnTargetContainerLoaded(object? sender, RoutedEventArgs e)
|
||||||
|
|||||||
Reference in New Issue
Block a user