次のことができるカスタム パネルを作成しました。
<custom:Timeline>
<Button custom:Timeline.PointInTime="6:30 PM" />
</custom:Timeline>
私がこれを行うと、それは素晴らしく機能します。しかし、私がこのようなことをするとき(これは私がする必要があることです):
<DataTemplate x:Key="TimelineItemTemplate">
<Grid d:DesignWidth="169" custom:Timeline.PointInTime="{Binding NotifyTime}">
</Grid>
</DataTemplate>
<ItemsControl Grid.RowSpan="2" ItemTemplate="{DynamicResource TimelineItemTemplate}" ItemsSource="{Binding Items}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<custom:Timeline/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
PointInTime 添付プロパティがInternalChildren
コレクション内のコントロールに設定されていません。
protected override Size ArrangeOverride(Size a_arrangeBounds)
{
foreach (UIElement uiChild in InternalChildren)
{
var pointInTime = GetPointInTime(uiChild);
// Arranginess stuff
// Timeline.PointInTimeProperty is not set on 'uiChild'. WTH?
}
return base.ArrangeOverride(a_arrangeBounds);
}
これを修正するにはどうすればよいですか?