mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-05 21:47:38 +08:00
300123045f
* delete demo docs * fix tree default value and dnd * fix tree line and keys * fix switcher icon and line * fix line demo * fix switcher * add DirectoryTree demo * fix draggable demo * clean code * clean code * clean up the classmapper call * update docs * fix the docs * fix comment Co-authored-by: James Yeung <shunjiey@hotmail.com>
43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
// 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<TItem> : ComponentBase
|
|
{
|
|
/// <summary>
|
|
/// Root Tree
|
|
/// </summary>
|
|
[CascadingParameter(Name = "Tree")]
|
|
public Tree<TItem> TreeComponent { get; set; }
|
|
|
|
/// <summary>
|
|
/// Current Node
|
|
/// </summary>
|
|
[CascadingParameter(Name = "SelfNode")]
|
|
public TreeNode<TItem> SelfNode { get; set; }
|
|
|
|
[Parameter]
|
|
public int TreeLevel { get; set; }
|
|
|
|
/// <summary>
|
|
/// To find specific level parent node
|
|
/// </summary>
|
|
/// <param name="node"></param>
|
|
/// <param name="level"></param>
|
|
/// <returns></returns>
|
|
private static TreeNode<TItem> GetParentNode(TreeNode<TItem> node, int level)
|
|
{
|
|
if (level > 0 && node.ParentNode != null)
|
|
{
|
|
return GetParentNode(node.ParentNode, level - 1);
|
|
}
|
|
|
|
return node;
|
|
}
|
|
}
|
|
}
|