// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Microsoft.AspNetCore.Components; namespace AntDesign { public partial class TreeIndent : ComponentBase { /// /// Root Tree /// [CascadingParameter(Name = "Tree")] public Tree TreeComponent { get; set; } /// /// Current Node /// [CascadingParameter(Name = "SelfNode")] public TreeNode SelfNode { get; set; } [Parameter] public int TreeLevel { get; set; } /// /// To find specific level parent node /// /// /// /// private static TreeNode GetParentNode(TreeNode node, int level) { if (level > 0 && node.ParentNode != null) { return GetParentNode(node.ParentNode, level - 1); } return node; } } }