我想用这个触发器制作一个按钮。但是这不起作用。即使自定义数据模板也没有。这失败了
{"触发器集合成员必须是 EventTrigger 类型。"}
<Button cal:Message.Attach="Switch" Width="55" HorizontalAlignment="Left"
Style="{StaticResource OrderProductButton}" Margin="6,4,0,7">
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="literal" Foreground="White"
xml:space="preserve">€</TextBlock>
<TextBlock Foreground="White" xml:space="preserve"> / </TextBlock>
<TextBlock x:Name="percent" Foreground="Gray"> %</TextBlock>
</StackPanel>
<Button.Triggers>
<DataTrigger Binding="{Binding IsPercent}" Value="True">
<Setter Property="TextBlock.FontWeight" Value="Bold"
TargetName="percent" />
<Setter Property="TextBlock.Foreground" Value="White"
TargetName="percent" />
</DataTrigger>
<DataTrigger Binding="{Binding IsPercent}" Value="false">
<Setter Property="TextBlock.FontWeight" Value="Bold"
TargetName="literal" />
<Setter Property="TextBlock.Foreground" Value="White"
TargetName="literal" />
</DataTrigger>
</Button.Triggers>
</Button>