206 lines
8.4 KiB
Markdown
206 lines
8.4 KiB
Markdown
|
|
---
|
||
|
|
source_files:
|
||
|
|
- Common/DTS.CommonCore/Interface/Components/IAssemblyView.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Components/IAssemblyListView.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Components/ITileView.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Components/IGroupView.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Components/ITileListView.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Components/IGroupListView.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Components/IAssemblyViewModel.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Components/IAssemblyListViewModel.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Components/ITileViewModel.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Components/IGroupViewModel.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Components/ITileListViewModel.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Components/IGroupListViewModel.cs
|
||
|
|
generated_at: "2026-04-16T12:16:00.246337+00:00"
|
||
|
|
model: "zai-org/GLM-5-FP8"
|
||
|
|
schema_version: 1
|
||
|
|
sha256: "9dfaf004748c958d"
|
||
|
|
---
|
||
|
|
|
||
|
|
# Documentation: View/ViewModel Component Interfaces
|
||
|
|
|
||
|
|
## 1. Purpose
|
||
|
|
|
||
|
|
This module defines a set of abstraction interfaces for a Model-View-ViewModel (MVVM) architecture, specifically for displaying and managing grouped assembly information in a UI. It provides two parallel interface hierarchies: one in the `DTS.Common.Interface` namespace for assembly-based views, and another in the `DataPro.Common.Interface` namespace for tile/group-based views. These interfaces enable decoupling of UI components from their concrete implementations, supporting view composition patterns where assemblies can be displayed as individual items or grouped lists.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 2. Public Interface
|
||
|
|
|
||
|
|
### DTS.Common.Interface Namespace
|
||
|
|
|
||
|
|
#### `IAssemblyView`
|
||
|
|
```csharp
|
||
|
|
public interface IAssemblyView : IBaseView { }
|
||
|
|
```
|
||
|
|
Marker interface extending `IBaseView`. Represents a single assembly view component. No members defined.
|
||
|
|
|
||
|
|
#### `IAssemblyListView`
|
||
|
|
```csharp
|
||
|
|
public interface IAssemblyListView : IBaseView { }
|
||
|
|
```
|
||
|
|
Marker interface extending `IBaseView`. Represents a list container for assembly views. No members defined.
|
||
|
|
|
||
|
|
#### `IAssemblyViewModel`
|
||
|
|
```csharp
|
||
|
|
public interface IAssemblyViewModel : IBaseViewModel
|
||
|
|
{
|
||
|
|
IAssemblyView View { get; set; }
|
||
|
|
string GroupName { get; set; }
|
||
|
|
List<AssemblyNameImage> AssemblyList { get; set; }
|
||
|
|
}
|
||
|
|
```
|
||
|
|
ViewModel interface for a single assembly group. Properties:
|
||
|
|
- `View` - The associated view instance
|
||
|
|
- `GroupName` - Name identifier for the group
|
||
|
|
- `AssemblyList` - Collection of `AssemblyNameImage` objects
|
||
|
|
|
||
|
|
#### `IAssemblyListViewModel`
|
||
|
|
```csharp
|
||
|
|
public interface IAssemblyListViewModel : IBaseViewModel
|
||
|
|
{
|
||
|
|
IMainViewModel Parent { get; set; }
|
||
|
|
IAssemblyListView View { get; set; }
|
||
|
|
List<IAssemblyView> GroupList { get; set; }
|
||
|
|
}
|
||
|
|
```
|
||
|
|
ViewModel interface for a collection of assembly groups. Properties:
|
||
|
|
- `Parent` - Reference to the parent `IMainViewModel`
|
||
|
|
- `View` - The associated list view instance
|
||
|
|
- `GroupList` - Collection of `IAssemblyView` instances
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### DataPro.Common.Interface Namespace
|
||
|
|
|
||
|
|
#### `ITileView`
|
||
|
|
```csharp
|
||
|
|
public interface ITileView : IBaseView { }
|
||
|
|
```
|
||
|
|
Marker interface extending `IBaseView`. Represents a tile-based view component. No members defined.
|
||
|
|
|
||
|
|
#### `IGroupView`
|
||
|
|
```csharp
|
||
|
|
public interface IGroupView : IBaseView { }
|
||
|
|
```
|
||
|
|
Marker interface extending `IBaseView`. Represents a group-based view component. No members defined.
|
||
|
|
|
||
|
|
#### `ITileListView`
|
||
|
|
```csharp
|
||
|
|
public interface ITileListView : IBaseView { }
|
||
|
|
```
|
||
|
|
Marker interface extending `IBaseView`. Represents a list container for tile views. No members defined.
|
||
|
|
|
||
|
|
#### `IGroupListView`
|
||
|
|
```csharp
|
||
|
|
public interface IGroupListView : IBaseView { }
|
||
|
|
```
|
||
|
|
Marker interface extending `IBaseView`. Represents a list container for group views. No members defined.
|
||
|
|
|
||
|
|
#### `ITileViewModel`
|
||
|
|
```csharp
|
||
|
|
public interface ITileViewModel : IBaseViewModel
|
||
|
|
{
|
||
|
|
ITileView View { get; set; }
|
||
|
|
string GroupName { get; set; }
|
||
|
|
List<AssemblyNameImage> AssemblyList { get; set; }
|
||
|
|
}
|
||
|
|
```
|
||
|
|
ViewModel interface for a tile-based assembly group. Properties:
|
||
|
|
- `View` - The associated tile view instance
|
||
|
|
- `GroupName` - Name identifier for the group
|
||
|
|
- `AssemblyList` - Collection of `AssemblyNameImage` objects
|
||
|
|
|
||
|
|
#### `IGroupViewModel`
|
||
|
|
```csharp
|
||
|
|
public interface IGroupViewModel : IBaseViewModel
|
||
|
|
{
|
||
|
|
IGroupView View { get; set; }
|
||
|
|
string GroupName { get; set; }
|
||
|
|
List<AssemblyNameImage> AssemblyList { get; set; }
|
||
|
|
}
|
||
|
|
```
|
||
|
|
ViewModel interface for a group-based assembly display. Properties:
|
||
|
|
- `View` - The associated group view instance
|
||
|
|
- `GroupName` - Name identifier for the group
|
||
|
|
- `AssemblyList` - Collection of `AssemblyNameImage` objects
|
||
|
|
|
||
|
|
#### `ITileListViewModel`
|
||
|
|
```csharp
|
||
|
|
public interface ITileListViewModel : IBaseViewModel
|
||
|
|
{
|
||
|
|
IMainViewModel Parent { get; set; }
|
||
|
|
ITileListView View { get; set; }
|
||
|
|
List<ITileView> GroupList { get; set; }
|
||
|
|
}
|
||
|
|
```
|
||
|
|
ViewModel interface for a collection of tile groups. Properties:
|
||
|
|
- `Parent` - Reference to the parent `IMainViewModel`
|
||
|
|
- `View` - The associated tile list view instance
|
||
|
|
- `GroupList` - Collection of `ITileView` instances
|
||
|
|
|
||
|
|
#### `IGroupListViewModel`
|
||
|
|
```csharp
|
||
|
|
public interface IGroupListViewModel : IBaseViewModel
|
||
|
|
{
|
||
|
|
IMainViewModel Parent { get; set; }
|
||
|
|
IGroupListView View { get; set; }
|
||
|
|
List<IGroupView> GroupList { get; set; }
|
||
|
|
}
|
||
|
|
```
|
||
|
|
ViewModel interface for a collection of groups. Properties:
|
||
|
|
- `Parent` - Reference to the parent `IMainViewModel`
|
||
|
|
- `View` - The associated group list view instance
|
||
|
|
- `GroupList` - Collection of `IGroupView` instances
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 3. Invariants
|
||
|
|
|
||
|
|
- All View interfaces (`IAssemblyView`, `IAssemblyListView`, `ITileView`, `IGroupView`, `ITileListView`, `IGroupListView`) must inherit from `IBaseView`.
|
||
|
|
- All ViewModel interfaces must inherit from `IBaseViewModel`.
|
||
|
|
- The `View` property on a ViewModel must reference an instance of its corresponding View interface type (e.g., `IAssemblyViewModel.View` must be of type `IAssemblyView`).
|
||
|
|
- List ViewModels maintain a parent-child relationship: `IAssemblyListViewModel`, `ITileListViewModel`, and `IGroupListViewModel` must have a valid `Parent` reference to `IMainViewModel`.
|
||
|
|
- The `GroupList` property on list ViewModels must contain elements of the corresponding single-item View interface type.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 4. Dependencies
|
||
|
|
|
||
|
|
### External Dependencies (referenced but not defined in source):
|
||
|
|
- **`DTS.Common.Base.IBaseView`** - Base interface for all views in the DTS namespace
|
||
|
|
- **`DTS.Common.Base.IBaseViewModel`** - Base interface for all ViewModels in the DTS namespace
|
||
|
|
- **`DataPro.Common.Base.IBaseView`** - Base interface for all views in the DataPro namespace
|
||
|
|
- **`DataPro.Common.Base.IBaseViewModel`** - Base interface for all ViewModels in the DataPro namespace
|
||
|
|
- **`AssemblyNameImage`** - Data structure representing assembly information (type definition not provided)
|
||
|
|
- **`IMainViewModel`** - Parent ViewModel interface (type definition not provided)
|
||
|
|
|
||
|
|
### Namespace Dependencies:
|
||
|
|
- `System.Collections.Generic` - For `List<T>` usage
|
||
|
|
- `System.Collections.ObjectModel` - Imported in DataPro ViewModel files but not actively used
|
||
|
|
- `System.Reflection` - Imported in DataPro ViewModel files but not actively used
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 5. Gotchas
|
||
|
|
|
||
|
|
### Namespace Inconsistency
|
||
|
|
The codebase contains two parallel interface hierarchies with inconsistent namespace naming:
|
||
|
|
- `DTS.Common.Interface` vs `DataPro.Common.Interface`
|
||
|
|
- `DTS.Common.Base` vs `DataPro.Common.Base`
|
||
|
|
|
||
|
|
This suggests either an ongoing refactoring, a legacy migration, or intentional separation between two subsystems. **The relationship between these two namespace families is unclear from source alone.**
|
||
|
|
|
||
|
|
### Unused Imports
|
||
|
|
The following files import namespaces that are never used in the interface definitions:
|
||
|
|
- `ITileViewModel.cs` - imports `System.Collections.ObjectModel` and `System.Reflection`
|
||
|
|
- `IGroupViewModel.cs` - imports `System.Collections.ObjectModel` and `System.Reflection`
|
||
|
|
- `ITileListViewModel.cs` - imports `System.Collections.ObjectModel`, `System.Reflection`, and `System`
|
||
|
|
- `IGroupListViewModel.cs` - imports `System.Collections.ObjectModel`, `System.Reflection`, and `System`
|
||
|
|
|
||
|
|
### Structural Duplication
|
||
|
|
`ITileViewModel` and `IGroupViewModel` have identical member signatures, differing only in their View property types (`ITileView` vs `IGroupView`). Similarly, `ITileListViewModel` and `IGroupListViewModel` are structurally identical. This may indicate an opportunity for generic abstraction or consolidation.
|
||
|
|
|
||
|
|
### Missing Type Definitions
|
||
|
|
The types `AssemblyNameImage` and `IMainViewModel` are referenced but not defined in the provided source files. Their structure and contracts cannot be documented from the available information.
|