Implement MultiDataTrigger like WPF in Style
See original GitHub issueI can’t implement a function similar to the MultiDataTrigger in the Avalonia Style. In WPF, it looks like:
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}, Mode=OneWay}"
Value="True" />
<Condition Binding="{Binding Path=(local:CustomHelper.PressedForeground), Converter={StaticResource {x:Static IsNonnullConverter}}, RelativeSource={RelativeSource Self}, Mode=OneWay}"
Value="True" />
</MultiDataTrigger.Conditions>
<Setter TargetName="BdrMain"
Property="Background"
Value="{Binding Path=(local:CustomHelper.PressedForeground), RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" />
</MultiDataTrigger>
Is there a similar implementation in Avalonia?
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
WPF MultiTrigger and MultiDataTrigger
There are two types of multi triggers: The MultiTrigger, which just like the regular Trigger works on dependency properties, and then the MultiDataTrigger, ......
Read more >What's the right way to trigger on multiple conditions in a ...
How can I provide multiple conditions for data trigger in WPF? ... How to use MultiDataTrigger to check a single condition to be...
Read more >MultiTriggers And MultiDataTriggers In WPF
You can use MultiDataTrigger in this case. It works with the bound value from ViewModel or code-behind rather than dependent on control's ...
Read more >MultiDataTrigger Class (System.Windows)
A MultiDataTrigger object is similar to a MultiTrigger, except that the conditions of a MultiDataTrigger are based on property values of bound data...
Read more >MultiDataTrigger.Conditions Property (System.Windows)
A MultiDataTrigger object is similar to a MultiTrigger, except that the conditions of a MultiDataTrigger are based on property values of bound data...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Instead of
{StaticResource IsNotnullConverter}
you can use{x:Static ObjectConverters.IsNotNull}
- build in converter.It’s not exactly the same, but allow to implement quite a lot.
To change property - use ChangePropertyAction, to set class (and trigger style selector) - use AddClassAction. I am not sure if there are composite triggers with Or/And conditions, but I would expect it. @wieslawsoltes