如何解决如何使用行为更改按钮背景?
<Button Height="50" BorderBrush="IndianRed" Margin="5,0"
x:Name="aBtn">
<Button.Resources>
<SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="IndianRed"/>
</Button.Resources>
<StackPanel Orientation="Vertical">
<TextBlock Text="Heating" />
</StackPanel>
<iActivity:Interaction.Behaviors>
<iAction:ChangePropertyAction PropertyName="Background" Value="IndianRed" TargetObject="aBtn" />
</iActivity:Interaction.Behaviors>
这不起作用。 (我使用的是 WinUI3 预览版 4)
解决方法
TargetObject="{Binding ElementName=aBtn}"
是必需的。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。