Exemplo n.º 1
0
        /// <summary>
        /// Adds a new owning type to this dependency property.
        /// </summary>
        /// <param name="ownerType">The owner type to add to this dependency property.</param>
        /// <param name="typeMetadata">The property metadata for this owning type, which will override the default metadata.</param>
        /// <returns>A reference to this dependency property instance.</returns>
        public DependencyProperty AddOwner(Type ownerType, PropertyMetadata typeMetadata)
        {
            Contract.Require(ownerType, nameof(ownerType));

            DependencyPropertySystem.AddOwner(this, ownerType);

            OverrideMetadata(ownerType, typeMetadata);

            return(this);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes the object's dependency properties.
 /// </summary>
 public void InitializeDependencyProperties()
 {
     DependencyPropertySystem.InitializeObject(this);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Registers a new dependency property.
 /// </summary>
 /// <param name="name">The dependency property's name.</param>
 /// <param name="propertyType">The dependency property's value type.</param>
 /// <param name="ownerType">The dependency property's owner type.</param>
 /// <param name="metadata">The dependency property's metadata.</param>
 /// <returns>A <see cref="DependencyProperty"/> instance which represents the registered dependency property.</returns>
 public static DependencyProperty Register(String name, Type propertyType, Type ownerType, PropertyMetadata metadata = null)
 {
     return(DependencyPropertySystem.Register(name, null, propertyType, ownerType, metadata));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Finds the dependency property with the specified styling name.
 /// </summary>
 /// <param name="name">The styling name of the dependency property for which to search.</param>
 /// <param name="ownerType">The dependency property's owner type.</param>
 /// <returns>A <see cref="DependencyProperty"/> instance which represents the specified dependency property,
 /// or <see langword="null"/> if no such dependency property exists.</returns>
 public static DependencyProperty FindByStylingName(String name, Type ownerType)
 {
     return(DependencyPropertySystem.FindByStylingName(name, ownerType));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Registers a new read-only attached property.
 /// </summary>
 /// <param name="name">The attached property's name.</param>
 /// <param name="uvssName">The attached property's name within the UVSS styling system.</param>
 /// <param name="propertyType">The attached property's value type.</param>
 /// <param name="ownerType">The attached property's owner type.</param>
 /// <param name="metadata">The attached property's metadata.</param>
 /// <returns>A <see cref="DependencyPropertyKey"/> instance which provides access to the read-only attached property.</returns>
 public static DependencyPropertyKey RegisterAttachedReadOnly(String name, String uvssName, Type propertyType, Type ownerType, PropertyMetadata metadata = null)
 {
     return(DependencyPropertySystem.RegisterAttachedReadOnly(name, uvssName, propertyType, ownerType, metadata));
 }