<Style TargetType="controls:EventTimeView">
<Style.Triggers>
<Trigger Property="PositioningMethod" Value="Column" >
<Setter Property="Background" Value="Black" />
</Trigger>
</Style.Triggers>
</Style>
PositioningMethod是枚举类型的EventTimeView的依赖项属性。触发器的属性不能为空
结果:
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:
我不知道什么可能是错误的。例外情况太模糊:哪个属性?什么是空?
现货!谢谢 – Zoman 2012-10-15 17:30:10