public override int GetHashCode()
        {
            int hashCode = 0;

            if (m_template != null)
            {
                hashCode ^= m_template.GetHashCode();
            }

            CollectionViewGroup group = this.Group;

            if (group != null)
            {
                hashCode ^= group.GetHashCode();
            }

            return(hashCode);
        }
        public GroupHeaderFooterItem(CollectionViewGroup collectionViewGroup, object template)
        {
            if (!(template is DataTemplate) && !(template is GroupHeaderFooterItemTemplate))
            {
                throw new ArgumentException("A GroupHeaderFooterItem can only be created with a DataTemplate or VisibleWhenCollapsed objects.", "template");
            }

            Debug.Assert(template != null);

            m_template = template;
            m_group    = new WeakReference(collectionViewGroup);

            m_hashCode = template.GetHashCode();
            if (collectionViewGroup != null)
            {
                m_hashCode ^= collectionViewGroup.GetHashCode();
            }
        }