.NET Framework Class Library
DependencyObject.GetValue Method
Provides access to the value of the designated DependencyProperty.
Assembly: System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)
Syntax
Visual Basic
Public Function GetValue ( _ dependencyProperty As DependencyProperty _ ) As Object
C#
public Object GetValue(
DependencyProperty dependencyProperty
)
Visual C++
public:
Object^ GetValue(
DependencyProperty^ dependencyProperty
)
F#
member GetValue :
dependencyProperty:DependencyProperty -> Object
Parameters
- dependencyProperty
- Type: System.Workflow.ComponentModel.DependencyProperty
The DependencyProperty.
Return Value
Type: System.ObjectThe object that represents the value of the designated DependencyProperty.
Remarks
This member is typically used in property gets to furnish the value of the named dependency value.
Examples
The following code shows how to use GetValue to return the value represented by a named dependency property in the context of get and set. This code example is part of the Send E-mail SDK sample and is from the SendMailActivity.cs file. For more information, see Send E-mail Activity Sample.
Visual Basic
<DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)> _
<BrowsableAttribute(True)> _
<DescriptionAttribute("The To property is used to specify the receipient's email address.")> _
<CategoryAttribute(MessagePropertiesCategory)> _
Public Property EmailTo() As String
Get
Return CType(MyBase.GetValue(SendEmailActivity.ToProperty), String)
End Get
Set(ByVal value As String)
MyBase.SetValue(SendEmailActivity.ToProperty, value)
End Set
End Property
<DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)> _
<BrowsableAttribute(True)> _
<DescriptionAttribute("The Subject property is used to specify the subject of the Email message.")> _
<CategoryAttribute(MessagePropertiesCategory)> _
Public Property Subject() As String
Get
Return CType(MyBase.GetValue(SendEmailActivity.SubjectProperty), String)
End Get
Set(ByVal value As String)
MyBase.SetValue(SendEmailActivity.SubjectProperty, value)
End Set
End Property
<DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)> _
<BrowsableAttribute(True)> _
<DescriptionAttribute("The From property is used to specify the From (Sender's) address for the email mesage.")> _
<CategoryAttribute(MessagePropertiesCategory)> _
Public Property FromEmail() As String
Get
Return CType(MyBase.GetValue(SendEmailActivity.FromEmailProperty), String)
End Get
Set(ByVal value As String)
MyBase.SetValue(SendEmailActivity.FromEmailProperty, value)
End Set
End Property
C#
public string To
{
get
{
return ((string)(base.GetValue(SendEmailActivity.ToProperty)));
}
set
{
base.SetValue(SendEmailActivity.ToProperty, value);
}
}
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
[BrowsableAttribute(true)]
[DescriptionAttribute("The Subject property is used to specify the subject of the Email message.")]
[CategoryAttribute(MessagePropertiesCategory)]
public string Subject
{
get
{
return ((string)(base.GetValue(SendEmailActivity.SubjectProperty)));
}
set
{
base.SetValue(SendEmailActivity.SubjectProperty, value);
}
}
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
[BrowsableAttribute(true)]
[DescriptionAttribute("The From property is used to specify the From (Sender's) address for the email mesage.")]
[CategoryAttribute(MessagePropertiesCategory)]
public string From
{
get
{
return ((string)(base.GetValue(SendEmailActivity.FromProperty)));
}
set
{
base.SetValue(SendEmailActivity.FromProperty, value);
}
}
Version Information
.NET Framework
Supported in: 4, 3.5, 3.0.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Platforms
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
See Also