드래그앤 드랍 개발 중

This commit is contained in:
logonkhi
2025-10-29 20:12:11 +09:00
parent 47ca525718
commit e245ee9f96
8 changed files with 417 additions and 1266 deletions

View File

@@ -92,6 +92,8 @@ namespace UVC.UI.List.Tree
/// </summary>
private bool _isSelected = false;
private TreeListItemData? _parent;
/// <summary>
/// 이 아이템의 하위 아이템들을 모두 저장하는 리스트입니다.
///
@@ -229,6 +231,12 @@ namespace UVC.UI.List.Tree
/// </summary>
public Action<TreeListItemData>? OnClickAction;
internal TreeListItemData? Parent
{
get => _parent;
set => _parent = value;
}
/// <summary>
/// 이 아이템의 모든 자식 아이템들을 가져오거나 설정합니다.
///
@@ -334,6 +342,7 @@ namespace UVC.UI.List.Tree
/// </summary>
public void AddChild(TreeListItemData child)
{
child._parent = this;
_children.Add(child);
NotifyDataChanged(); // UI에 트리 구조 변경 알림
}
@@ -361,6 +370,7 @@ namespace UVC.UI.List.Tree
/// </summary>
public void RemoveChild(TreeListItemData child)
{
child._parent = null;
_children.Remove(child);
NotifyDataChanged(); // UI에 트리 구조 변경 알림
}
@@ -388,6 +398,10 @@ namespace UVC.UI.List.Tree
/// </summary>
public void ClearChildren()
{
foreach (var child in _children)
{
child._parent = null;
}
_children.Clear();
NotifyDataChanged(); // UI에 트리 구조 변경 알림
}