Class CreatesCommandBindingViaCommandParameter
- Namespace
- ReactiveUI
- Assembly
- ReactiveUI.dll
Class that registers Command Binding and Command Parameter Binding.
public class CreatesCommandBindingViaCommandParameter : ICreatesCommandBinding
- Inheritance
-
CreatesCommandBindingViaCommandParameter
- Implements
- Extension Methods
Constructors
CreatesCommandBindingViaCommandParameter()
public CreatesCommandBindingViaCommandParameter()
Methods
BindCommandToObject(ICommand?, object?, IObservable<object?>)
Bind an ICommand to a UI object, in the "default" way. The meaning of this is dependent on the implementation. Implement this if you have a new type of UI control that doesn't have Command/CommandParameter like WPF or has a non-standard event name for "Invoke".
public IDisposable? BindCommandToObject(ICommand? command, object? target, IObservable<object?> commandParameter)
Parameters
command
ICommandThe command to bind.
target
objectThe target object, usually a UI control of some kind.
commandParameter
IObservable<object>An IObservable source whose latest value will be passed as the command parameter to the command. Hosts will always pass a valid IObservable, but this may be Observable.Empty.
Returns
- IDisposable
An IDisposable which will disconnect the binding when disposed.
BindCommandToObject<TEventArgs>(ICommand?, object?, IObservable<object?>, string)
Bind an ICommand to a UI object to a specific event. This event may be a standard .NET event, or it could be an event derived in another manner (i.e. in MonoTouch).
public IDisposable? BindCommandToObject<TEventArgs>(ICommand? command, object? target, IObservable<object?> commandParameter, string eventName)
Parameters
command
ICommandThe command to bind.
target
objectThe target object, usually a UI control of some kind.
commandParameter
IObservable<object>An IObservable source whose latest value will be passed as the command parameter to the command. Hosts will always pass a valid IObservable, but this may be Observable.Empty.
eventName
stringThe event to bind to.
Returns
- IDisposable
An IDisposable which will disconnect the binding when disposed.
Type Parameters
TEventArgs
The event argument type.
GetAffinityForObject(Type, bool)
Returns a positive integer when this class supports BindCommandToObject for this particular Type. If the method isn't supported at all, return a non-positive integer. When multiple implementations return a positive value, the host will use the one which returns the highest value. When in doubt, return '2' or '0'.
public int GetAffinityForObject(Type type, bool hasEventTarget)
Parameters
type
TypeThe type to query for.
hasEventTarget
boolIf true, the host intends to use a custom event target.
Returns
- int
A positive integer if BCTO is supported, zero or a negative value otherwise.