Files

85 lines
3.1 KiB
Markdown
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.CommonCore/RibbonControl/Interface/IRibbonView.cs
- Common/DTS.CommonCore/RibbonControl/Interface/IRibbonTabInfoProvider.cs
- Common/DTS.CommonCore/RibbonControl/Interface/IRibbonViewModel.cs
generated_at: "2026-04-17T16:35:32.552431+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "8634f04ac6025c26"
---
# RibbonControl Interface Module Documentation
## 1. Purpose
This module defines the core interfaces for a ribbon control UI component within an MVVM (Model-View-ViewModel) architecture. It provides abstractions for ribbon views (`IRibbonView`), view models that hold those views (`IRibbonViewModel`), and a mechanism for identifying specific ribbon tabs via unique identifiers (`IRibbonTabInfoProvider`). These interfaces establish the contract between UI components and their backing logic, enabling loose coupling and testability.
---
## 2. Public Interface
### `IRibbonView`
**Namespace:** `DTS.Common.RibbonControl`
**File:** `Interface/IRibbonView.cs`
```csharp
public interface IRibbonView : IBaseView { }
```
A marker interface extending `IBaseView`. No members are defined. Used to identify view implementations specific to ribbon controls.
---
### `IRibbonTabInfoProvider`
**Namespace:** `DTS.Common.RibbonControl`
**File:** `Interface/IRibbonTabInfoProvider.cs`
```csharp
public interface IRibbonTabInfoProvider
{
string RibbonTabUid { get; }
}
```
Provides a mechanism for retrieving a unique identifier for a ribbon tab. Implementations expose a read-only `RibbonTabUid` property that returns a `string` identifier used to locate specific ribbon tabs.
---
### `IRibbonViewModel`
**Namespace:** `DTS.Common.RibbonControl`
**File:** `Interface/IRibbonViewModel.cs`
```csharp
public interface IRibbonViewModel : IBaseViewModel
{
IRibbonView View { get; }
}
```
Defines the contract for a ribbon-specific view model. Extends `IBaseViewModel` and exposes a read-only `View` property that returns an `IRibbonView` instance, maintaining a reference from the view model to its associated view.
---
## 3. Invariants
- `IRibbonView` must always be assignable to `IBaseView` (inheritance constraint).
- `IRibbonViewModel` must always be assignable to `IBaseViewModel` (inheritance constraint).
- `IRibbonTabInfoProvider.RibbonTabUid` is expected to return a unique identifier string; the uniqueness guarantee is implied by the documentation but not enforced at compile time.
- `IRibbonViewModel.View` is expected to return a non-null `IRibbonView` instance in valid usage, though this is not enforced by the interface.
---
## 4. Dependencies
### This module depends on:
- **`DTS.Common.Base`** — Provides `IBaseView` and `IBaseViewModel` base interfaces that `IRibbonView` and `IRibbonViewModel` extend respectively.
### What depends on this module:
- **Cannot be determined from source alone.** No imports or consumer code is present in the provided files.
---
## 5. Gotchas
- **`IRibbonView` is an empty marker interface.** It adds no members beyond `IBaseView`. This may be intentional for type discrimination, or it may indicate incomplete implementation