예제 #1
0
        public void UpdateKeyFrameToolTip(TimeLineKeyFrameObjectInterface keyFrameObj)
        {
            var trackItem = mTrackItems.FirstOrDefault(f => f.KeyFrameItem == keyFrameObj);

            if (trackItem != null)
            {
                trackItem.ToolTip = keyFrameObj.UpdateToolTip();
            }
        }
예제 #2
0
        public void AddTrackItem(TimeLineKeyFrameObjectInterface keyFrameItem)
        {
            var item = new TimeLineTrackItem(this, keyFrameItem);

            BindingOperations.SetBinding(item, UserControl.HeightProperty, new Binding("ActualHeight")
            {
                Source = this
            });
            item.OnRemoveTimeLineTrackItem           = new TimeLineTrackItem.Delegate_RemoveTimeLineTrackItem(_OnRemoveTimeLineTrackItem);
            item.OnUpdateTimeLineTrackItemActiveShow = new TimeLineTrackItem.Delegate_OnUpdateTimeLinkTrackItemActiveShow(_OnUpdateTimeLinkTrackItemActiveShow);
            item.OnSelected = new TimeLineTrackItem.Delegate_OnSelected(_OnTimeLineTrackItemSelected);
            mTrackItems.Add(item);
            Canvas_Track.Children.Add(item);

            mTrackItems.Sort(CompareTimeLineTrackItem);

            UpdateTrackShow();

            mHostControl?.OnCreateTimeLineTrackItem?.Invoke(item);
        }
        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();
        }