Class ObservingCommandBuilder
Contains methods to create ObservingCommandBuilder<T> instances, which help configure and instantiate an ObservingCommand.
Inherited Members
Namespace: TheXDS.MCART.Helpers
Assembly: MCART.Mvvm.dll
Syntax
public static class ObservingCommandBuilder
Methods
| Edit this page View SourceCreate<T>(T, Action)
Creates a new ObservingCommandBuilder<T> instance.
Declaration
public static ObservingCommandBuilder<T> Create<T>(this T observedObject, Action action) where T : INotifyPropertyChanged
Parameters
| Type | Name | Description |
|---|---|---|
| T | observedObject | Observed object instance. |
| Action | action | Action to execute when the command runs. |
Returns
| Type | Description |
|---|---|
| ObservingCommandBuilder<T> | A new ObservingCommandBuilder<T> for configuring and creating an ObservingCommand. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of the observed object. |
Create<T>(T, Action<object?>)
Creates a new ObservingCommandBuilder<T> instance.
Declaration
public static ObservingCommandBuilder<T> Create<T>(this T observedObject, Action<object?> action) where T : INotifyPropertyChanged
Parameters
| Type | Name | Description |
|---|---|---|
| T | observedObject | Observed object instance. |
| Action<object> | action | Action to execute when the command runs. |
Returns
| Type | Description |
|---|---|
| ObservingCommandBuilder<T> | A new ObservingCommandBuilder<T> for configuring and creating an ObservingCommand. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of the observed object. |
Create<T>(T, Func<object?, Task>)
Creates a new ObservingCommandBuilder<T> instance.
Declaration
public static ObservingCommandBuilder<T> Create<T>(this T observedObject, Func<object?, Task> task) where T : INotifyPropertyChanged
Parameters
| Type | Name | Description |
|---|---|---|
| T | observedObject | Observed object instance. |
| Func<object, Task> | task | Task to execute when the command runs. |
Returns
| Type | Description |
|---|---|
| ObservingCommandBuilder<T> | A new ObservingCommandBuilder<T> for configuring and creating an ObservingCommand. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of the observed object. |
Create<T>(T, Func<Task>)
Creates a new ObservingCommandBuilder<T> instance.
Declaration
public static ObservingCommandBuilder<T> Create<T>(this T observedObject, Func<Task> task) where T : INotifyPropertyChanged
Parameters
| Type | Name | Description |
|---|---|---|
| T | observedObject | Observed object instance. |
| Func<Task> | task | Task to execute when the command runs. |
Returns
| Type | Description |
|---|---|
| ObservingCommandBuilder<T> | A new ObservingCommandBuilder<T> for configuring and creating an ObservingCommand. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of the observed object. |
Create<T, TParam>(T, Action<TParam>)
Creates a new ObservingCommandBuilder<T> and configures it so the command only executes when the parameter is exactly the expected type for the callback.
Declaration
public static ObservingCommandBuilder<T> Create<T, TParam>(this T observedObject, Action<TParam> action) where T : INotifyPropertyChanged where TParam : notnull
Parameters
| Type | Name | Description |
|---|---|---|
| T | observedObject | Observed object instance. |
| Action<TParam> | action | Action to execute when the command runs. |
Returns
| Type | Description |
|---|---|
| ObservingCommandBuilder<T> | A new ObservingCommandBuilder<T> for configuring and creating an ObservingCommand. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of the observed object. |
| TParam | Type of the command parameter. Must be non-null. |
Create<T, TParam>(T, Func<TParam, Task>)
Creates a new ObservingCommandBuilder<T> and configures it so the command only executes when the parameter is exactly the expected type for the callback.
Declaration
public static ObservingCommandBuilder<T> Create<T, TParam>(this T observedObject, Func<TParam, Task> task) where T : INotifyPropertyChanged where TParam : notnull
Parameters
| Type | Name | Description |
|---|---|---|
| T | observedObject | Observed object instance. |
| Func<TParam, Task> | task | Task to execute when the command runs. |
Returns
| Type | Description |
|---|---|
| ObservingCommandBuilder<T> | A new ObservingCommandBuilder<T> for configuring and creating an ObservingCommand. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of the observed object. |
| TParam | Type of the command parameter. Must be non-null. |