标签:结果 com set tar src sed width eth val
<StackPanel Width="200">
<TextBox x:Name="TBS" Text="a" />
<TextBlock >
<TextBlock.Style>
<Style TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=TBS,Path=Text}" Value="a">
<Setter Property="Text" Value="Data Trigger is raised"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<Ellipse Width="100" Height="100" StrokeThickness="5" Stroke="Red">
<Ellipse.Style>
<Style TargetType="Ellipse">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=TBS,Path=Text}" Value="a">
<Setter Property="Stroke" Value="Black"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Ellipse.Style>
</Ellipse>
</StackPanel>
结果:
TextBlock的DataTrigger触发了有效果,Ellipse的DataTrigger也应该触发了,但是无效,有谁知道原因?
[WPF 学习] 6 求助:Ellipse的DataTrigger 失效
标签:结果 com set tar src sed width eth val
原文地址:https://www.cnblogs.com/catzhou/p/12484683.html