295 lines
10 KiB
Markdown
295 lines
10 KiB
Markdown
|
|
---
|
||
|
|
source_files:
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/ButtonData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/SeparatorData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/GalleryItemData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/ComboBoxData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/MenuItemData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/SplitMenuItemData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/ApplicationMenuItemData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/ApplicationSplitMenuItemData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/TextBoxData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/CheckBoxData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/RadioButtonData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/ToggleButtonData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/SplitButtonData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/ContextualTabGroupData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/ViewModel.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/GalleryCategoryData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/TabData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/RibbonData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/GalleryData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/ControlData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/MenuButtonData.cs
|
||
|
|
- Common/DTS.Common/RibbonControl/Classes/GroupData.cs
|
||
|
|
generated_at: "2026-04-17T15:27:54.402997+00:00"
|
||
|
|
model: "zai-org/GLM-5-FP8"
|
||
|
|
schema_version: 1
|
||
|
|
sha256: "8a6fd67205065095"
|
||
|
|
---
|
||
|
|
|
||
|
|
# DTS.Common.RibbonControl Classes Documentation
|
||
|
|
|
||
|
|
## 1. Purpose
|
||
|
|
|
||
|
|
This module provides a data model layer for a WPF Ribbon control implementation. It defines a class hierarchy representing ribbon UI elements—tabs, groups, buttons, menus, galleries, and various input controls—with full `INotifyPropertyChanged` support for WPF data binding. The classes serve as ViewModels or data transfer objects that abstract ribbon control state, enabling separation between UI definition and rendering.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 2. Public Interface
|
||
|
|
|
||
|
|
### ControlData
|
||
|
|
**Base class for all ribbon control elements.** Implements `INotifyPropertyChanged`.
|
||
|
|
|
||
|
|
| Property | Type | Description |
|
||
|
|
|----------|------|-------------|
|
||
|
|
| `Label` | `string` | Display label for the control. |
|
||
|
|
| `LargeImage` | `Uri` | URI for 32x32 icon. |
|
||
|
|
| `SmallImage` | `Uri` | URI for 16x16 icon. |
|
||
|
|
| `ToolTipTitle` | `string` | Tooltip header text. |
|
||
|
|
| `ToolTipDescription` | `string` | Tooltip body text. |
|
||
|
|
| `ToolTipImage` | `Uri` | Tooltip image URI. |
|
||
|
|
| `ToolTipFooterTitle` | `string` | Tooltip footer header. |
|
||
|
|
| `ToolTipFooterDescription` | `string` | Tooltip footer body. |
|
||
|
|
| `ToolTipFooterImage` | `Uri` | Tooltip footer image URI. |
|
||
|
|
| `Command` | `ICommand` | Command executed on control activation. |
|
||
|
|
| `KeyTip` | `string` | Keyboard shortcut hint. |
|
||
|
|
|
||
|
|
| Event | Description |
|
||
|
|
|-------|-------------|
|
||
|
|
| `PropertyChanged` | Raised when any property value changes. |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### ButtonData
|
||
|
|
**Simple button control data.** Extends `ControlData` with no additional members.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### SeparatorData
|
||
|
|
**Visual separator in menus/toolbars.** Extends `ControlData` with no additional members.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### GalleryItemData
|
||
|
|
**Individual item within a gallery.** Extends `ControlData` with no additional members.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### TextBoxData
|
||
|
|
**Text input control data.** Extends `ControlData`.
|
||
|
|
|
||
|
|
| Property | Type | Description |
|
||
|
|
|----------|------|-------------|
|
||
|
|
| `Text` | `string` | Current text value. Raises `PropertyChanged("Text")` on change. |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### CheckBoxData
|
||
|
|
**Checkbox control data.** Extends `ControlData`.
|
||
|
|
|
||
|
|
| Property | Type | Description |
|
||
|
|
|----------|------|-------------|
|
||
|
|
| `IsChecked` | `bool` | Checked state. Raises `PropertyChanged("IsChecked")` on change. |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### RadioButtonData
|
||
|
|
**Radio button control data.** Extends `ControlData`.
|
||
|
|
|
||
|
|
| Property | Type | Description |
|
||
|
|
|----------|------|-------------|
|
||
|
|
| `IsChecked` | `bool` | Selected state. Raises `PropertyChanged("IsChecked")` on change. |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### ToggleButtonData
|
||
|
|
**Toggle button control data.** Extends `ControlData`.
|
||
|
|
|
||
|
|
| Property | Type | Description |
|
||
|
|
|----------|------|-------------|
|
||
|
|
| `IsChecked` | `bool` | Toggled state. Raises `PropertyChanged("IsChecked")` on change. |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### MenuButtonData
|
||
|
|
**Dropdown menu button data.** Extends `ControlData`.
|
||
|
|
|
||
|
|
| Constructor | Description |
|
||
|
|
|-------------|-------------|
|
||
|
|
| `MenuButtonData()` | Creates instance with `isApplicationMenu = false`. |
|
||
|
|
| `MenuButtonData(bool isApplicationMenu)` | Creates instance with specified application menu flag. |
|
||
|
|
|
||
|
|
| Property | Type | Description |
|
||
|
|
|----------|------|-------------|
|
||
|
|
| `IsVerticallyResizable` | `bool` | Vertical resize capability. |
|
||
|
|
| `IsHorizontallyResizable` | `bool` | Horizontal resize capability. |
|
||
|
|
| `ControlDataCollection` | `ObservableCollection<ControlData>` | Child controls (lazily initialized). |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### SplitButtonData
|
||
|
|
**Split button with dropdown.** Extends `MenuButtonData`.
|
||
|
|
|
||
|
|
| Constructor | Description |
|
||
|
|
|-------------|-------------|
|
||
|
|
| `SplitButtonData()` | Creates instance with `isApplicationMenu = false`. |
|
||
|
|
| `SplitButtonData(bool isApplicationMenu)` | Creates instance with specified application menu flag. |
|
||
|
|
|
||
|
|
| Property | Type | Description |
|
||
|
|
|----------|------|-------------|
|
||
|
|
| `IsChecked` | `bool` | Checked state for checkable split buttons. |
|
||
|
|
| `IsCheckable` | `bool` | Whether the button can be checked. |
|
||
|
|
| `DropDownButtonData` | `ButtonData` | Lazily-initialized dropdown button data. |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### MenuItemData
|
||
|
|
**Menu item data.** Extends `SplitButtonData`.
|
||
|
|
|
||
|
|
| Constructor | Description |
|
||
|
|
|-------------|-------------|
|
||
|
|
| `MenuItemData()` | Creates instance with `isApplicationMenu = false`. |
|
||
|
|
| `MenuItemData(bool isApplicationMenu)` | Creates instance with specified application menu flag. |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### SplitMenuItemData
|
||
|
|
**Split menu item data.** Extends `MenuItemData`.
|
||
|
|
|
||
|
|
| Constructor | Description |
|
||
|
|
|-------------|-------------|
|
||
|
|
| `SplitMenuItemData()` | Creates instance with `isApplicationMenu = false`. |
|
||
|
|
| `SplitMenuItemData(bool isApplicationMenu)` | Creates instance with specified application menu flag. |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### ApplicationMenuItemData
|
||
|
|
**Application menu item data.** Extends `MenuItemData`.
|
||
|
|
|
||
|
|
| Constructor | Description |
|
||
|
|
|-------------|-------------|
|
||
|
|
| `ApplicationMenuItemData()` | Creates instance with `isApplicationMenu = false`. |
|
||
|
|
| `ApplicationMenuItemData(bool isApplicationMenu)` | Creates instance with specified application menu flag. |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### ApplicationSplitMenuItemData
|
||
|
|
**Application split menu item data.** Extends `SplitMenuItemData`.
|
||
|
|
|
||
|
|
| Constructor | Description |
|
||
|
|
|-------------|-------------|
|
||
|
|
| `ApplicationSplitMenuItemData()` | Creates instance with `isApplicationMenu = false`. |
|
||
|
|
| `ApplicationSplitMenuItemData(bool isApplicationMenu)` | Creates instance with specified application menu flag. |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### ComboBoxData
|
||
|
|
**Combo box control data.** Extends `MenuButtonData` with no additional members.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### GalleryCategoryData
|
||
|
|
**Category container within a gallery.** Extends `ControlData`.
|
||
|
|
|
||
|
|
| Property | Type | Description |
|
||
|
|
|----------|------|-------------|
|
||
|
|
| `GalleryItemDataCollection` | `ObservableCollection<GalleryItemData>` | Items in this category (lazily initialized). |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### GalleryCategoryData\<T\>
|
||
|
|
**Generic category container.** Extends `ControlData`.
|
||
|
|
|
||
|
|
| Property | Type | Description |
|
||
|
|
|----------|------|-------------|
|
||
|
|
| `GalleryItemDataCollection` | `ObservableCollection<T>` | Generic items collection (lazily initialized). |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### GalleryData
|
||
|
|
**Gallery control data.** Extends `ControlData`.
|
||
|
|
|
||
|
|
| Property | Type | Description |
|
||
|
|
|----------|------|-------------|
|
||
|
|
| `CategoryDataCollection` | `ObservableCollection<GalleryCategoryData>` | Categories in this gallery (lazily initialized). |
|
||
|
|
| `SelectedItem` | `GalleryItemData` | Currently selected gallery item. |
|
||
|
|
| `CanUserFilter` | `bool` | Whether user can filter gallery items. |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### GalleryData\<T\>
|
||
|
|
**Generic gallery control data.** Extends `ControlData`.
|
||
|
|
|
||
|
|
| Property | Type | Description |
|
||
|
|
|----------|------|-------------|
|
||
|
|
| `CategoryDataCollection` | `ObservableCollection<GalleryCategoryData<T>>` | Generic categories (lazily initialized). |
|
||
|
|
| `SelectedItem` | `T` | Currently selected item. |
|
||
|
|
| `CanUserFilter` | `bool` | Whether user can filter gallery items. |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### TabData
|
||
|
|
**Ribbon tab data.** Implements `INotifyPropertyChanged` directly.
|
||
|
|
|
||
|
|
| Constructor | Description |
|
||
|
|
|-------------|-------------|
|
||
|
|
| `TabData()` | Creates instance with null header. |
|
||
|
|
| `TabData(string header)` | Creates instance with specified header. |
|
||
|
|
|
||
|
|
| Property | Type | Description |
|
||
|
|
|----------|------|-------------|
|
||
|
|
| `Header` | `string` | Tab header text. |
|
||
|
|
| `ContextualTabGroupHeader` | `string` | Header of associated contextual tab group. |
|
||
|
|
| `IsSelected` | `bool` | Whether tab is currently selected. |
|
||
|
|
| `GroupDataCollection` | `ObservableCollection<GroupData>` | Groups in this tab (lazily initialized). |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### ContextualTabGroupData
|
||
|
|
**Contextual tab group data.** Implements `INotifyPropertyChanged` directly.
|
||
|
|
|
||
|
|
| Constructor | Description |
|
||
|
|
|-------------|-------------|
|
||
|
|
| `ContextualTabGroupData()` | Creates instance with null header. |
|
||
|
|
| `ContextualTabGroupData(string header)` | Creates instance with specified header. |
|
||
|
|
|
||
|
|
| Property | Type | Description |
|
||
|
|
|----------|------|-------------|
|
||
|
|
| `Header` | `string` | Group header text. |
|
||
|
|
| `IsVisible` | `bool` | Whether the group is visible. |
|
||
|
|
| `TabDataCollection` | `ObservableCollection<TabData>` | Tabs in this group (lazily initialized). |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### GroupData
|
||
|
|
**Ribbon group data.** Extends `ControlData`.
|
||
|
|
|
||
|
|
| Constructor | Description |
|
||
|
|
|-------------|-------------|
|
||
|
|
| `GroupData(string header)` | Creates instance; sets `Label` to header. |
|
||
|
|
|
||
|
|
| Property | Type | Description |
|
||
|
|
|----------|------|-------------|
|
||
|
|
| `ControlDataCollection` | `ObservableCollection<ControlData>` | Controls in this group (lazily initialized). |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### RibbonData
|
||
|
|
**Root ribbon data container.** Implements `INotifyPropertyChanged` directly.
|
||
|
|
|
||
|
|
| Property | Type | Description |
|
||
|
|
|----------|------|-------------|
|
||
|
|
| `TabDataCollection` | `ObservableCollection<TabData>` | All tabs (lazily initialized). |
|
||
|
|
| `ContextualTabGroupDataCollection` | `ObservableCollection<ContextualTabGroupData>` | Contextual tab groups (lazily initialized). |
|
||
|
|
| `ApplicationMenuData` | `MenuButtonData` | Application menu data (lazily initialized). |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### ViewModelData
|
||
|
|
**Static class providing default ribbon configuration.**
|
||
|
|
|
||
|
|
| Constant | Type | Value | Description |
|
||
|
|
|----------|------|-------|-------------|
|
||
|
|
| `TabCount` | `int` | 4 | Number of tabs to generate. |
|
||
|
|
| `ContextualTabGroupCount` | `int` | 2 |
|