Event and Data Triggers can be combined?

1.1k Views Asked by At

Is it possible to declare a MultiTrigger with an Event and a DataTrigger?

I have a scenario to start a Storyboard which is given in the Event Trigger when a bool Property of Control is set to True.

That why i need to make these two as a MultiTrigger. I know that there is no direct way to do it, but am looking for any workaround..

Any idea on this?

2

There are 2 best solutions below

0
On BEST ANSWER

I had an workaround for this..

Creating a property in the Custom control and that to be targeted and changed in the Storyboard.

The property which is targeted previously was bound with this new Property as MultiBuinding and have converter for that. So there i can get both the values, with that i can return the value which required for the base property.

2
On

Looking at the MultiTrigger Class page on MSDN, which should have been your first place to search, you can see an example that clearly shows that a MultiTrigger does not contain Triggers... it contains Condition and Setter elements. From the linked page on MSDN:

<MultiTrigger>
    <MultiTrigger.Conditions>
        <Condition Property="HasItems" Value="false" />
        <Condition Property="Width" Value="Auto" />
    </MultiTrigger.Conditions>
    <Setter Property="MinWidth" Value="120"/>
</MultiTrigger>

So no, you cannot combine Triggers inside a MultiTrigger.

Please note that searching the internet with the words from your title 'Combine Event and Data Triggers' also displayed several posts with answers. As a member of this site, you are expected to 'Search and Research' before you ask a question to avoid simple and duplicate questions from being posted. Please do so in future.