syncfusion-wpf-navigation-pane
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImplementing WPF GroupBar (Navigation Pane)
实现WPF GroupBar(导航窗格)
The control implements a navigation pane similar to the Microsoft Outlook Bar. It hosts categorized collections of items and custom controls in expandable/collapsible sections. Supports multiple visual modes, data binding, drag-and-drop reordering, context menus, toolbars, and full theme support.
GroupBarAssemblies: +
Namespace:
XAML Schema:
Syncfusion.Tools.WPFSyncfusion.Shared.WPFNamespace:
Syncfusion.Windows.Tools.ControlsXAML Schema:
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"GroupBar程序集: +
命名空间:
XAML架构:
Syncfusion.Tools.WPFSyncfusion.Shared.WPF命名空间:
Syncfusion.Windows.Tools.ControlsXAML架构:
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"Control Hierarchy
控件层级结构
GroupBar ← Root navigation container
└── GroupBarItem ← Category tab/header (e.g., "Mailbox", "Contacts")
├── GroupView ← List container for link-style items
│ └── GroupViewItem ← Clickable item with text and icon
└── Panel / any UIElement ← Or use any WPF panel as contentGroupBar ← 根导航容器
└── GroupBarItem ← 分类选项卡/标题(例如“邮箱”、“联系人”)
├── GroupView ← 链接样式项的列表容器
│ └── GroupViewItem ← 带文本和图标的可点击项
└── Panel / any UIElement ← 或使用任意WPF面板作为内容When to Use This Skill
何时使用此控件
- User wants an Outlook-style navigation sidebar or accordion panel
- User needs expandable/collapsible sections with content inside
- User asks about ,
GroupBar,GroupBarItem,GroupViewGroupViewItem - User needs StackMode (Outlook bar), MultipleExpansion (tree-view), or Default mode
- User needs data-bound navigation items using MVVM
- User asks about drag-and-drop reordering of navigation items
- User asks about Navigation Pane popup, gripper, or resize behavior
- 用户需要Outlook风格的导航侧边栏或手风琴面板
- 用户需要带内部内容的可展开/折叠区域
- 用户询问、
GroupBar、GroupBarItem、GroupView相关问题GroupViewItem - 用户需要堆栈模式(Outlook栏)、多展开模式(树视图)或默认模式
- 用户需要使用MVVM实现数据绑定的导航项
- 用户询问导航项的拖放重排序功能
- 用户询问导航窗格弹出窗口、抓手或调整大小行为
Quick Start
快速入门
xaml
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
<syncfusion:GroupBar Height="300" Width="230" VisualMode="StackMode" Name="groupBar">
<syncfusion:GroupBarItem Header="Mailbox" HeaderImageSource="Images/mail.png">
<syncfusion:GroupView>
<syncfusion:GroupViewItem Text="Inbox" ImageSource="Images/inbox.png"/>
<syncfusion:GroupViewItem Text="Sent Items" ImageSource="Images/sent.png"/>
<syncfusion:GroupViewItem Text="Deleted" ImageSource="Images/trash.png"/>
</syncfusion:GroupView>
</syncfusion:GroupBarItem>
<syncfusion:GroupBarItem Header="Contacts">
<syncfusion:GroupView>
<syncfusion:GroupViewItem Text="All Contacts"/>
<syncfusion:GroupViewItem Text="Favorites"/>
</syncfusion:GroupView>
</syncfusion:GroupBarItem>
</syncfusion:GroupBar>csharp
using Syncfusion.Windows.Tools.Controls;
GroupBar groupBar = new GroupBar();
groupBar.VisualMode = VisualMode.StackMode;
GroupBarItem item = new GroupBarItem { Header = "Mailbox" };
GroupView view = new GroupView();
view.Items.Add(new GroupViewItem { Text = "Inbox" });
item.Content = view;
groupBar.Items.Add(item);
this.Content = groupBar;xaml
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
<syncfusion:GroupBar Height="300" Width="230" VisualMode="StackMode" Name="groupBar">
<syncfusion:GroupBarItem Header="Mailbox" HeaderImageSource="Images/mail.png">
<syncfusion:GroupView>
<syncfusion:GroupViewItem Text="Inbox" ImageSource="Images/inbox.png"/>
<syncfusion:GroupViewItem Text="Sent Items" ImageSource="Images/sent.png"/>
<syncfusion:GroupViewItem Text="Deleted" ImageSource="Images/trash.png"/>
</syncfusion:GroupView>
</syncfusion:GroupBarItem>
<syncfusion:GroupBarItem Header="Contacts">
<syncfusion:GroupView>
<syncfusion:GroupViewItem Text="All Contacts"/>
<syncfusion:GroupViewItem Text="Favorites"/>
</syncfusion:GroupView>
</syncfusion:GroupBarItem>
</syncfusion:GroupBar>csharp
using Syncfusion.Windows.Tools.Controls;
GroupBar groupBar = new GroupBar();
groupBar.VisualMode = VisualMode.StackMode;
GroupBarItem item = new GroupBarItem { Header = "Mailbox" };
GroupView view = new GroupView();
view.Items.Add(new GroupViewItem { Text = "Inbox" });
item.Content = view;
groupBar.Items.Add(item);
this.Content = groupBar;Common Patterns
常见模式
| Goal | Approach |
|---|---|
| Outlook-style navigation | |
| Tree-style multi-expand | |
| One-at-a-time expand | |
| Collapsible bar | |
| Data-bound items | |
| Custom item content | Place any |
| List-view style items | |
| Drag-reorder items | |
| Resize navigation popup | |
| Gripper for StackMode | |
| Save/restore bar state | |
| 目标 | 实现方式 |
|---|---|
| Outlook风格导航 | |
| 树状多展开模式 | |
| 单次展开模式 | |
| 可折叠栏 | |
| 数据绑定项 | |
| 自定义项内容 | 将任意 |
| 列表视图风格项 | |
| 拖放重排序项 | |
| 调整导航弹出窗口大小 | |
| 堆栈模式抓手 | |
| 保存/恢复栏状态 | |
Key Properties
关键属性
| Property | Type | Description |
|---|---|---|
| | Default / MultipleExpansion / StackMode |
| | Allow collapsing (StackMode) |
| | Show resize gripper (StackMode) |
| | Data-bound items |
| | Style applied to each |
| | Enable drag-and-drop reordering |
| | Color of drag insertion marker |
| | Navigation pane popup resize (Both/H/V/None) |
| | Height/width of selected item content area |
| | Style for GroupBar header border |
| | Display text for item header |
| | Icon in item header |
| | Expand this item initially |
| | Rounded corners on item header |
| | List-view style (vs icon style) |
| | Text label for view item |
| | Icon for view item |
| | Auto-save state on load |
| 属性 | 类型 | 描述 |
|---|---|---|
| | 默认/多展开/堆栈模式 |
| | 允许折叠(堆栈模式) |
| | 显示调整大小抓手(堆栈模式) |
| | 数据绑定项 |
| | 应用于每个 |
| | 启用拖放重排序 |
| | 拖放插入标记的颜色 |
| | 导航窗格弹出窗口调整方向(双向/水平/垂直/无) |
| | 选中项内容区域的高度/宽度 |
| | GroupBar标题边框的样式 |
| | 项标题的显示文本 |
| | 项标题中的图标 |
| | 初始展开此项 |
| | 项标题的圆角半径 |
| | 列表视图风格(对比图标风格) |
| | 视图项的文本标签 |
| | 视图项的图标 |
| | 加载时自动保存状态 |
Documentation and Navigation Guide
文档与导航指南
Getting Started
快速入门
📄 Read: references/getting-started.md
- Assembly references (Tools.WPF + Shared.WPF)
- Add via designer, XAML, or C#
- Declarative GroupBarItems with GroupView content
- Adding panel content to GroupBarItem
- Basic VisualMode overview
- Themes with SfSkinManager
📄 阅读: references/getting-started.md
- 程序集引用(Tools.WPF + Shared.WPF)
- 通过设计器、XAML或C#添加控件
- 使用GroupView内容声明式创建GroupBarItem
- 为GroupBarItem添加面板内容
- 视觉模式基础概述
- 使用SfSkinManager设置主题
GroupBar Items
GroupBar项
📄 Read: references/groupbar-items.md
- GroupBarItem properties (Header, HeaderText, HeaderImageSource)
- IsSelected, ShowInGroupBar, GroupBarItemCornerRadius
- GroupBarItemCursorType (Default/Hand)
- ItemContentLength (content area height/width)
- DraggingItemInProgress, HiddenItemsCount
- GroupBarItemAdded / GroupBarItemRemoved events
📄 阅读: references/groupbar-items.md
- GroupBarItem属性(Header、HeaderText、HeaderImageSource)
- IsSelected、ShowInGroupBar、GroupBarItemCornerRadius
- GroupBarItemCursorType(默认/手型)
- ItemContentLength(内容区域高度/宽度)
- DraggingItemInProgress、HiddenItemsCount
- GroupBarItemAdded / GroupBarItemRemoved事件
GroupView and Content
GroupView与内容
📄 Read: references/groupview-and-content.md
- GroupView as item container with GroupViewItem elements
- GroupViewItem (Text, ImageSource, tooltip)
- IsListViewMode (list vs icon display)
- Default image for GroupViewItem
- Adding panels and custom UIElements as content
- Rotating item content
📄 阅读: references/groupview-and-content.md
- GroupView作为GroupViewItem元素的项容器
- GroupViewItem(文本、ImageSource、工具提示)
- IsListViewMode(列表对比图标显示)
- GroupViewItem的默认图标
- 添加面板和自定义UIElement作为内容
- 旋转项内容
Visual Modes
视觉模式
📄 Read: references/visual-modes.md
- Default mode (one item expanded at a time)
- MultipleExpansion mode (tree-view style)
- StackMode (Outlook bar style, popup menu at bottom)
- AllowCollapse, ShowGripper
- ThemeStudio vs classic theme layout difference in StackMode
📄 阅读: references/visual-modes.md
- 默认模式(一次展开一个项)
- 多展开模式(树视图风格)
- 堆栈模式(Outlook栏风格,底部弹出菜单)
- AllowCollapse、ShowGripper
- 堆栈模式下ThemeStudio与经典主题布局的差异
Data Binding
数据绑定
📄 Read: references/data-binding.md
- ItemsSource + ItemContainerStyle with HeaderText/Content setters
- Model + ViewModel with ObservableCollection
- DataContext binding pattern
- Data binding with XML (XmlDataProvider)
- HeaderTemplate and ContentTemplate customization
- ItemContainerStyleSelector for conditional styles
📄 阅读: references/data-binding.md
- ItemsSource + ItemContainerStyle,设置HeaderText/Content属性
- 模型+视图模型搭配ObservableCollection
- DataContext绑定模式
- 使用XML进行数据绑定(XmlDataProvider)
- HeaderTemplate和ContentTemplate自定义
- ItemContainerStyleSelector实现条件样式
Orientation and Layout
方向与布局
📄 Read: references/orientation-and-layout.md
- GroupBar orientation (Horizontal/Vertical)
- GroupView and GroupViewItem orientation
- Adjusting GroupBar width, changing header height
- Rotating the GroupBar
- FlowDirection for RTL support
- Navigation Pane: PopupResizeDirection, ShowGripper
📄 阅读: references/orientation-and-layout.md
- GroupBar方向(水平/垂直)
- GroupView和GroupViewItem方向
- 调整GroupBar宽度、修改标题高度
- 旋转GroupBar
- FlowDirection支持RTL布局
- 导航窗格:PopupResizeDirection、ShowGripper
Behavior and Features
行为与功能
📄 Read: references/behavior-and-features.md
- Drag-and-drop reordering (DragItemVisibility, DragMarkerBrush)
- Built-in context menu (sort, add, rename, move)
- Toolbars inside GroupBar
- Tooltip for GroupViewItems
- Animation for expand/collapse
- Collapsing and closing in StackMode
- State persistence (SaveBarState/LoadBarState/ResetBarState)
- Localization
📄 阅读: references/behavior-and-features.md
- 拖放重排序(DragItemVisibility、DragMarkerBrush)
- 内置上下文菜单(排序、添加、重命名、移动)
- GroupBar内的工具栏
- GroupViewItem的工具提示
- 展开/折叠动画
- 堆栈模式下的折叠与关闭
- 状态持久化(SaveBarState/LoadBarState/ResetBarState)
- 本地化
Appearance
外观
📄 Read: references/appearance.md
- GroupBarHeaderStyle (background, corner radius, height)
- CollapseButtonTemplate and CollapseButtonBackground
- ItemContainerStyle (HeaderTemplate + ContentTemplate)
- ItemContainerStyleSelector
- DragMarkerBrush
- SfSkinManager themes table
- ThemeStudio custom themes
📄 阅读: references/appearance.md
- GroupBarHeaderStyle(背景、圆角半径、高度)
- CollapseButtonTemplate和CollapseButtonBackground
- ItemContainerStyle(HeaderTemplate + ContentTemplate)
- ItemContainerStyleSelector
- DragMarkerBrush
- SfSkinManager主题表格
- ThemeStudio自定义主题