/// <inheritdoc/>
        public virtual SegmentViewModelBase CreateSplitSegmentModelViewModel(SegmentViewModelBase segmentViewModelToSplit, int frameNumberToSplitAt)
        {
            KeyFrameViewModelCollection splitKeyFrameViewModels = new KeyFrameViewModelCollection();

            if (segmentViewModelToSplit.ActiveKeyFrame?.FrameNumber >= frameNumberToSplitAt)
            {
                segmentViewModelToSplit.ActiveKeyFrame = null;
            }

            int keyFrameIndex = segmentViewModelToSplit.KeyFrameViewModels.LowerBoundIndex(frameNumberToSplitAt);

            if (keyFrameIndex < segmentViewModelToSplit.KeyFrameViewModels.Count)
            {
                KeyFrameViewModelBase keyFrameViewModel = segmentViewModelToSplit.KeyFrameViewModels[keyFrameIndex];
                if (keyFrameViewModel.FrameNumber > frameNumberToSplitAt)
                {
                    // Lerp new KeyFrameViewModel and add to splitKeyFrameViewModels
                    Debug.Assert(keyFrameIndex > 0);

                    keyFrameViewModel = segmentViewModelToSplit.KeyFrameViewModels[keyFrameIndex - 1].Lerp(frameNumberToSplitAt, keyFrameViewModel);

                    splitKeyFrameViewModels.Add(keyFrameViewModel);
                }

                // Loop from keyFrameIndex and move (via remove & add) KeyFrameViewModel(s) to splitKeyFrameViewModels
                do
                {
                    keyFrameViewModel = segmentViewModelToSplit.KeyFrameViewModels[keyFrameIndex];

                    segmentViewModelToSplit.KeyFrameViewModels.RemoveAt(keyFrameIndex);
                    segmentViewModelToSplit.Model.KeyFrames.RemoveAt(keyFrameIndex);

                    splitKeyFrameViewModels.Add(keyFrameViewModel);
                } while (keyFrameIndex < segmentViewModelToSplit.KeyFrameViewModels.Count);
            }
            else
            {
                // Lerp new KeyFrameViewModel and add to splitKeyFrameViewModels
                KeyFrameModelBase keyFrameModel = segmentViewModelToSplit.Model.KeyFrames.Last(kfm => kfm.FrameNumber < frameNumberToSplitAt).DeepCopy();
                keyFrameModel.FrameNumber = frameNumberToSplitAt;

                splitKeyFrameViewModels.Add(segmentViewModelToSplit.CreateKeyFrameViewModel(keyFrameModel));
            }

            int splitViewModelEndFrame = segmentViewModelToSplit.EndFrame;

            segmentViewModelToSplit.EndFrame = frameNumberToSplitAt - 1;

            return(CreateSegmentModelViewModel(segmentViewModelToSplit, segmentViewModelToSplit.TrackNumber,
                                               frameNumberToSplitAt, splitViewModelEndFrame, segmentViewModelToSplit.Name,
                                               splitKeyFrameViewModels));
        }
 /// <inheritdoc/>
 public abstract SegmentViewModelBase CreateSegmentModelViewModel(SegmentViewModelBase sourceViewModel, int?trackNumber = null, int?startFrame = null, int?endFrame = null, string name = null, KeyFrameViewModelCollection keyFrameViewModels = null);