System.Windows.DependencyProperty.GetMetadata C# (CSharp) Method

GetMetadata() public method

public GetMetadata ( System.Windows.DependencyObjectType dependencyObjectType ) : System.Windows.PropertyMetadata
dependencyObjectType System.Windows.DependencyObjectType
return System.Windows.PropertyMetadata
        public PropertyMetadata GetMetadata(DependencyObjectType dependencyObjectType)
        {
            if (metadataByType.ContainsKey (dependencyObjectType.SystemType))
                return metadataByType[dependencyObjectType.SystemType];
            return null;
        }

Same methods

DependencyProperty::GetMetadata ( IDependencyObject d ) : System.Windows.PropertyMetadata
DependencyProperty::GetMetadata ( Type forType ) : System.Windows.PropertyMetadata

Usage Example

 /// <summary>
 ///     Creates a new dependency property descriptor.  A note on perf:  We don't 
 ///     pass the property descriptor down as the default member descriptor here.  Doing
 ///     so takes the attributes off of the property descriptor, which can be costly if they
 ///     haven't been accessed yet.  Instead, we wait until someone needs to access our
 ///     Attributes property and demand create the attributes at that time.
 /// </summary>
 internal DependencyObjectPropertyDescriptor(DependencyProperty dp, Type ownerType)
     : base(string.Concat(dp.OwnerType.Name, ".", dp.Name), null) 
 {
     _dp = dp;
     _componentType = ownerType;
     _metadata = _dp.GetMetadata(ownerType);
 }
All Usage Examples Of System.Windows.DependencyProperty::GetMetadata