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

AddPropertyChangeCallback() private method

private AddPropertyChangeCallback ( PropertyChangedCallback callback ) : void
callback PropertyChangedCallback
return void
        internal void AddPropertyChangeCallback(PropertyChangedCallback callback)
        {
            if (this is CustomDependencyProperty) {
                Console.WriteLine ("this should really just be done by registering the property with metadata");
                CustomDependencyProperty cdp = (CustomDependencyProperty)this;
                if (cdp.property_changed_callback != null)
                    throw new InvalidOperationException ("this DP was registered with a PropertyChangedCallback already");
            }

            if (change_cb != null)
                throw new InvalidOperationException ("this DP already has a change callback registered");

            change_cb = callback;

            NativeMethods.dependency_property_set_property_changed_callback (native,
                                             CustomUnmanagedPropertyChangedCallbackSafe);
        }