toolbar 개발 중
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace UVC.UI.ToolBar
|
||||
namespace UVC.UI.Toolbar
|
||||
{
|
||||
/// <summary>
|
||||
/// 클릭 시 하위 버튼 그룹을 확장하여 보여주는 버튼입니다.
|
||||
@@ -22,12 +22,22 @@ namespace UVC.UI.ToolBar
|
||||
SubButtons = new List<ToolbarButtonBase>();
|
||||
}
|
||||
|
||||
public override void ExecuteClick()
|
||||
// 주 버튼 클릭 시 하위 메뉴를 토글하는 동작은 View에서 처리될 수 있고,
|
||||
// ClickCommand는 주 버튼 자체의 액션(있다면)을 정의합니다.
|
||||
// 또는 ClickCommand가 하위 메뉴 토글 로직을 포함할 수도 있습니다.
|
||||
// 여기서는 ClickCommand는 주 버튼의 고유 액션, 하위 메뉴 토글은 View의 역할로 가정합니다.
|
||||
public override void ExecuteClick(object parameter = null)
|
||||
{
|
||||
if (IsEnabled)
|
||||
{
|
||||
OnClick?.Invoke();
|
||||
}
|
||||
if (!IsEnabled) return;
|
||||
|
||||
// ClickCommand는 주 버튼 자체의 액션 (예: 상태 변경, 특정 기능 수행)
|
||||
ClickCommand?.Execute(parameter);
|
||||
|
||||
// 하위 메뉴를 여는 동작은 보통 View에서 이 버튼 클릭 시 별도로 처리합니다.
|
||||
// OnClick (이제 ClickCommand)이 그 역할을 할 수도 있지만,
|
||||
// View에서 직접 ToggleSubMenu를 호출하는 것이 더 명확할 수 있습니다.
|
||||
// ToolbarView의 SetupButtonVisualsAndInteractions에서 expandableModel.ExecuteClick() 후
|
||||
// ToggleSubMenu()를 호출하는 현재 구조를 유지할 수 있습니다.
|
||||
}
|
||||
|
||||
public void SelectSubButton(ToolbarButtonBase selectedSubButton)
|
||||
@@ -40,9 +50,9 @@ namespace UVC.UI.ToolBar
|
||||
this.Text = selectedSubButton.Text; // Setter가 OnStateChanged 호출 (단, Text가 실제로 변경되어야 함)
|
||||
changed = true;
|
||||
}
|
||||
if (this.Icon != selectedSubButton.Icon)
|
||||
if (this.IconSpritePath != selectedSubButton.IconSpritePath)
|
||||
{
|
||||
this.Icon = selectedSubButton.Icon; // Setter가 OnStateChanged 호출
|
||||
this.IconSpritePath = selectedSubButton.IconSpritePath; // Setter가 OnStateChanged 호출
|
||||
changed = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user