src/Runtime/Runtime/Core/Main/INTERNAL_PropertyStore.cs
/// <summary>
/// Attempt to get a Property Storage
/// </summary>
/// <param name="dependencyObject"></param>
/// <param name="dependencyProperty"></param>
/// <param name="createIfNotFoud">when set to true, it forces the creation of the storage if it does not exists yet.</param>
/// <param name="storage"></param>
/// <returns></returns>
Attempt to get a Property Storage
Attempt to get a Property Storage
public static bool TryGetStorage(DependencyObject dependencyObject,
                                         DependencyProperty dependencyProperty,
                                         bool createIfNotFoud,
                                         out INTERNAL_PropertyStorage storage)
        {
            if (dependencyObject.INTERNAL_PropertyStorageDictionary.TryGetValue(dependencyProperty, out storage))
            {
                return true;
            }
            if (createIfNotFoud)
            {
                PropertyMetadata typeMetadata = dependencyProperty.GetTypeMetaData(dependencyObject.GetType());
                storage = new INTERNAL_PropertyStorage(dependencyObject, dependencyProperty, typeMetadata);
                dependencyObject.INTERNAL_PropertyStorageDictionary.Add(dependencyProperty, storage);
                -
                -
                if (typeMetadata.Inherits)
                {
                    -
                    -
                    dependencyObject.INTERNAL_AllInheritedProperties.Add(dependencyProperty, storage);
                }
            }
            return createIfNotFoud;
        }
public static bool TryGetStorage ( DependencyObject dependencyObject , DependencyProperty dependencyProperty , bool createIfNotFoud , out INTERNAL_PropertyStorage storage ) { if ( dependencyObject . INTERNAL_PropertyStorageDictionary . TryGetValue ( dependencyProperty , out storage ) ) { return true ; } if ( createIfNotFoud ) { PropertyMetadata typeMetadata = dependencyProperty . GetTypeMetaData ( dependencyObject . GetType ( ) ) ; storage = new INTERNAL_PropertyStorage ( dependencyObject , dependencyProperty , typeMetadata ) ; dependencyObject . INTERNAL_PropertyStorageDictionary . Add ( dependencyProperty , storage ) ; if ( typeMetadata . Inherits ) { dependencyObject . INTERNAL_AllInheritedProperties . Add ( dependencyProperty , storage ) ; } } return createIfNotFoud ; }
Attempt to get a Property Storage
Attempt to get a Property Storage
// Get the type metadata //---------------------- // CREATE A NEW STORAGE: //---------------------- //----------------------- // CHECK IF THE PROPERTY IS INHERITABLE: //----------------------- //----------------------- // ADD THE STORAGE TO "INTERNAL_AllInheritedProperties" IF IT IS NOT ALREADY THERE: //-----------------------
None
dependencyObject
DependencyObject
None
dependencyProperty
DependencyProperty
None
createIfNotFoud
bool
when set to true, it forces the creation of the storage if it does not exists yet.
when set to true it forces the creation of the storage if it does not exists yet .
INTERNAL_PropertyStorage
out
storage
None