【发布时间】:2012-02-14 09:20:38
【问题描述】:
<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:
我不知道可能出了什么问题。例外太模糊:哪个属性?什么是空?
【问题讨论】:
标签: wpf xaml dependency-properties