Exemplo n.º 1
0
        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);
            });
        }
        public TimeLineTrackItem(TimeLineTrack hostTimeLineTrack, TimeLineKeyFrameObjectInterface keyFrameItem)
        {
            InitializeComponent();

            mHostTimeLineTrack = hostTimeLineTrack;
            mKeyFrameItem      = keyFrameItem;

//             var ecType = Type.GetType(keyFrameItem.GetTimeLineKeyFrameObjectEditorControlType());
//             if (ecType != null)
//             {
//                 mTimeLineItemProCtrl = System.Activator.CreateInstance(ecType) as TimeLineTrackItemPropertyControl_Base;
//                 mTimeLineItemProCtrl.HostTimeLineTrackItem = this;
//                 mTimeLineItemProCtrl.PropertyInstance = keyFrameItem;
//                 //Grid_ControlContainer.Children.Add(mTimeLineItemProCtrl);
//             }

            //ProGrid.Instance = keyFrameItem;

            FrameStart      = (Int64)System.Math.Round(mKeyFrameItem.KeyFrameMilliTimeStart * 0.001 * hostTimeLineTrack.HostControl.FPS);
            FrameEnd        = (Int64)System.Math.Round(mKeyFrameItem.KeyFrameMilliTimeEnd * 0.001 * hostTimeLineTrack.HostControl.FPS);
            CanModifyLength = mKeyFrameItem.CanModityLength();
            ToolTip         = keyFrameItem.UpdateToolTip();
        }