요소 속성 구문과 속성 속성 구문에는 큰 의미상의 차이가 없다고 생각했습니다. 그러나, 나는 약간의 차이가 있어야한다는 것을 알았다.요소 속성 구문과 속성 속성 구문간에 의미있는 차이점이 있습니까?
예. 내가 트리거의 재산 Property
에 대한 요소 속성 구문을 사용하는 경우, 그것은 그 세터를 말하는 예외가 발생
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Button><Button.Template>
<ControlTemplate TargetType="{x:Type Button}">
<TextBlock x:Name="hello" Text="Hello" />
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="Red" TargetName="hello"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template></Button>
</Page>
: 다음 예는 단순한 트리거를 보여줍니다! (트리거가 아님) 속성과 값이 모두 필요합니다.
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Button><Button.Template>
<ControlTemplate TargetType="{x:Type Button}">
<TextBlock x:Name="hello" Text="Hello" />
<ControlTemplate.Triggers>
<Trigger Value="True">
<Trigger.Property>IsMouseOver</Trigger.Property>
<Setter Property="Foreground" Value="Red" TargetName="hello"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template></Button>
</Page>
그래서, 요소 속성 구문과 속성 구문 속성 사이의 숨겨진 차이점은 무엇입니까?