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

RegisterAttached() public static method

public static RegisterAttached ( string name, Type propertyType, Type ownerType ) : DependencyProperty
name string
propertyType Type
ownerType Type
return DependencyProperty
        public static DependencyProperty RegisterAttached(string name, Type propertyType, Type ownerType)
        {
            return RegisterAttached(name, propertyType, ownerType, null, null);
        }

Same methods

DependencyProperty::RegisterAttached ( string name, Type propertyType, Type ownerType, System.Windows.PropertyMetadata defaultMetadata ) : DependencyProperty
DependencyProperty::RegisterAttached ( string name, Type propertyType, Type ownerType, System.Windows.PropertyMetadata defaultMetadata, ValidateValueCallback validateValueCallback ) : DependencyProperty

Usage Example

Esempio n. 1
0
        public static void RegisterForNotification([NotNull] this FrameworkElement element, string PropertyName, PropertyChangedCallback callback)
        {
            var binding = new Binding(PropertyName)
            {
                Source = element
            };
            var prop = DependencyProperty.RegisterAttached($"ListenAttached{PropertyName}",
                                                           typeof(object),
                                                           element.GetType(),
                                                           new PropertyMetadata(callback));

            element.SetBinding(prop, binding);
        }
All Usage Examples Of System.Windows.DependencyProperty::RegisterAttached