WinUI 3, Button Style Error: The attachable property 'Triggers' was not found in type 'Style'

158 Views Asked by At

I am developing a WinUI 3 C# app and have this XAML snippet:

<Style TargetType="AppBarButton" x:Key="VolumeButtonStyle">
    <Setter Property="Background" Value="Transparent"/>
    <Style.Triggers>
        <Trigger Property="MediaPlayer.IsMuted" Value="True" SourceName="ChannelMediaPlayer">
            <Setter Property="Background" Value="{ThemeResource SystemAccentColor}"/>
        </Trigger>
    </Style.Triggers>
</Style>

I am trying to use this style on this button: <AppBarButton x:Name="VolumeButton" Style="{StaticResource VolumeButtonStyle}" Icon="Volume" Label="Ένταση" Click="VolumeButton_Click"/>.

However, I am getting this error: The attachable property 'Triggers' was not found in type 'Style'

Any help appreciated!

Best regards

0

There are 0 best solutions below