드래그앤 드랍 개발 중
This commit is contained in:
@@ -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에 트리 구조 변경 알림
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user