public TimeLineTrack(TimeLineControl hostControl, TimeLineListItem item) { InitializeComponent(); mHostControl = hostControl; mListItem = item; foreach (var keyFrame in item.TLObject.GetKeyFrames()) { AddTrackItem(keyFrame); } }
public void AddTimeLineObject(TimeLineObjectInterface tlObj) { Dispatcher.Invoke(() => { TimeLineListItem item = new TimeLineListItem(tlObj); ListBox_Items.Items.Add(item); TimeLineTrack tItem = new TimeLineTrack(this, item); tItem.OnRemoveTimeLineTrackItem = new TimeLineTrackItem.Delegate_RemoveTimeLineTrackItem(_OnRemoveTimeLineTrackItem); tItem.OnUpdateTimeLinkTrackItemActiveShow = new TimeLineTrackItem.Delegate_OnUpdateTimeLinkTrackItemActiveShow(_OnUpdateTimeLinkTrackItemActiveShow); tItem.OnTimeLineTrackItemSelected = new TimeLineTrackItem.Delegate_OnSelected(_OnTimeLineTrackItemSelected); BindingOperations.SetBinding(tItem, TimeLineTrackItem.WidthProperty, new Binding("ActualWidth") { Source = StackPanel_Tracks }); StackPanel_Tracks.Children.Add(tItem); }); }