ICommandSourceExtensions

Wisej.Web.Markup.ICommandSourceExtensions

Namespace: Wisej.Web.Markup

Assembly: Wisej.Framework (4.0.0.0)

Adds fluent markup extension methods to the ICommandSource interface.

public class ICommandSourceExtensions

Methods

Command<TCommandSource>(button, value)

Sets the Command property of the specified ICommandSource.

Parameter
Type
Description

TCommandSource

The type of the command source, must implement ICommandSource.

button

The command source for which to set the Command property.

value

The ICommand to associate with the command source.

Returns: TCommandSource. The modified command source with the updated Command property.

This method allows you to associate a command with the command source, enabling command-based interactions.


myCommandSource.Command(new RelayCommand());

OnCommandChanged<TCommandSource>(button, action)

Attaches an event handler for the CommandChanged event of the specified ICommandSource.

Parameter
Type
Description

TCommandSource

The type of the command source, must implement ICommandSource.

button

The command source to attach the event handler to.

action

An action to execute when the command changes.

Returns: TCommandSource. The modified command source with the attached CommandChanged event handler.

This method allows you to execute a custom action whenever the command associated with the command source changes.


myCommandSource.OnCommandChanged(cs =>
{
AlertBox.Show("Command changed!");
});

Last updated

Was this helpful?