private void MarkerEditName_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            DebugHelper.AssertUIThread();

            if (e != null)
            {
                TimelineMarker marker = e.Parameter as TimelineMarker;

                if (marker != null)
                {
                    e.Handled = true;

                    Window window = Window.GetWindow(this);

                    EditStringDialog dialog = new EditStringDialog()
                    {
                        Owner         = window,
                        Title         = Strings.EditTimeMarker_Title,
                        Prompt        = Strings.TimelineMarker_Name_Prompt,
                        Value         = marker.Name,
                        MaximumLength = 63,
                    };

                    if (dialog.ShowDialog() == true)
                    {
                        marker.Name = dialog.Value.Trim();
                    }
                }
            }
        }
        private void MarkerAdd_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            DebugHelper.AssertUIThread();

            if ((e != null) && (this.MarkersSource != null) && (this.newPointTime.HasValue))
            {
                e.Handled = true;

                Window window = Window.GetWindow(this);

                string name = GetUniqueMarkerName();

                EditStringDialog dialog = new EditStringDialog()
                {
                    Owner         = window,
                    Title         = Strings.TimelineMarker_Add_Title,
                    Prompt        = Strings.TimelineMarker_Name_Prompt,
                    Value         = name,
                    MaximumLength = 63,
                };

                if (dialog.ShowDialog() == true)
                {
                    this.MarkersSource.AddAt(this.newPointTime.Value, dialog.Value.Trim());
                }
            }

            this.newPointTime = null;
        }
        private void MarkerEditName_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            DebugHelper.AssertUIThread();

            if (e != null)
            {
                TimelineMarker marker = e.Parameter as TimelineMarker;

                if (marker != null)
                {
                    e.Handled = true;

                    Window window = Window.GetWindow(this);

                    EditStringDialog dialog = new EditStringDialog()
                    {
                        Owner = window,
                        Title = Strings.EditTimeMarker_Title,
                        Prompt = Strings.TimelineMarker_Name_Prompt,
                        Value = marker.Name,
                        MaximumLength = 63,
                    };

                    if (dialog.ShowDialog() == true)
                    {
                        marker.Name = dialog.Value.Trim();
                    }
                }
            }
        }
        private void MarkerAdd_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            DebugHelper.AssertUIThread();

            if ((e != null) && (this.MarkersSource != null) && (this.newPointTime.HasValue))
            {
                e.Handled = true;

                Window window = Window.GetWindow(this);

                string name = GetUniqueMarkerName();

                EditStringDialog dialog = new EditStringDialog()
                    {
                        Owner = window,
                        Title = Strings.TimelineMarker_Add_Title,
                        Prompt = Strings.TimelineMarker_Name_Prompt, 
                        Value = name,
                        MaximumLength = 63,
                    };

                if (dialog.ShowDialog() == true)
                {
                    this.MarkersSource.AddAt(this.newPointTime.Value, dialog.Value.Trim());
                }
            }

            this.newPointTime = null;
        }