<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