PropertyInfo.PropertyType Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets the type of this property.
Assembly: mscorlib (in mscorlib.dll)
The following example displays the type of a property.
Note: |
|---|
To run this example, see Building examples that have static TextBlock controls for Windows Phone 8. |
Imports System.Reflection Public Class Example Public ReadOnly Property Answer() As Integer Get Return 42 End Get End Property Public Shared Sub Demo(ByVal outputBlock As System.Windows.Controls.TextBlock) ' Get a Type object for the Example type. Dim t As Type = GetType(Example) ' Get a PropertyInfo object for the Answer property. Dim pi As PropertyInfo = t.GetProperty("Answer") ' Display the type returned by the Answer property. outputBlock.Text &= String.Format("The return type of the {0}.{1} property is {2}.", _ t.Name, pi.Name, pi.PropertyType) & vbCrLf End Sub End Class ' This example produces the following output: ' 'The return type of the Example.Answer property is System.Int32.
Show:
Note: