Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi
I have I short question regarding wpf styles and triggers. Let's say I have the following style.

XML
<Style x:Key="ButtonStyleBase" TargetType="{x:Type Button}">
        <Style.Triggers>
            <EventTrigger RoutedEvent="PreviewMouseDown">
                <SoundPlayerAction Source="ButtonSound.wav" />
            </EventTrigger>
        </Style.Triggers>
    </Style>



Another style is based on the previous one like:

XML
<Style x:Key="SilentButtonStyle" TargetType="{x:Type Button} BasedOn="{StaticResource ButtonStyleBase}">
  
</Style>


How can I disable the event trigger in the SilentButton stlye? Is there any way of doing that - beside the obvious one - using another style as a base style or without using the base style at all.
Posted
Updated 5-Jun-13 13:11pm
v2
Comments
Alexander Dymshyts 6-Jun-13 9:41am    
Maybe you can use Multitriger. Then you can add new trigger to check condition of event and raise trigger actions.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900