/// <summary>
        /// Positioning the element
        /// </summary>
        public void Update()
        {
            TLElementContent.Width  = EndTime - StartTime;
            TLElementContent.Height = ElementHeight;
            if (Grabbed)
            {
                Canvas.SetZIndex(this, timeline.PictureElements.Count);
            }
            else
            {
                Canvas.SetZIndex(this, timeline.PictureElements.IndexOf(this));
            }
            Canvas.SetLeft(this, StartTime);
            Canvas.SetTop(this, TopSpacing);

            TimelineSettingsControl tlControls = ((MainWindow)Application.Current.MainWindow).timelineControls;

            if (tlControls == null || tlControls.DisplayTime.IsEnabled == false || timeline.Marked == null || timeline.Marked != this)
            {
                return;
            }
            int newValue = ((int)Math.Floor(EndTime - StartTime)) * 10;

            if (tlControls.DisplayTime.Value != newValue)
            {
                tlControls.DisplayTime.Value = newValue;
            }
        }
        /// <summary>
        /// Mark element as selected and enable TimelineControls
        /// </summary>
        public void Select()
        {
            TimelineSettingsControl tlControls = ((MainWindow)Application.Current.MainWindow).timelineControls;

            if (tlControls == null)
            {
                return;
            }
            tlControls.DisplayTime.IsEnabled    = true;
            tlControls.Transition.IsEnabled     = true;
            tlControls.TransitionTime.IsEnabled = Transition != null;

            tlControls.DisplayTime.Value        = (int)Math.Floor(EndTime - StartTime) * 10;
            tlControls.Transition.SelectedIndex = Transition.getID(Transition);
            tlControls.TransitionTime.Value     = Transition == null ? 0 : Transition.ExecutionTime;
        }