feat(工具栏设置): 添加工具栏配置页面及功能实现

实现工具栏配置页面,允许用户调整工具栏按钮的顺序和可见性
包含主工具栏、画布控制和尾部按钮三个区域的配置
支持恢复默认布局功能
This commit is contained in:
PrefacedCorg
2026-05-02 13:41:02 +08:00
parent 7736d88657
commit 723c0b9cdc
18 changed files with 714 additions and 206 deletions
+4 -8
View File
@@ -2,28 +2,24 @@ using System.Windows;
namespace Ink_Canvas.Controls.Toolbar
{
/// <summary>
/// 一个工具栏按钮(或任意浮动栏/白板栏条目)的插件化契约。
/// 实现类必须有无参构造函数,启动时会被 ToolbarRegistry 反射实例化。
/// </summary>
public interface IToolbarItem
{
/// <summary>稳定、唯一的 id,用于持久化用户配置。不要随便改。</summary>
string Id { get; }
ToolbarSlot DefaultSlot { get; }
/// <summary>同一 slot 内的默认顺序,小的在前。</summary>
int DefaultOrder { get; }
bool DefaultVisible { get; }
ToolbarInsertPosition DefaultPosition { get; }
/// <summary>仅当 Position 为 BeforeAnchor/AfterAnchor 时有意义,对应 XAML 里 x:Name。</summary>
string DefaultAnchorName { get; }
/// <summary>构造 UI 元素并接线所有行为。</summary>
string DisplayName { get; }
string MenuPanelName { get; }
FrameworkElement BuildView(IToolbarHost host);
}
}