# PropertyStore class

Namespace: [Eto](https://eto.picoe.ca/api/namespace/eto.md) · Assembly: [Eto](https://eto.picoe.ca/api/assembly/eto.md)

```cs
public class PropertyStore : Dictionary<object, object>
```

A storage for properties and events of a class

**Remarks:** This is used by [Widget](https://eto.picoe.ca/api/type/eto.widget.md) object to minimize the footprint of each instance. For example, the [Control](https://eto.picoe.ca/api/type/eto.forms.control.md) 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.

## Constructors

- [PropertyStore](https://eto.picoe.ca/api/type/eto.propertystore/ctor.md): Initializes a new instance of the [PropertyStore](https://eto.picoe.ca/api/type/eto.propertystore.md) class.

## Properties

- [Parent](https://eto.picoe.ca/api/type/eto.propertystore/parent.md): Gets the parent object that this property store is attached to

## Methods

- [AddEvent](https://eto.picoe.ca/api/type/eto.propertystore/addevent.md): Adds a generic event delegate with the specified key
- [AddHandlerEvent](https://eto.picoe.ca/api/type/eto.propertystore/addhandlerevent.md): Adds a handler-based event delegate with the specified key
- [Create<T>](https://eto.picoe.ca/api/type/eto.propertystore/create.md): (2 overloads) 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.
- [Get<T>](https://eto.picoe.ca/api/type/eto.propertystore/get.md): (2 overloads) Gets a value from the property store with the specified key of a concrete type
- [GetCommand](https://eto.picoe.ca/api/type/eto.propertystore/getcommand.md): Gets the command instance for the specified property key.
- [RemoveEvent](https://eto.picoe.ca/api/type/eto.propertystore/removeevent.md): Removes the event delegate with the specified `key`
- [RemoveHandlerEvent](https://eto.picoe.ca/api/type/eto.propertystore/removehandlerevent.md): Removes a handler-based event delegate with the specified `key`, telling the handler to stop listening once the last subscriber is gone.
- [Set<T>](https://eto.picoe.ca/api/type/eto.propertystore/set.md): (3 overloads) Set the value for the specified property key, calling the `propertyChanged` delegate if it has changed.
- [SetCommand](https://eto.picoe.ca/api/type/eto.propertystore/setcommand.md): Sets an [ICommand](https://learn.microsoft.com/dotnet/api/system.windows.input.icommand) value for the specified property `key`.
- [TriggerEvent<T>](https://eto.picoe.ca/api/type/eto.propertystore/triggerevent.md): Triggers an event with the specified key
- [TrySet<T>](https://eto.picoe.ca/api/type/eto.propertystore/tryset.md): Set the value for the specified property key, removing the value from the dictionary if it is the default value of T.
- [UnbindCommand](https://eto.picoe.ca/api/type/eto.propertystore/unbindcommand.md): Unbinds the command associated with the specified key, removing its registration.
- [UpdateCommandCanExecute](https://eto.picoe.ca/api/type/eto.propertystore/updatecommandcanexecute.md): Updates the command's execute status, typically when the CommandParameter changes.
