Partager via


DependencyObject.GetValue(DependencyProperty) Méthode

Définition

Fournit l'accès à la valeur du DependencyProperty désigné.

public:
 System::Object ^ GetValue(System::Workflow::ComponentModel::DependencyProperty ^ dependencyProperty);
public object GetValue (System.Workflow.ComponentModel.DependencyProperty dependencyProperty);
member this.GetValue : System.Workflow.ComponentModel.DependencyProperty -> obj
Public Function GetValue (dependencyProperty As DependencyProperty) As Object

Paramètres

dependencyProperty
DependencyProperty

L’DependencyPropertyopérateur

Retours

Object

Objet qui représente la valeur de l'objet DependencyProperty désigné.

Exemples

Le code suivant affiche la manière d'utiliser la méthode GetValue pour retourner la valeur représentée par une propriété de dépendance nommée dans le contexte Get et Set. Cet exemple de code fait partie de l’exemple du Kit de développement logiciel (SDK) Send Email et provient du fichier SendMailActivity.cs. Pour plus d’informations, consultez l’exemple d’activité Envoyer un e-mail.

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);
    }
}
<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

Remarques

Ce membre est généralement utilisé dans Property Get pour fournir la valeur de dépendance nommée.

S’applique à