﻿namespace Rocket.UI
{
    /// <summary>
    /// Item container.
    /// </summary>
    public class ItemContainer : ContentControl
    {
        /// <summary>
        /// The default template.
        /// </summary>
        private static readonly ControlTemplate DefaultTemplate = new ControlTemplate<ItemContainer>(template =>
        {
            return new ContentPresenter();
        });

        /// <summary>
        /// Gets the default value for the property.
        /// </summary>
        /// <param name="property">The property.</param>
        /// <returns>The default value for the property.</returns>
        protected override object GetDefaultValue(Property property)
        {
            if (property == CanHighlightProperty)
            {
                return true;
            }

            if (property == TemplateProperty)
            {
                return DefaultTemplate;
            }

            return base.GetDefaultValue(property);
        }
    }
}
