Files
DP44/docs/ai/DataPRO/Modules/ISO/ExtraProperties/ViewModel.md
2026-04-17 14:55:32 -04:00

4.3 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
DataPRO/Modules/ISO/ExtraProperties/ViewModel/ExtraPropertiesListViewModel.cs
2026-04-17T16:00:24.517111+00:00 zai-org/GLM-5-FP8 1 b887776733154f74

ExtraPropertiesListViewModel Documentation

1. Purpose

ExtraPropertiesListViewModel is a Prism-based ViewModel that manages a collection of key-value pair properties ("Extra Properties") within the DataPRO ISO module. It provides CRUD operations, sorting, filtering, validation, and clipboard support (copy/paste) for extra properties. The class serves as the presentation logic layer between the IExtraPropertiesListView and the underlying IExtraProperty data model, coordinating changes through Prism's IEventAggregator for loose coupling with other system components.


2. Public Interface

Constructor

public ExtraPropertiesListViewModel(
    IExtraPropertiesListView view, 
    IRegionManager regionManager,
    IEventAggregator eventAggregator, 
    IUnityContainer unityContainer)

Initializes the ViewModel, sets up the View's DataContext, creates interaction requests, and subscribes to RaiseNotification, BusyIndicatorChangeNotification, and conditionally TextPastedEvent events.

Properties

Property Type Description
View IExtraPropertiesListView Gets/sets the associated view.
NotificationRequest InteractionRequest<Notification> Interaction request for displaying notifications.
ConfirmationRequest InteractionRequest<Confirmation> Interaction request for displaying confirmations.
Page IDataPROPage Gets/sets the associated page context.
Parent object Gets/sets the parent object reference.
IsDirty bool Indicates whether the data has been modified.
IsBusy bool Controls busy indicator state; notifies on change.
IsMenuIncluded bool Controls menu inclusion; notifies on change.
IsNavigationIncluded bool Controls navigation inclusion; notifies on change.
IsReadOnly bool Controls read-only state (FB14098: permission-based editing disable).
AllExtraProperties List<IExtraProperty> Complete list of all extra properties.
ExtraProperties ObservableCollection<IExtraProperty> Filtered/sorted collection bound to the view.
SelectedProperties IExtraProperty[] Throws NotImplementedException.

Methods

public void SetPage(IDataPROPage page)

Sets the Page property.

public void SetParent(object parent)

Sets the Parent property.

public void Cleanup()
public Task CleanupAsync()

No-op cleanup methods. CleanupAsync returns Task.CompletedTask.

public void Initialize()
public void Initialize(object parameter)
public void Initialize(object parameter, object model)
public Task InitializeAsync()
public Task InitializeAsync(object parameter)

No-op initialization methods. Async versions return Task.CompletedTask.

public void Activated()

No-op activation method.

public void OnPropertyChanged(string propertyName)

Raises PropertyChanged event. When propertyName is "ExtraProperties", publishes ExtraPropertiesChangedEvent.

public void Filter(object tag, string term)

Filters properties by search term for the specified field tag ("Key" or "Value").

public void Sort(object columnTag, bool columnClick)

Sorts properties by the specified column tag ("Key" or "Value"). Toggles sort direction on repeated clicks.

public bool Validate(ref List<string> errors)

Validates properties, adding error messages to the list. Returns true if no new errors were added.

public void SetExtraProperties(IList<IExtraProperty> properties)

Replaces all properties with the provided list, adds an empty row at the end, resets sort to Key/ascending, and applies sort/filter.

public void CopySelected()

Copies _selectedItems to the end of AllExtraProperties (before the empty row), re-sorts, filters, and publishes PageModifiedEvent.

public void DeleteSelected()

Removes _selectedItems from collections. Ensures an empty row remains at the end. Publishes PageModifiedEvent.

Internal Methods

internal void MarkModified(IExtraProperty iep)

Adds a