Files
2026-10-27 09:12:40 +08:00

31 lines
1.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: handycontrol-wpf-split-button
description: "实现、配置或排查 HandyControl WPF 的 SplitButton 分割按钮(SplitButton)。适用于该扩展控件的 XAML、绑定、事件和模板;不用于 Avalonia 或其他厂商控件。"
---
# HandyControl WPF SplitButton 分割按钮
实现或排查 **SplitButton 分割按钮**。相关类型:`SplitButton`。
## 接入
程序集/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 行为。