/// <summary>
 /// Clears the specified caption.
 /// </summary>
 /// <param name="caption">The caption.</param>
 public void Clear(String caption)
 {
     lock (this)
     {
         if (Captions.Contains(caption))
         {
             Captions.Remove(caption);
             Properties.Remove(caption);
         }
     }
 }
        private void OnDeleteCaption(object sender, RoutedEventArgs e)
        {
            Button btn = sender as Button;

            if (btn != null)
            {
                ClosedCaptionDependencyObject obj = btn.CommandParameter as ClosedCaptionDependencyObject;
                if (obj != null)
                {
                    Captions.Remove(obj);
                }
            }
        }