<Style TargetType="controls:EventTimeView">
<Style.Triggers>
<Trigger Property="PositioningMethod" Value="Column" >
<Setter Property="Background" Value="Black" />
</Trigger>
</Style.Triggers>
</Style>
PositioningMethod is a dependency property of EventTimeView of an enum type.
Results in:
System.InvalidOperationException occurred
Message=Property can not be null on Trigger.
Source=PresentationFramework
StackTrace:
at System.Windows.StyleHelper.UpdateTables(PropertyValue& propertyValue, FrugalStructList`1& childRecordFromChildIndex, FrugalStructList`1& triggerSourceRecordFromChildIndex, FrugalStructList`1& resourceDependents, HybridDictionary& dataTriggerRecordFromBinding, HybridDictionary childIndexFromChildName, Boolean& hasInstanceValues)
InnerException:
I have no idea what might be wrong. The exception is too vague: which property? what is null?
Double check your DependencyProperty definition for PositioningMethodProperty - make sure the owning type is in fact the class in which the DP is defined.
I was getting this error because I was using Trigger
instead of DataTrigger
and I was binding the trigger to a property in the data context and not to a property in the control per se.
Once I changed the Trigger
tag to DataTrigger
, the error disappeared.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With