이 설명서는 보관되지만 유지 되지 않습니다.

DependencyProperty.OwnerType 속성

Gets the type of the object that registered the dependency property with the property system, or added itself as owner of the property.

네임스페이스: System.Windows
어셈블리: WindowsBase(windowsbase.dll)
XML 네임스페이스:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public Type OwnerType { get; }
/** @property */
public Type get_OwnerType ()

public function get OwnerType () : Type

이 속성은 XAML에서 사용할 수 없습니다.

속성 값

The type of the object that registered the property or added itself as owner of the property.

This value was provided during property registration. The owner will be either the original registering type in the case of a DependencyProperty identifier generated from a Register call, or the type that added itself as owner in the case of a DependencyProperty identifier generated from an AddOwner call.

The OwnerType on any given DependencyProperty is immutable, and cannot be null 참조(Visual Basic의 경우 Nothing) in a valid DependencyProperty.

The following example gets the owner type based on a dependency property identifier dp, and then gets metadata on the owner type for that same identifier. This operation is actually equivalent to getting DefaultMetadata on dp.

pm = dp.GetMetadata(dp.OwnerType);

추가 코드

How to: Implement a Dependency Property

This example shows how to back a common language runtime (CLR) property with a DependencyProperty field, thus defining a dependency property. When you define your own properties and want them to support many aspects of Windows Presentation Foundation (WPF) functionality, including styles, data binding, inheritance, animation, and default values, you should implement them as a dependency property.

Microsoft .NET Framework 3.0은 Windows Vista, Microsoft Windows XP SP2 및 Windows Server 2003 SP1에서 지원됩니다.

.NET Framework

3.0에서 지원
표시: