1.7 KiB
1.7 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-17T16:40:01.838480+00:00 | zai-org/GLM-5-FP8 | 1 | 24962272b11a45e1 |
Commands
Documentation: DTS.Common.Classes.Viewer.Commands.RelayCommand
1. Purpose
This module provides an implementation of the System.Windows.Input.ICommand interface designed to delegate logic to methods passed as parameters. It exists to support the MVVM (Model-View-ViewModel) pattern within the DTS Viewer application, allowing UI controls (like buttons) to bind to actions defined in ViewModels without requiring the creation of separate concrete command classes for every action.
2. Public Interface
Constructors
-
public RelayCommand(Action<object> execute)- Initializes a new instance of the
RelayCommandclass that can always execute. - Parameter:
execute— The execution logic delegate. - Behavior: Calls the overloaded constructor with
nullfor thecanExecutepredicate.
- Initializes a new instance of the
-
public RelayCommand(Action<object> execute, Predicate<object> canExecute)- Initializes a new instance of the
RelayCommandclass. - Parameters:
execute— The execution logic delegate.canExecute— The execution status logic delegate (optional).
- Behavior: Throws an
ArgumentNullExceptionnamed "execute" if theexecutedelegate is null. Assigns delegates to internal readonly fields.
- Initializes a new instance of the
Methods
public bool CanExecute(object parameter)- Determines if the command can execute in its current state.
- Behavior: Returns
trueif_canExecuteisnull. Otherwise, returns the result of invoking_canExecute(parameter)