syncfusion-wpf-splitbutton
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImplementing Syncfusion WPF SplitButton
实现Syncfusion WPF SplitButton
The Syncfusion WPF SplitButton () is a combination of a button and a menu control. The button provides a default action, while clicking the arrow displays a dropdown list for additional selections. This control is ideal for scenarios where you need both a primary action and alternative options.
SplitButtonAdvSyncfusion WPF SplitButton()是按钮和菜单控件的组合。按钮提供默认操作,点击箭头则显示下拉列表以进行额外选择。该控件非常适合既需要主操作又需要备选选项的场景。
SplitButtonAdvWhen to Use This Skill
何时使用此技能
Use this skill when you need to:
- Implement WPF splitbutton controls with default actions and dropdown menus
- Create button-dropdown combinations for multiple action selections
- Build data-bound dropdown menus with ItemsSource binding
- Implement command patterns with ICommand and MVVM architecture
- Configure dropdown menu items with icons, checkboxes, and custom items
- Handle splitbutton events like dropdown opening/closing and item clicks
- Apply size modes (Small, Normal, Large) with custom icons
- Customize splitbutton appearance with themes and templates
- Support multiline text in large button modes
- Enable/disable actions using CanExecute command logic
在以下场景中可使用此技能:
- 实现带默认操作和下拉菜单的WPF拆分按钮控件
- 创建用于多操作选择的按钮-下拉组合
- 构建带ItemsSource绑定的数据绑定下拉菜单
- 结合ICommand和MVVM架构实现命令模式
- 配置带图标、复选框和自定义项的下拉菜单项
- 处理拆分按钮的下拉打开/关闭和项点击事件
- 应用带自定义图标的大小模式(Small、Normal、Large)
- 通过主题和模板自定义拆分按钮外观
- 在大按钮模式下支持多行文本
- 使用CanExecute命令逻辑启用/禁用操作
Component Overview
组件概述
Key Features
核心特性
- Dual Action: Primary button action + dropdown menu for alternatives
- Data Binding: Full ItemsSource and DataTemplate support for MVVM
- Command Binding: ICommand support for button and menu items with CanExecute
- Size Modes: Small (icon only), Normal (icon + text), Large (large icon + text)
- Icon Templates: Support for path data, font icons, and custom templates
- Customizable Menu Items: Icons, checkboxes, scrollbars, and custom content
- Dropdown Direction: Control popup position (Left, Right, BottomLeft, etc.)
- Events: Opening, Opened, Closing, Closed, Click, IsCheckedChanged
- Theming: Built-in themes via SfSkinManager and custom theme support
- Multiline Text: Display multi-line labels in large size mode
- 双重操作:主按钮操作 + 用于备选选项的下拉菜单
- 数据绑定:完全支持ItemsSource和DataTemplate,适配MVVM
- 命令绑定:支持ICommand,可绑定按钮和菜单项,并支持CanExecute
- 大小模式:Small(仅图标)、Normal(图标+文本)、Large(大图标+文本)
- 图标模板:支持路径数据、字体图标和自定义模板
- 可自定义菜单项:图标、复选框、滚动条和自定义内容
- 下拉方向:控制弹出位置(Left、Right、BottomLeft等)
- 事件:Opening、Opened、Closing、Closed、Click、IsCheckedChanged
- 主题支持:通过SfSkinManager内置主题,同时支持自定义主题
- 多行文本:在大尺寸模式下显示多行标签
Control Structure
控件结构
SplitButtonAdv
├── Primary Button (default action)
│ ├── Label (text)
│ ├── Icon (SmallIcon/LargeIcon/IconTemplate)
│ └── Command (ICommand binding)
└── Dropdown Arrow (opens menu)
└── DropDownMenuGroup (container)
├── DropDownMenuItem (standard items)
│ ├── Header (text)
│ ├── Icon (image)
│ ├── IsCheckable (checkbox support)
│ └── Command (ICommand binding)
└── MoreItems (custom UIElement items)SplitButtonAdv
├── Primary Button (default action)
│ ├── Label (text)
│ ├── Icon (SmallIcon/LargeIcon/IconTemplate)
│ └── Command (ICommand binding)
└── Dropdown Arrow (opens menu)
└── DropDownMenuGroup (container)
├── DropDownMenuItem (standard items)
│ ├── Header (text)
│ ├── Icon (image)
│ ├── IsCheckable (checkbox support)
│ └── Command (ICommand binding)
└── MoreItems (custom UIElement items)Documentation and Navigation Guide
文档与导航指南
This skill uses progressive disclosure. Read the appropriate reference file based on your implementation needs:
本技能采用渐进式披露方式,请根据你的实现需求阅读对应的参考文档:
Getting Started
入门指南
📄 Read: references/getting-started.md
When to read: Setting up a new splitbutton, need basic configuration
Topics covered:
- Installation and assembly deployment (Syncfusion.Shared.WPF)
- Adding control via designer, XAML, or C# code
- Setting label text and basic properties
- Size modes: Small (icon only), Normal (icon + text), Large (large icon + text)
- Icon templates and icon template selectors for custom icons
- Setting images using SmallIcon and LargeIcon properties
- Configuring icon width and height
- IsDefault mode for Enter key activation
- Adding menu items to DropDownMenuGroup
📄 阅读: references/getting-started.md
阅读时机:设置新的拆分按钮,需要基础配置时
涵盖主题:
- 安装和程序集部署(Syncfusion.Shared.WPF)
- 通过设计器、XAML或C#代码添加控件
- 设置标签文本和基础属性
- 大小模式:Small(仅图标)、Normal(图标+文本)、Large(大图标+文本)
- 用于自定义图标的图标模板和图标模板选择器
- 使用SmallIcon和LargeIcon属性设置图片
- 配置图标宽度和高度
- 启用IsDefault模式以支持Enter键激活
- 向DropDownMenuGroup添加菜单项
Dropdown Menu Items Configuration
下拉菜单项配置
📄 Read: references/dropdown-menu-items.md
When to read: Configuring menu item appearance, adding custom items, enabling scrollbars
Topics covered:
- Setting icons for dropdown menu items
- Icon bar visibility (IconBarEnabled property)
- Scrollbar visibility for large menu lists
- Checkable dropdown menu items (IsCheckable/IsChecked)
- Resizing dropdown menu with gripper (IsResizable)
- Adding custom dropdown menu items via MoreItems property
- Icon bar visibility for custom items (IsMoreItemsIconTrayEnabled)
📄 阅读: references/dropdown-menu-items.md
阅读时机:配置菜单项外观、添加自定义项、启用滚动条时
涵盖主题:
- 为下拉菜单项设置图标
- 图标栏可见性(IconBarEnabled属性)
- 长菜单列表的滚动条可见性
- 可勾选的下拉菜单项(IsCheckable/IsChecked)
- 通过抓手调整下拉菜单大小(IsResizable)
- 通过MoreItems属性添加自定义下拉菜单项
- 自定义项的图标栏可见性(IsMoreItemsIconTrayEnabled)
Data Binding
数据绑定
📄 Read: references/data-binding.md
When to read: Implementing MVVM patterns, binding collections to dropdown items
Topics covered:
- Creating model classes for menu item data
- Creating view models with observable collections
- Binding ItemsSource to DropDownMenuGroup
- Using ItemTemplate and DataTemplate for menu items
- Setting DataContext for data binding
- Binding commands from view model to menu items
- Complete MVVM implementation examples
- DelegateCommand pattern for ICommand
📄 阅读: references/data-binding.md
阅读时机:实现MVVM模式,将集合绑定到下拉项时
涵盖主题:
- 为菜单项数据创建模型类
- 创建带可观察集合的视图模型
- 将ItemsSource绑定到DropDownMenuGroup
- 为菜单项使用ItemTemplate和DataTemplate
- 设置DataContext以实现数据绑定
- 将视图模型中的命令绑定到菜单项
- 完整的MVVM实现示例
- 用于ICommand的DelegateCommand模式
Command Binding
命令绑定
📄 Read: references/command-binding.md
When to read: Implementing command patterns, handling button/menu item actions
Topics covered:
- Command property overview and ICommand interface
- CommandParameter for passing data to command handlers
- DelegateCommand implementation pattern
- Binding commands to SplitButtonAdv primary button
- Binding commands to dropdown menu items
- CanExecute logic for enabling/disabling actions
- RaiseCanExecuteChanged for dynamic command state
- Complete command binding examples with NotificationObject
📄 阅读: references/command-binding.md
阅读时机:实现命令模式,处理按钮/菜单项操作时
涵盖主题:
- Command属性概述和ICommand接口
- CommandParameter:向命令处理程序传递数据
- DelegateCommand实现模式
- 将命令绑定到SplitButtonAdv主按钮
- 将命令绑定到下拉菜单项
- 用于启用/禁用操作的CanExecute逻辑
- RaiseCanExecuteChanged:动态更新命令状态
- 结合NotificationObject的完整命令绑定示例
Dropdown Configuration and Events
下拉配置与事件
📄 Read: references/dropdown-configuration.md
When to read: Controlling dropdown position, handling events, enabling multiline text
Topics covered:
- Dropdown direction options (Left, Right, BottomLeft, BottomRight, TopLeft, TopRight)
- DropDownOpening and DropDownOpened events
- DropDownClosing and DropDownClosed events
- Click event for button and menu items
- IsCheckedChanged event for checkable items
- Multiline text support (IsMultiLine property)
- Event handler implementation patterns
📄 阅读: references/dropdown-configuration.md
阅读时机:控制下拉位置、处理事件、启用多行文本时
涵盖主题:
- 下拉方向选项(Left、Right、BottomLeft、BottomRight、TopLeft、TopRight)
- DropDownOpening和DropDownOpened事件
- DropDownClosing和DropDownClosed事件
- 按钮和菜单项的Click事件
- 可勾选项的IsCheckedChanged事件
- 多行文本支持(IsMultiLine属性)
- 事件处理程序实现模式
Customization and Theming
自定义与主题
📄 Read: references/customization.md
When to read: Applying themes, customizing appearance, creating templates
Topics covered:
- WPF styles and templates overview
- Editing appearance in Expression Blend
- Editing appearance in Visual Studio
- Creating ControlTemplate resources
- Applying built-in themes with SfSkinManager
- Creating custom themes using ThemeStudio
- Template resource location options
📄 阅读: references/customization.md
阅读时机:应用主题、自定义外观、创建模板时
涵盖主题:
- WPF样式和模板概述
- 在Expression Blend中编辑外观
- 在Visual Studio中编辑外观
- 创建ControlTemplate资源
- 通过SfSkinManager应用内置主题
- 使用ThemeStudio创建自定义主题
- 模板资源位置选项
Quick Start Example
快速开始示例
Basic SplitButton with Dropdown Menu
带下拉菜单的基础SplitButton
xaml
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf">
<Grid>
<syncfusion:SplitButtonAdv Label="Colors"
SizeMode="Normal"
Click="SplitButton_Click">
<syncfusion:DropDownMenuGroup>
<syncfusion:DropDownMenuItem Header="Red"
Click="MenuItem_Click"/>
<syncfusion:DropDownMenuItem Header="Green"
Click="MenuItem_Click"/>
<syncfusion:DropDownMenuItem Header="Blue"
Click="MenuItem_Click"/>
</syncfusion:DropDownMenuGroup>
</syncfusion:SplitButtonAdv>
</Grid>
</Window>csharp
using Syncfusion.Windows.Tools.Controls;
private void SplitButton_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("Primary action executed");
}
private void MenuItem_Click(object sender, RoutedEventArgs e)
{
var menuItem = sender as DropDownMenuItem;
MessageBox.Show($"Selected: {menuItem.Header}");
}xaml
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf">
<Grid>
<syncfusion:SplitButtonAdv Label="Colors"
SizeMode="Normal"
Click="SplitButton_Click">
<syncfusion:DropDownMenuGroup>
<syncfusion:DropDownMenuItem Header="Red"
Click="MenuItem_Click"/>
<syncfusion:DropDownMenuItem Header="Green"
Click="MenuItem_Click"/>
<syncfusion:DropDownMenuItem Header="Blue"
Click="MenuItem_Click"/>
</syncfusion:DropDownMenuGroup>
</syncfusion:SplitButtonAdv>
</Grid>
</Window>csharp
using Syncfusion.Windows.Tools.Controls;
private void SplitButton_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("Primary action executed");
}
private void MenuItem_Click(object sender, RoutedEventArgs e)
{
var menuItem = sender as DropDownMenuItem;
MessageBox.Show($"Selected: {menuItem.Header}");
}Common Patterns
常见模式
Pattern 1: Data-Bound SplitButton with MVVM
模式1:基于MVVM的数据绑定SplitButton
xaml
<syncfusion:SplitButtonAdv Label="Country" SizeMode="Normal">
<syncfusion:DropDownMenuGroup ItemsSource="{Binding Countries}">
<syncfusion:DropDownMenuGroup.ItemTemplate>
<DataTemplate>
<syncfusion:DropDownMenuItem
Header="{Binding Name}"
Command="{Binding DataContext.SelectCountryCommand,
RelativeSource={RelativeSource AncestorType=syncfusion:SplitButtonAdv}}"
CommandParameter="{Binding}">
<syncfusion:DropDownMenuItem.Icon>
<Image Source="{Binding FlagIcon}"/>
</syncfusion:DropDownMenuItem.Icon>
</syncfusion:DropDownMenuItem>
</DataTemplate>
</syncfusion:DropDownMenuGroup.ItemTemplate>
</syncfusion:DropDownMenuGroup>
</syncfusion:SplitButtonAdv>xaml
<syncfusion:SplitButtonAdv Label="Country" SizeMode="Normal">
<syncfusion:DropDownMenuGroup ItemsSource="{Binding Countries}">
<syncfusion:DropDownMenuGroup.ItemTemplate>
<DataTemplate>
<syncfusion:DropDownMenuItem
Header="{Binding Name}"
Command="{Binding DataContext.SelectCountryCommand,
RelativeSource={RelativeSource AncestorType=syncfusion:SplitButtonAdv}}"
CommandParameter="{Binding}">
<syncfusion:DropDownMenuItem.Icon>
<Image Source="{Binding FlagIcon}"/>
</syncfusion:DropDownMenuItem.Icon>
</syncfusion:DropDownMenuItem>
</DataTemplate>
</syncfusion:DropDownMenuGroup.ItemTemplate>
</syncfusion:DropDownMenuGroup>
</syncfusion:SplitButtonAdv>Pattern 2: Command Binding with CanExecute
模式2:带CanExecute的命令绑定
csharp
public class ViewModel : NotificationObject
{
private bool _canPerformAction = true;
public DelegateCommand<object> ClickCommand { get; set; }
public bool CanPerformAction
{
get => _canPerformAction;
set
{
_canPerformAction = value;
ClickCommand.RaiseCanExecuteChanged();
RaisePropertyChanged(nameof(CanPerformAction));
}
}
public ViewModel()
{
ClickCommand = new DelegateCommand<object>(
ExecuteAction,
CanExecuteAction);
}
private bool CanExecuteAction(object parameter) => CanPerformAction;
private void ExecuteAction(object parameter)
{
MessageBox.Show($"Action executed: {parameter}");
}
}xaml
<syncfusion:SplitButtonAdv Label="Action"
Command="{Binding ClickCommand}"
CommandParameter="Primary Action">
<!-- Dropdown items -->
</syncfusion:SplitButtonAdv>csharp
public class ViewModel : NotificationObject
{
private bool _canPerformAction = true;
public DelegateCommand<object> ClickCommand { get; set; }
public bool CanPerformAction
{
get => _canPerformAction;
set
{
_canPerformAction = value;
ClickCommand.RaiseCanExecuteChanged();
RaisePropertyChanged(nameof(CanPerformAction));
}
}
public ViewModel()
{
ClickCommand = new DelegateCommand<object>(
ExecuteAction,
CanExecuteAction);
}
private bool CanExecuteAction(object parameter) => CanPerformAction;
private void ExecuteAction(object parameter)
{
MessageBox.Show($"Action executed: {parameter}");
}
}xaml
<syncfusion:SplitButtonAdv Label="Action"
Command="{Binding ClickCommand}"
CommandParameter="Primary Action">
<!-- Dropdown items -->
</syncfusion:SplitButtonAdv>Pattern 3: Large Button with Icon Template
模式3:带图标模板的大按钮
xaml
<Window.Resources>
<DataTemplate x:Key="customIconTemplate">
<Grid Width="32" Height="32">
<Path Data="M10,0 L20,10 L10,20 L0,10 Z"
Fill="#FF3A3A38"
Stretch="Fill"/>
</Grid>
</DataTemplate>
</Window.Resources>
<syncfusion:SplitButtonAdv Label="Custom Icon"
SizeMode="Large"
IconTemplate="{StaticResource customIconTemplate}">
<!-- Dropdown items -->
</syncfusion:SplitButtonAdv>xaml
<Window.Resources>
<DataTemplate x:Key="customIconTemplate">
<Grid Width="32" Height="32">
<Path Data="M10,0 L20,10 L10,20 L0,10 Z"
Fill="#FF3A3A38"
Stretch="Fill"/>
</Grid>
</DataTemplate>
</Window.Resources>
<syncfusion:SplitButtonAdv Label="Custom Icon"
SizeMode="Large"
IconTemplate="{StaticResource customIconTemplate}">
<!-- Dropdown items -->
</syncfusion:SplitButtonAdv>Pattern 4: Scrollable Dropdown with Checkable Items
模式4:带可勾选项的滚动下拉菜单
xaml
<syncfusion:SplitButtonAdv Label="Options" SizeMode="Normal">
<syncfusion:DropDownMenuGroup MaxHeight="200"
ScrollBarVisibility="Visible"
IconBarEnabled="True">
<syncfusion:DropDownMenuItem Header="Option 1"
IsCheckable="True"
IsChecked="True"/>
<syncfusion:DropDownMenuItem Header="Option 2"
IsCheckable="True"/>
<syncfusion:DropDownMenuItem Header="Option 3"
IsCheckable="True"/>
<!-- More items... -->
</syncfusion:DropDownMenuGroup>
</syncfusion:SplitButtonAdv>xaml
<syncfusion:SplitButtonAdv Label="Options" SizeMode="Normal">
<syncfusion:DropDownMenuGroup MaxHeight="200"
ScrollBarVisibility="Visible"
IconBarEnabled="True">
<syncfusion:DropDownMenuItem Header="Option 1"
IsCheckable="True"
IsChecked="True"/>
<syncfusion:DropDownMenuItem Header="Option 2"
IsCheckable="True"/>
<syncfusion:DropDownMenuItem Header="Option 3"
IsCheckable="True"/>
<!-- More items... -->
</syncfusion:DropDownMenuGroup>
</syncfusion:SplitButtonAdv>Key Properties
核心属性
SplitButtonAdv Properties
SplitButtonAdv属性
| Property | Type | Description |
|---|---|---|
| string | Text displayed on the button |
| SizeMode | Size mode: Small, Normal, or Large |
| ImageSource | Icon for Small/Normal modes |
| ImageSource | Icon for Large mode |
| DataTemplate | Custom icon template (overrides SmallIcon/LargeIcon) |
| DataTemplateSelector | Dynamic icon template selection |
| double | Width of the icon |
| double | Height of the icon |
| ICommand | Command for primary button click |
| object | Parameter passed to Command |
| DropDirection | Popup position: Left, Right, BottomLeft, etc. |
| bool | Enable multiline text in Large mode |
| bool | Activate button with Enter key |
| 属性 | 类型 | 说明 |
|---|---|---|
| string | 按钮上显示的文本 |
| SizeMode | 大小模式:Small、Normal或Large |
| ImageSource | Small/Normal模式下的图标 |
| ImageSource | Large模式下的图标 |
| DataTemplate | 自定义图标模板(优先级高于LargeIcon/SmallIcon) |
| DataTemplateSelector | 动态选择图标模板 |
| double | 图标的宽度 |
| double | 图标的高度 |
| ICommand | 主按钮点击的命令 |
| object | 传递给Command的参数 |
| DropDirection | 弹出位置:Left、Right、BottomLeft等 |
| bool | 在大尺寸模式下启用多行文本 |
| bool | 允许通过Enter键激活按钮 |
DropDownMenuGroup Properties
DropDownMenuGroup属性
| Property | Type | Description |
|---|---|---|
| IEnumerable | Data source for menu items |
| DataTemplate | Template for menu item rendering |
| bool | Show/hide vertical icon bar |
| ScrollBarVisibility | Scrollbar visibility for long lists |
| bool | Enable gripper for resizing popup |
| double | Maximum height of dropdown popup |
| ObservableCollection<UIElement> | Custom items at bottom of menu |
| bool | Icon bar for custom items |
| 属性 | 类型 | 说明 |
|---|---|---|
| IEnumerable | 菜单项的数据源 |
| DataTemplate | 菜单项的渲染模板 |
| bool | 显示/隐藏垂直图标栏 |
| ScrollBarVisibility | 长列表的滚动条可见性 |
| bool | 启用抓手以调整弹出窗口大小 |
| double | 下拉弹出窗口的最大高度 |
| ObservableCollection<UIElement> | 菜单底部的自定义项 |
| bool | 自定义项的图标栏 |
DropDownMenuItem Properties
DropDownMenuItem属性
| Property | Type | Description |
|---|---|---|
| object | Text or content of menu item |
| object | Icon displayed before header |
| bool | Enable checkbox for item |
| bool | Checked state of item |
| ICommand | Command for menu item click |
| object | Parameter passed to Command |
| 属性 | 类型 | 说明 |
|---|---|---|
| object | 菜单项的文本或内容 |
| object | 标题前显示的图标 |
| bool | 为项启用复选框 |
| bool | 项的选中状态 |
| ICommand | 菜单项点击的命令 |
| object | 传递给Command的参数 |
Common Use Cases
常见用例
Use Case 1: Save Button with Format Options
用例1:带格式选项的保存按钮
Primary action saves in default format, dropdown offers alternative formats (PDF, Excel, CSV).
主操作用于默认格式保存,下拉菜单提供备选格式(PDF、Excel、CSV)。
Use Case 2: Send Button with Recipient Options
用例2:带收件人选项的发送按钮
Primary action sends to default recipient, dropdown lists alternative recipients.
主操作用于发送给默认收件人,下拉菜单列出备选收件人。
Use Case 3: Filter Button with Preset Filters
用例3:带预设过滤器的筛选按钮
Primary action applies last filter, dropdown shows available filter presets.
主操作用于应用上次使用的过滤器,下拉菜单显示可用的筛选预设。
Use Case 4: Export Button with Export Types
用例4:带导出类型的导出按钮
Primary action exports to default type, dropdown offers various export formats.
主操作用于导出为默认类型,下拉菜单提供多种导出格式。
Troubleshooting Tips
故障排除技巧
Problem: Icons not displaying correctly
Solution: Check icon priority: IconTemplate > LargeIcon > SmallIcon. Ensure correct size mode is set.
Solution: Check icon priority: IconTemplate > LargeIcon > SmallIcon. Ensure correct size mode is set.
Problem: Commands not executing
Solution: Verify CanExecute returns true. Check DataContext binding for RelativeSource.
Solution: Verify CanExecute returns true. Check DataContext binding for RelativeSource.
Problem: Dropdown items not showing
Solution: Ensure DropDownMenuGroup contains DropDownMenuItem elements. Check ItemTemplate binding.
Solution: Ensure DropDownMenuGroup contains DropDownMenuItem elements. Check ItemTemplate binding.
Problem: Events not firing
Solution: Verify event handler names match in code-behind. Check for cancellation in Opening/Closing events.
Solution: Verify event handler names match in code-behind. Check for cancellation in Opening/Closing events.
问题: 图标无法正确显示
解决方案: 检查图标优先级:IconTemplate > LargeIcon > SmallIcon。确保设置了正确的大小模式。
解决方案: 检查图标优先级:IconTemplate > LargeIcon > SmallIcon。确保设置了正确的大小模式。
问题: 命令未执行
解决方案: 验证CanExecute返回true。检查RelativeSource的DataContext绑定是否正确。
问题: 下拉项未显示
解决方案: 确保DropDownMenuGroup包含DropDownMenuItem元素。检查ItemTemplate绑定是否正确。
问题: 事件未触发
解决方案: 验证事件处理程序名称与代码隐藏中的名称匹配。检查Opening/Closing事件是否被取消。