添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
腼腆的人字拖  ·  Mac os docker login : ...·  2 月前    · 
不羁的眼镜  ·  yml中的特殊字符-掘金·  1 年前    · 
满身肌肉的大脸猫  ·  C# wpf ...·  1 年前    · 

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge
public:
 static System::Windows::DependencyProperty ^ Register(System::String ^ name, Type ^ propertyType, Type ^ ownerType);
public static System.Windows.DependencyProperty Register (string name, Type propertyType, Type ownerType);
static member Register : string * Type * Type -> System.Windows.DependencyProperty
Public Shared Function Register (name As String, propertyType As Type, ownerType As Type) As DependencyProperty

Parameters

Examples

public static readonly DependencyProperty IsDirtyProperty = DependencyProperty.Register( "IsDirty", typeof(Boolean), typeof(AquariumObject3) Public Shared ReadOnly IsDirtyProperty As DependencyProperty = DependencyProperty.Register("IsDirty", GetType(Boolean), GetType(AquariumObject3))

Remarks

For more information on dependency property registration, see DependencyProperty .

public:
 static System::Windows::DependencyProperty ^ Register(System::String ^ name, Type ^ propertyType, Type ^ ownerType, System::Windows::PropertyMetadata ^ typeMetadata);
public static System.Windows.DependencyProperty Register (string name, Type propertyType, Type ownerType, System.Windows.PropertyMetadata typeMetadata);
static member Register : string * Type * Type * System.Windows.PropertyMetadata -> System.Windows.DependencyProperty
Public Shared Function Register (name As String, propertyType As Type, ownerType As Type, typeMetadata As PropertyMetadata) As DependencyProperty

Parameters

public:
 static System::Windows::DependencyProperty ^ Register(System::String ^ name, Type ^ propertyType, Type ^ ownerType, System::Windows::PropertyMetadata ^ typeMetadata, System::Windows::ValidateValueCallback ^ validateValueCallback);
public static System.Windows.DependencyProperty Register (string name, Type propertyType, Type ownerType, System.Windows.PropertyMetadata typeMetadata, System.Windows.ValidateValueCallback validateValueCallback);
static member Register : string * Type * Type * System.Windows.PropertyMetadata * System.Windows.ValidateValueCallback -> System.Windows.DependencyProperty
Public Shared Function Register (name As String, propertyType As Type, ownerType As Type, typeMetadata As PropertyMetadata, validateValueCallback As ValidateValueCallback) As DependencyProperty

Parameters

A reference to a callback that should perform any custom validation of the dependency property value beyond typical type validation.

Returns

Examples

The following example registers a dependency property, including a validation callback (the callback definition is not shown; for details on the callback definition, see ValidateValueCallback ).

public static readonly DependencyProperty CurrentReadingProperty = DependencyProperty.Register( "CurrentReading", typeof(double), typeof(Gauge), new FrameworkPropertyMetadata( Double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure, new PropertyChangedCallback(OnCurrentReadingChanged), new CoerceValueCallback(CoerceCurrentReading) new ValidateValueCallback(IsValidReading) public double CurrentReading get { return (double)GetValue(CurrentReadingProperty); } set { SetValue(CurrentReadingProperty, value); } Public Shared ReadOnly CurrentReadingProperty As DependencyProperty = DependencyProperty.Register("CurrentReading", GetType(Double), GetType(Gauge), New FrameworkPropertyMetadata(Double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure, New PropertyChangedCallback(AddressOf OnCurrentReadingChanged), New CoerceValueCallback(AddressOf CoerceCurrentReading)), New ValidateValueCallback(AddressOf IsValidReading)) Public Property CurrentReading() As Double Return CDbl(GetValue(CurrentReadingProperty)) End Get Set(ByVal value As Double) SetValue(CurrentReadingProperty, value) End Set End Property

Remarks

For more information on dependency property registration, see DependencyProperty .