microsoft/XamlBehaviorsWpf

PropertyChangedTrigger with ConditionalExpression does not work. DataTrigger does work.

Zolomon opened this issue · 1 comments

Describe the bug
I am trying to use a ContentPresenter together with a PropertyChangedTrigger in Interactivity.Triggers to set its ContentTemplate property dynamically based on multiple conditions. I could not get this to work, so I tried using only a single condition. I could not get this to work either, however using DataTriggers works but they are limited to single value comparisons (I am aware that I can make computed properties that hides the multiple condition).

Link at the bottom to a git repo that reproduces my case.

I need to use multiple ComparisonConditions, what am I doing wrong?

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://github.com/Zolomon/xaml-behaviors-trigger-bug
  2. Run the application locally
  3. See error

Expected behavior
Left side should look the same as the right side.

Screenshots
Here is a screenshot:

Desktop (please complete the following information):

  • Version with bug: 1.1.0.0
  • Last known working version: ????

Reproduction Link
https://github.com/Zolomon/xaml-behaviors-trigger-bug

The PropertyChangedTrigger represents a trigger that performs actions when the bound data changes. You can't define behaviors inside of a PropertyChangedTrigger. I think you might want to look as using a ContentTemplateSelector instead.