public static Register ( string name, Type propertyType, Type ownerType ) : |
||
name | string | |
propertyType | Type | |
ownerType | Type | |
Результат |
static PivotGridDemoModule() { Type ownerType = typeof(PivotGridDemoModule); PivotGridControlProperty = DependencyPropertyManager.Register("PivotGridControl", typeof(PivotGridControl), ownerType, new PropertyMetadata(null, OnPivotGridControlChanged)); }
/// <summary> /// Registers a dependency property, using established known type values. /// </summary> /// <typeparam name="TDO"> /// The type of the class inheriting from <see cref="DependencyObject"/>. /// </typeparam> /// <typeparam name="TValue"> /// The type of the property with an associated <see cref="DependencyProperty"/> that implements this method. /// Must inherit from <see cref="INotifyCollectionChanged"/>. /// </typeparam> /// <param name="name"> /// The name of the dependency property to register. /// The name must be unique within the registration namespace of the owner type. /// </param> /// <param name="defaultValue"> /// The default value of the dependency property. /// </param> /// <param name="pccSelector"> /// A selector function that returns the "Property Changed Callback" method to use. /// This method's parameters are the property's old and new values, in that order. /// </param> /// <param name="nccehSelector"> /// A selector function that returns the <see cref="NotifyCollectionChangedEventHandler"/> ("ncceh") method to use. /// Warning: DO NOT pass a selector that selects an anonymous method. /// </param> /// <returns> /// Returns a dependency property identifier created using established known type values. /// </returns> public static DependencyProperty DependencyPropertyRegister <TDO, TValue>(string name, TValue defaultValue, Func <TDO, Action <TValue, TValue> > pccSelector, Func <TDO, NotifyCollectionChangedEventHandler> nccehSelector) where TDO : DependencyObject where TValue : INotifyCollectionChanged { return(DependencyProperty.Register(name, typeof(TValue), typeof(TDO), NewPropertyMetadata <TDO, TValue>(defaultValue, pccSelector, nccehSelector))); }
/// <summary> /// Registers a dependency property, using established known type values. /// </summary> /// <typeparam name="TDO"> /// The type of the class inheriting from <see cref="DependencyObject"/>. /// </typeparam> /// <typeparam name="TValue"> /// The type of the property with an associated <see cref="DependencyProperty"/> that implements this method. /// </typeparam> /// <param name="name"> /// The name of the dependency property to register. /// The name must be unique within the registration namespace of the owner type. /// </param> /// <param name="defaultValue"> /// The default value of the dependency property. /// </param> /// <param name="pccSelector"> /// A selector function that returns the "Property Changed Callback" method to use. /// </param> /// <returns> /// Returns a dependency property identifier created using established known type values. /// </returns> public static DependencyProperty DependencyPropertyRegister <TDO, TValue>(string name, TValue defaultValue, Func <TDO, Action <TValue, TValue> > pccSelector) where TDO : DependencyObject { return(DependencyProperty.Register(name, typeof(TValue), typeof(TDO), NewPropertyMetadata <TDO, TValue>(defaultValue, pccSelector))); }
/// <summary> /// Registers a dependency property, using established known type values. /// </summary> /// <typeparam name="TDO"> /// The type of the class inheriting from <see cref="DependencyObject"/>. /// </typeparam> /// <typeparam name="TValue"> /// The type of the property with an associated <see cref="DependencyProperty"/> that implements this method. /// </typeparam> /// <param name="name"> /// The name of the dependency property to register. /// The name must be unique within the registration namespace of the owner type. /// </param> /// <param name="defaultValue"> /// The default value of the dependency property. /// </param> /// <returns> /// Returns a dependency property identifier created using established known type values. /// </returns> public static DependencyProperty DependencyPropertyRegister <TDO, TValue>(string name, TValue defaultValue) where TDO : DependencyObject { return(DependencyProperty.Register(name, typeof(TValue), typeof(TDO), new PropertyMetadata(defaultValue))); }
/// <summary> /// Registers a dependency property, using established known type values. /// </summary> /// <typeparam name="TDO"> /// The type of the class inheriting from <see cref="DependencyObject"/>. /// </typeparam> /// <typeparam name="TValue"> /// The type of the property with an associated <see cref="DependencyProperty"/> that implements this method. /// </typeparam> /// <param name="name"> /// The name of the dependency property to register. /// The name must be unique within the registration namespace of the owner type. /// </param> /// <returns> /// Returns a dependency property identifier created using established known type values. /// </returns> public static DependencyProperty DependencyPropertyRegister <TDO, TValue>(string name) where TDO : DependencyObject { return(DependencyProperty.Register(name, typeof(TValue), typeof(TDO))); }