KGy SOFT

PropertyCommandStateUpdater Class

KGy SOFT Core Libraries Help
Provides an updater for the ICommandState entries, which treats state entries as properties on the command sources. When a state entry in the ICommandState changes, this updater tries to set the properties of the same name on the bound sources. For example, if a command represents a UI action bound to a menu item or a button (or both), then changing the Enabled property changes the Enabled property of the bound sources as well. You can adjust the text, shortcuts, associated image, checked state, etc. of the sources similarly.
See the Remarks section for details.
Inheritance Hierarchy

SystemObject
  KGySoft.ComponentModelPropertyCommandStateUpdater

Namespace:  KGySoft.ComponentModel
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 5.0.0-rc.1
Syntax

public sealed class PropertyCommandStateUpdater : ICommandStateUpdater, 
	IDisposable

The PropertyCommandStateUpdater type exposes the following members.

Properties

  NameDescription
Public propertyStatic memberUpdater
Gets the PropertyCommandStateUpdater instance.
Top
Methods

  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods

  NameDescription
Public Extension MethodConvert(Type, CultureInfo)Overloaded.
Converts an Object specified in the obj parameter to the desired targetType.
See the Examples section of the generic ConvertTTarget(Object, CultureInfo) overload for an example.
(Defined by ObjectExtensions.)
Public Extension MethodCode exampleConvertTTarget(CultureInfo)Overloaded.
Converts an Object specified in the obj parameter to the desired TTarget.
(Defined by ObjectExtensions.)
Public Extension MethodIn (Defined by ObjectExtensions.)
Public Extension MethodTryConvert(Type, Object)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired targetType.
(Defined by ObjectExtensions.)
Public Extension MethodTryConvert(Type, CultureInfo, Object)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired targetType.
(Defined by ObjectExtensions.)
Public Extension MethodTryConvertTTarget(TTarget)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions.)
Public Extension MethodTryConvertTTarget(CultureInfo, TTarget)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions.)
Top
Remarks

A state updater can be added to a binding by the ICommandBinding.AddStateUpdater method.

If a state entry does not represent an existing property on a source, there will no error occur.

The updater considers both ICustomTypeDescriptor properties and reflection instance properties.

See Also

Reference