0
<Button Height="50" BorderBrush="IndianRed" Margin="5,0,0,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 Preview 4)

4

1 回答 1

0

TargetObject="{Binding ElementName=aBtn}"是需要的。

于 2021-03-11T15:14:58.310 回答