feat(skills): add HandyControl WPF component skills
Build / build (push) Canceled after 0s

This commit is contained in:
chfei committed 2026-10-27 09:12:40 +08:00
1 parent 72d9b295a0
commit 5d81c475c8
335 files changed
+7359

No files matched your search

@@ -0,0 +1,30 @@
---
name: handycontrol-wpf-relative-panel
description: "实现、配置或排查 HandyControl WPF 的 RelativePanel 相对布局(RelativePanel)。适用于该扩展控件的 XAML、绑定、事件和模板;不用于 Avalonia 或其他厂商控件。"
---
# HandyControl WPF RelativePanel 相对布局
实现或排查 **RelativePanel 相对布局**。相关类型:`RelativePanel`。
## 接入
程序集/NuGet 为 `HandyControl`,XAML 命名空间为
`xmlns:hc="https://handyorg.github.io/handycontrol"`,C# 控件命名空间为 `HandyControl.Controls`。
在 `App.xaml` 合并 `pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml`,
然后合并 `pack://application:,,,/HandyControl;component/Themes/Theme.xaml`。
已有主题配置时先检查,避免重复合并。版本和目标框架以使用方项目为准。
## 实现
先读 [API 声明与继承关系](references/api.md),再按需求查看
[文档、样式与示例导航](references/usage.md)。源码路径相对于 HandyControl 仓库根目录;
在本仓库优先读本地文件,安装到其他项目后使用内附声明与链接,遇到版本差异检查实际引用版本的源码。
不要将 Demo 的 langs、ex:Lang、ViewModelLocator 或示例资源直接复制进使用方项目。
结合基类确认内容模型、绑定属性和事件参数;集合控件区分 ItemsSource、选中项与 ItemTemplate;修改样式前核对资源键和模板部件。
用目标项目现有的 MVVM 方式绑定;需要回写时明确 TwoWay 和更新时机,
不要假定所有依赖属性默认双向绑定。原生 WPF 与 HandyControl 同名类型使用命名空间区分。
交付时运行目标框架的构建,并在窗口加载后检查模板、绑定错误、空值和相关输入边界;
无法运行 WPF 时明确说明尚未验证 UI 行为。
@@ -0,0 +1,4 @@
interface:
display_name: "HandyControl WPF RelativePanel 相对布局"
short_description: "Implement HandyControl WPF controls from verified source guidance"
default_prompt: "Use $handycontrol-wpf-relative-panel to implement the requested HandyControl WPF UI."
@@ -0,0 +1,74 @@
# 源码 API 导航
下面是当前工作区的声明摘录,不是完整 C# 文件,不包含全部继承成员、访问器和条件编译条件。属性是否可写、依赖属性默认值、枚举成员和目标框架限制,需打开对应源码核对。
## RelativePanel
源码:[src/Shared/HandyControl_Shared/Controls/Panel/RelativePanel.cs](https://github.com/HandyOrg/HandyControl/blob/master/src/Shared/HandyControl_Shared/Controls/Panel/RelativePanel.cs)
```text
public class RelativePanel : Panel
public RelativePanel()
public static void SetAlignLeftWithPanel(DependencyObject element, bool value)
public static bool GetAlignLeftWithPanel(DependencyObject element)
public static void SetAlignTopWithPanel(DependencyObject element, bool value)
public static bool GetAlignTopWithPanel(DependencyObject element)
public static void SetAlignRightWithPanel(DependencyObject element, bool value)
public static bool GetAlignRightWithPanel(DependencyObject element)
public static void SetAlignBottomWithPanel(DependencyObject element, bool value)
public static bool GetAlignBottomWithPanel(DependencyObject element)
public static void SetAlignLeftWith(DependencyObject element, UIElement value)
public static UIElement GetAlignLeftWith(DependencyObject element)
public static void SetAlignTopWith(DependencyObject element, UIElement value)
public static UIElement GetAlignTopWith(DependencyObject element)
public static void SetAlignRightWith(DependencyObject element, UIElement value)
public static UIElement GetAlignRightWith(DependencyObject element)
public static void SetAlignBottomWith(DependencyObject element, UIElement value)
public static UIElement GetAlignBottomWith(DependencyObject element)
public static void SetLeftOf(DependencyObject element, UIElement value)
public static UIElement GetLeftOf(DependencyObject element)
public static void SetAbove(DependencyObject element, UIElement value)
public static UIElement GetAbove(DependencyObject element)
public static void SetRightOf(DependencyObject element, UIElement value)
public static UIElement GetRightOf(DependencyObject element)
public static void SetBelow(DependencyObject element, UIElement value)
public static UIElement GetBelow(DependencyObject element)
public static void SetAlignHorizontalCenterWithPanel(DependencyObject element, bool value)
public static bool GetAlignHorizontalCenterWithPanel(DependencyObject element)
public static void SetAlignVerticalCenterWithPanel(DependencyObject element, bool value)
public static bool GetAlignVerticalCenterWithPanel(DependencyObject element)
public static void SetAlignHorizontalCenterWith(DependencyObject element, UIElement value)
public static UIElement GetAlignHorizontalCenterWith(DependencyObject element)
public static void SetAlignVerticalCenterWith(DependencyObject element, UIElement value)
public static UIElement GetAlignVerticalCenterWith(DependencyObject element)
public bool Measured
public UIElement Element
public Size OriginDesiredSize
public double Left
public double Top
public double Right
public double Bottom
public HashSet<GraphNode> OutgoingNodes
public GraphNode AlignLeftWithNode
public GraphNode AlignTopWithNode
public GraphNode AlignRightWithNode
public GraphNode AlignBottomWithNode
public GraphNode LeftOfNode
public GraphNode AboveNode
public GraphNode RightOfNode
public GraphNode BelowNode
public GraphNode AlignHorizontalCenterWith
public GraphNode AlignVerticalCenterWith
public GraphNode(UIElement element)
public void Arrange(Size arrangeSize)
public void Reset(bool clearPos)
public Size GetBoundingSize()
public Graph()
public IEnumerable<GraphNode> GetNodes()
public void Clear()
public void Reset(bool clearPos = true)
public GraphNode AddLink(GraphNode from, UIElement to)
public GraphNode AddNode(UIElement value)
public void Measure(Size availableSize)
public Size GetBoundingSize(bool calcWidth, bool calcHeight)
```
@@ -0,0 +1,16 @@
# RelativePanel 相对布局 使用导航
文档:[doc/source/handycontrol/extend_controls/relativePanel/index.md](https://github.com/HandyOrg/HandyControl/blob/master/doc/source/handycontrol/extend_controls/relativePanel/index.md)
在线文档:[控件说明](https://handyorg.github.io/handycontrol/extend_controls/relativePanel/)
按任务阅读原文中的章节:属性、案例。
## 当前源码
- [src/Shared/HandyControl_Shared/Controls/Panel/RelativePanel.cs](https://github.com/HandyOrg/HandyControl/blob/master/src/Shared/HandyControl_Shared/Controls/Panel/RelativePanel.cs)
## 样式及官方示例
- [src/Shared/HandyControlDemo_Shared/UserControl/Controls/RelativePanelDemo.xaml](https://github.com/HandyOrg/HandyControl/blob/master/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RelativePanelDemo.xaml)
- [src/Shared/HandyControlDemo_Shared/UserControl/Controls/RelativePanelDemo.xaml.cs](https://github.com/HandyOrg/HandyControl/blob/master/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RelativePanelDemo.xaml.cs)