What's the equivelant of this DataTrigger in C# code?
<DataTrigger
Binding="{Binding}"
Value="{x:Null}">
<Setter
Property=SomeProperty
Value=SomeValue />
</DataTrigger>
I am skeptical on how to create the Binding. Is this correct?
var trigger = new DataTrigger();
trigger.Value = null;
// Is this sufficient?
trigger.Binding = new Binding();
// Code to create the setter
// ...
Binding="{Binding}"that I don't know how to create.trigger.Binding = new Binding(".");should be equivalent. However, neither that norBinding="{Binding}"makes sense on a DataTrigger, because it lacks a source property that could be updated and thus trigger the Trigger.