次の方法で共有


DependencyObject.GetValue(DependencyProperty) メソッド

定義

指定した DependencyProperty の値にアクセスできるようにします。

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

パラメーター

dependencyProperty
DependencyProperty

DependencyProperty

戻り値

Object

指定した DependencyProperty の値を表すオブジェクト。

GetValue を使用して、get および set のコンテキストで名前付き依存関係プロパティで表される値を戻す方法を次のコード例に示します。 このコード例は、Send Email SDK サンプルの一部であり、SendMailActivity.cs ファイルのものです。 詳細については、「 電子メールの送信アクティビティのサンプル」を参照してください。

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

注釈

このメンバーは通常、プロパティで、名前付き依存関係の値を取得するために使います。

適用対象