Click or drag to resize

PropertyStore Class

A storage for properties and events of a class
Inheritance Hierarchy
SystemObject
  System.Collections.GenericDictionaryObject, Object
    EtoPropertyStore

Namespace:  Eto
Assembly:  Eto (in Eto.dll) Version: 2.4.0
Syntax
public class PropertyStore : Dictionary<Object, Object>

The PropertyStore type exposes the following members.

Constructors
  NameDescription
Public methodPropertyStore
Initializes a new instance of the PropertyStore class.
Top
Properties
  NameDescription
Public propertyParent
Gets the parent object that this property store is attached to
Top
Methods
  NameDescription
Public methodCode exampleAddEvent
Adds a generic event delegate with the specified key
Public methodCode exampleAddHandlerEvent
Adds a handler-based event delegate with the specified key
Public methodCreateT(Object)
Gets a value from the property store with the specified key of a concrete type, and creates a new instance if it doesn't exist yet.
Public methodCreateT(Object, FuncT)
Gets a value from the property store with the specified key of a concrete type, and creates a new instance if it doesn't exist yet.
Public methodGetT(Object, FuncT)
Gets a value from the property store with the specified key of a concrete type
Public methodGetT(Object, T)
Gets a value from the property store with the specified key of a concrete type
Public methodGetCommand
Gets the command instance for the specified property key.
Public methodRemoveEvent
Removes the event delegate with the specified key
Public methodSetT(Object, T, T)
Set the value for the specified property key, removing the value from the dictionary if it is the default value of T.
Public methodCode exampleSetT(Object, T, Action, T)
Set the value for the specified property key, calling the propertyChanged delegate if it has changed.
Public methodCode exampleSetT(Object, T, PropertyChangedEventHandler, T, String)
Set the value for the specified property key, raising the propertyChanged handler if it has changed.
Public methodSetCommand
Sets an ICommand value for the specified property key.
Public methodCode exampleTriggerEventT
Triggers an event with the specified key
Public methodUpdateCommandCanExecute
Updates the command's execute status, typically when the CommandParameter changes.
Top
Remarks
This is used by Widget object to minimize the footprint of each instance. For example, the Control class has around 20 events, each would take up to 4 bytes on a 32 bit system for a total overhead of 80 bytes per instance. Most of the events won't be handled on most controls, so using a dictionary can dramatically reduce the size. This can also be used for rarely used properties that do not need to be extremely performant when getting or setting the value.
See Also

Reference