views:

277

answers:

1

in an answer to this question the following statement was made

"In theory it might be possible to .... trigger on {x:Static DependencyProperty.UnsetValue}, which would be much cleaner, but this doesn't appear to work in practice."

Has anybody had any luck in doing this?

A: 

A failing Binding will return null (or the fallbackvalue), which is different from an UnsetValue.

the answer itowlson gave you is probably the best you will get. In this specific case, you might be able to use:

<DataTrigger Binding="{Binding Hibble, FallbackValue={x:Static DependencyProperty.UnsetValue}}" Value="{x:Static DependencyProperty.UnsetValue}">
  <Setter Property="Background" Value="Red" />
</DataTrigger>

which is practically the same.

(you might want to take a look into this)

redoced