Trigger.Value 속성

정의

요소의 속성 값과 비교할 값을 가져오거나 설정합니다. 수행되는 비교 작업은 참조 일치 검사입니다.

public:
 property System::Object ^ Value { System::Object ^ get(); void set(System::Object ^ value); };
[System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)]
[System.Windows.Markup.DependsOn("Property")]
[System.Windows.Markup.DependsOn("SourceName")]
public object Value { get; set; }
[System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)]
[System.Windows.Markup.DependsOn("Property")]
[System.Windows.Markup.DependsOn("SourceName")]
[System.ComponentModel.TypeConverter(typeof(System.Windows.Markup.SetterTriggerConditionValueConverter))]
public object Value { get; set; }
[<System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)>]
[<System.Windows.Markup.DependsOn("Property")>]
[<System.Windows.Markup.DependsOn("SourceName")>]
member this.Value : obj with get, set
[<System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)>]
[<System.Windows.Markup.DependsOn("Property")>]
[<System.Windows.Markup.DependsOn("SourceName")>]
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Markup.SetterTriggerConditionValueConverter))>]
member this.Value : obj with get, set
Public Property Value As Object

속성 값

Object

기본값은 null입니다. 예외 부분을 참조하십시오.

특성

예외

바인딩 등의 식이 지원되지 않는 경우

Trigger이 사용 중인 경우에는 수정할 수 없습니다.

예제

다음은 속성이 .인 Foreground 경우 IsPressed 단추의 속성을 변경하는 예제입니다 true.

<Style x:Key="Triggers" TargetType="Button">
    <Style.Triggers>
    <Trigger Property="IsPressed" Value="true">
        <Setter Property = "Foreground" Value="Green"/>
    </Trigger>
    </Style.Triggers>
</Style>

설명

이 값은 속성이 반환 Property 하는 속성 값과 비교됩니다 Trigger. 수행되는 비교는 참조 품질 검사입니다. 두 값이 같으면 연결된 Setter값이 지정된 속성 값을 적용합니다.

트리거가 의미 있도록 트리거의 Property Trigger 속성과 Value 속성을 모두 지정해야 합니다. 따라서 속성 중 하나 또는 둘 다를 지정하지 않으면 예외가 throw됩니다.

XAML 속성 요소 사용

<object>  
  <object.Value>  
    Value  
  </object.Value>  
</object>  

적용 대상

추가 정보