Show / Hide Table of Contents

Class ObservingCommandBuilder<T>

Wrapper class that allows for the configuration and generation of an ObservingCommand.

Inheritance
object
ObservingCommandBuilder<T>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TheXDS.MCART.Helpers
Assembly: MCART.Mvvm.dll
Syntax
public class ObservingCommandBuilder<T> where T : INotifyPropertyChanged
Type Parameters
Name Description
T

Type of the observed object.

Properties

| Edit this page View Source

IsBuilt

Gets a value indicating whether the ObservingCommand has been fully defined through this instance.

Declaration
public bool IsBuilt { get; }
Property Value
Type Description
bool

Methods

| Edit this page View Source

Build()

Finalizes the configuration of the underlying ObservingCommand and returns it.

Declaration
public ObservingCommand Build()
Returns
Type Description
ObservingCommand

The ObservingCommand that has been configured through this instance.

| Edit this page View Source

CanExecute(Func<bool>)

Explicitly sets the check function that determines whether the ObservingCommand being configured can be executed.

Declaration
public ObservingCommandBuilder<T> CanExecute(Func<bool> canExecute)
Parameters
Type Name Description
Func<bool> canExecute

A function that determines if the command can be executed.

Returns
Type Description
ObservingCommandBuilder<T>

This instance of the ObservingCommandBuilder<T>, allowing for Fluent syntax.

| Edit this page View Source

CanExecute(Func<object?, bool>)

Explicitly sets the check function that determines whether the ObservingCommand being configured can be executed.

Declaration
public ObservingCommandBuilder<T> CanExecute(Func<object?, bool> canExecute)
Parameters
Type Name Description
Func<object, bool> canExecute

A function that determines if the command can be executed. The function will accept a parameter provided by the data binding.

Returns
Type Description
ObservingCommandBuilder<T>

This instance of the ObservingCommandBuilder<T>, allowing for Fluent syntax.

| Edit this page View Source

CanExecuteIfFilled(params Expression<Func<T, string?>>[])

Configures the ObservingCommand to be executable when the specified properties contain values different from the default value for their respective types.

Declaration
public ObservingCommandBuilder<T> CanExecuteIfFilled(params Expression<Func<T, string?>>[] properties)
Parameters
Type Name Description
Expression<Func<T, string>>[] properties

A collection of selector expressions that specify the properties to listen to.

Returns
Type Description
ObservingCommandBuilder<T>

This instance of the ObservingCommandBuilder<T>, allowing for Fluent syntax.

| Edit this page View Source

CanExecuteIfNotDefault(params Expression<Func<T, object?>>[])

Configures the ObservingCommand to be executable when the specified properties are not equal to null or their default value if they are value types.

Declaration
public ObservingCommandBuilder<T> CanExecuteIfNotDefault(params Expression<Func<T, object?>>[] properties)
Parameters
Type Name Description
Expression<Func<T, object>>[] properties

A collection of selector expressions that specify the properties to listen to.

Returns
Type Description
ObservingCommandBuilder<T>

This instance of the ObservingCommandBuilder<T>, allowing for Fluent syntax.

| Edit this page View Source

CanExecuteIfNotEmpty(params Expression<Func<T, IEnumerable<object?>?>>[])

Configures the ObservingCommand to be executable when the specified collections contain at least one element.

Declaration
public ObservingCommandBuilder<T> CanExecuteIfNotEmpty(params Expression<Func<T, IEnumerable<object?>?>>[] properties)
Parameters
Type Name Description
Expression<Func<T, IEnumerable<object>>>[] properties

A collection of selector expressions that specify the properties to listen to.

Returns
Type Description
ObservingCommandBuilder<T>

This instance of the ObservingCommandBuilder<T>, allowing for Fluent syntax.

| Edit this page View Source

CanExecuteIfNotNull(params Expression<Func<T, object?>>[])

Configures the ObservingCommand to be executable when the specified properties are not equal to null.

Declaration
public ObservingCommandBuilder<T> CanExecuteIfNotNull(params Expression<Func<T, object?>>[] properties)
Parameters
Type Name Description
Expression<Func<T, object>>[] properties

A collection of selector expressions that specify the properties to listen to.

Returns
Type Description
ObservingCommandBuilder<T>

This instance of the ObservingCommandBuilder<T>, allowing for Fluent syntax.

| Edit this page View Source

CanExecuteIfNotZero<TValue>(params Expression<Func<T, TValue>>[])

Configures the ObservingCommand to be executable when the specified properties have values different from their default ordinal value.

Declaration
public ObservingCommandBuilder<T> CanExecuteIfNotZero<TValue>(params Expression<Func<T, TValue>>[] properties) where TValue : notnull, IComparable<TValue>
Parameters
Type Name Description
Expression<Func<T, TValue>>[] properties

A collection of selector expressions that specify the properties to listen to.

Returns
Type Description
ObservingCommandBuilder<T>

This instance of the ObservingCommandBuilder<T>, allowing for Fluent syntax.

Type Parameters
Name Description
TValue

Type of the values.

| Edit this page View Source

CanExecuteIfObservedIsFilled()

Configures the ObservingCommand to be executable when all readable and writable properties of the observed object have values different from their respective default values.

Declaration
public ObservingCommandBuilder<T> CanExecuteIfObservedIsFilled()
Returns
Type Description
ObservingCommandBuilder<T>

This instance of the ObservingCommandBuilder<T>, allowing for Fluent syntax.

| Edit this page View Source

CanExecuteIfValid(params Expression<Func<T, double>>[])

Configures the ObservingCommand to be executable when the specified properties have valid floating-point values, meaning they are not NegativeInfinity, PositiveInfinity or NaN.

Declaration
public ObservingCommandBuilder<T> CanExecuteIfValid(params Expression<Func<T, double>>[] properties)
Parameters
Type Name Description
Expression<Func<T, double>>[] properties

A collection of selector expressions that specify the properties to listen to.

Returns
Type Description
ObservingCommandBuilder<T>

This instance of the ObservingCommandBuilder<T>, allowing for Fluent syntax.

| Edit this page View Source

CanExecuteIfValid(params Expression<Func<T, double?>>[])

Configures the ObservingCommand to be executable when the specified properties have valid floating-point values, meaning they are not NegativeInfinity, PositiveInfinity, NaN or null.

Declaration
public ObservingCommandBuilder<T> CanExecuteIfValid(params Expression<Func<T, double?>>[] properties)
Parameters
Type Name Description
Expression<Func<T, double?>>[] properties

A collection of selector expressions that specify the properties to listen to.

Returns
Type Description
ObservingCommandBuilder<T>

This instance of the ObservingCommandBuilder<T>, allowing for Fluent syntax.

| Edit this page View Source

CanExecuteIfValid(params Expression<Func<T, float?>>[])

Configures the ObservingCommand to be executable when the specified properties have valid floating-point values, meaning they are not NegativeInfinity, PositiveInfinity, NaN or null.

Declaration
public ObservingCommandBuilder<T> CanExecuteIfValid(params Expression<Func<T, float?>>[] properties)
Parameters
Type Name Description
Expression<Func<T, float?>>[] properties

A collection of selector expressions that specify the properties to listen to.

Returns
Type Description
ObservingCommandBuilder<T>

This instance of the ObservingCommandBuilder<T>, allowing for Fluent syntax.

| Edit this page View Source

CanExecuteIfValid(params Expression<Func<T, float>>[])

Configures the ObservingCommand to be executable when the specified properties have valid floating-point values, meaning they are not NegativeInfinity, PositiveInfinity or NaN.

Declaration
public ObservingCommandBuilder<T> CanExecuteIfValid(params Expression<Func<T, float>>[] properties)
Parameters
Type Name Description
Expression<Func<T, float>>[] properties

A collection of selector expressions that specify the properties to listen to.

Returns
Type Description
ObservingCommandBuilder<T>

This instance of the ObservingCommandBuilder<T>, allowing for Fluent syntax.

| Edit this page View Source

ListensTo(params Expression<Func<T, object?>>[])

Indicates that the ObservingCommand being configured will listen for changes to the specified properties.

Declaration
public ObservingCommandBuilder<T> ListensTo(params Expression<Func<T, object?>>[] properties)
Parameters
Type Name Description
Expression<Func<T, object>>[] properties

A collection of selector expressions that specify the properties to listen to.

Returns
Type Description
ObservingCommandBuilder<T>

This instance of the ObservingCommandBuilder<T>, allowing for Fluent syntax.

| Edit this page View Source

ListensToCanExecute(Expression<Func<T, bool>>)

Indicates that the ObservingCommand being configured will listen to a property of type bool and use it as the determinant of whether the command can be executed.

Declaration
public ObservingCommandBuilder<T> ListensToCanExecute(Expression<Func<T, bool>> selector)
Parameters
Type Name Description
Expression<Func<T, bool>> selector

Selector function for the property to be used.

Returns
Type Description
ObservingCommandBuilder<T>

This instance of the ObservingCommandBuilder<T>, allowing for Fluent syntax.

| Edit this page View Source

ListensTo<TValue>(params Expression<Func<T, TValue>>[])

Indicates that the ObservingCommand being configured will listen for changes to the specified properties.

Declaration
public ObservingCommandBuilder<T> ListensTo<TValue>(params Expression<Func<T, TValue>>[] properties)
Parameters
Type Name Description
Expression<Func<T, TValue>>[] properties

A collection of selector expressions that specify the properties to listen to.

Returns
Type Description
ObservingCommandBuilder<T>

This instance of the ObservingCommandBuilder<T>, allowing for Fluent syntax.

Type Parameters
Name Description
TValue

Operators

| Edit this page View Source

implicit operator ObservingCommand(ObservingCommandBuilder<T>)

Implicitly converts this instance to a ObservingCommand.

Declaration
public static implicit operator ObservingCommand(ObservingCommandBuilder<T> command)
Parameters
Type Name Description
ObservingCommandBuilder<T> command

The object to convert.

Returns
Type Description
ObservingCommand

Extension Methods

Objects.ShallowCopyTo(object, object, Type)
ObjectExtensions.FieldsOf<T>(object)
ObjectExtensions.GetAttribute<T>(object)
ObjectExtensions.GetAttributes<T>(object)
ObjectExtensions.HasAttrValue<TAttribute, TValue>(object, out TValue)
ObjectExtensions.HasAttribute<T>(object)
ObjectExtensions.HasAttribute<T>(object, out T?)
ObjectExtensions.HasAttributes<T>(object, out IEnumerable<T>?)
ObjectExtensions.Is(object?, object?)
ObjectExtensions.IsEither(object, IEnumerable)
ObjectExtensions.IsEither(object, params object[])
ObjectExtensions.IsNeither(object, IEnumerable)
ObjectExtensions.IsNeither(object, params object[])
ObjectExtensions.IsNot(object?, object?)
ObjectExtensions.PropertiesOf<T>(object)
ObjectExtensions.WhichAre(object, IEnumerable<object>)
ObjectExtensions.WhichAre(object, params object[])
Common.IfNotNull<T>(T?, Action<T>)
Objects.Itself<T>(T)
Objects.ShallowCopyTo<T>(T, T)
CollectionExtensions.PushInto<TItem, TCollection>(TItem, ICollection<TCollection>)
DictionaryExtensions.PushInto<TKey, TValue>(TValue, TKey, IDictionary<TKey, TValue>)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX