/// <summary>
 /// Get the item containers of an ItemsControl.
 /// </summary>
 /// <typeparam name="TContainer">
 /// The type of the item containers.
 /// </typeparam>
 /// <param name="control">The ItemsControl.</param>
 /// <returns>The item containers of an ItemsControl.</returns>
 private static IEnumerable <TContainer> GetContainersIterator <TContainer>(ItemsControl control)
     where TContainer : DependencyObject
 {
     Debug.Assert(control != null, "control should not be null!");
     return(control.GetItemsAndContainers <TContainer>().Select(p => p.Value));
 }