Click here to Skip to main content
14,978,671 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,
I still get a bit confused wen it comes to triggers in WPF so please help.I am totally lost here .Following is part of my code.

XML
<MultiDataTrigger>
                           <MultiDataTrigger.Conditions>
                             I want to put a condition here saying if select button is clicked(the select button is a ribbon toggle button) then only on mouse over the decorator shoulds be visble
                           </MultiDataTrigger.Conditions>
                           <Setter TargetName="Decorator" Property="Visibility" Value="Visible"/>
                       </MultiDataTrigger>

XML
<Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Decorator" Property="Visibility" Value="Visible"/>
                        </Trigger>


I hope I am clear with this question.the ribbon button is in another xaml file
All I want is after I click the ribbon button "select" on mouseover the decorator shoulds be visible else hidden if we can do this in code behind on button click also ok but I am not sure how to change the property that is set on another xaml file.

Thanks in advance
Posted

Hi,


Create a style resource by adding resource file to your project
In that resource define a style for the ribbon button and on style.trigger define your decorator visibility proeprty

Hope this helps.
   

If you want conditions on Dependency Properties, you can use a MultiTrigger.


If your have conditions on properties the aren't Dependency Properties, you can use a MultiDataTrigger.


There are examples of the use of these triggers in the MSDN topics about them.

   

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