Files

31 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.CommonCore/RibbonControl/ViewModel/RibbonViewModel.cs
generated_at: "2026-04-17T16:39:18.825573+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "ebf586fff83bf3fe"
---
# RibbonViewModel Documentation
## 1. Purpose
`RibbonViewModel<TModel>` is a generic base class for ribbon control view models in a WPF application using the Prism framework. It provides common infrastructure for MVVM patterns including command management, view lifecycle methods (initialization, activation, cleanup), property change notification, and status publishing via event aggregation. The class is designed to be inherited by concrete view models that specify a model type `TModel`.
## 2. Public Interface
### Constructor
```csharp
protected RibbonViewModel(IRibbonView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
```
Protected constructor that initializes core dependencies and calls `CreateCommands()`. Only accessible to derived classes.
### Properties
| Property | Type | Access | Description |
|----------|------|--------|-------------|
| `Model` | `TModel` | get/set | The generic model instance associated with this view model. |
| `View` | `IRibbonView` | get | The associated view reference. |
| `ConfirmationRequest` | `InteractionRequest<Confirmation>` | get | Prism interaction request for displaying confirmations. |
| `CloseCommand` | `DelegateCommand<object>` | get | Command that executes `CloseMethod` when invoked