void DataContextChangedHandler(object sender, DependencyPropertyChangedEventArgs e)
        {
            SectionModel = (SectionViewModel)e.NewValue;

            if (selectionHelper != null)
            {
                selectionHelper.Attach(SectionModel);
            }
        }
        /// <summary>
        /// Sets the relationship canvas and sets the PART_Content to <see cref="ElementViewModel.Bindable"/>.
        /// </summary>
        public override void OnApplyTemplate()
        {
            Focusable = true;
            base.OnApplyTemplate();
            this.selectionHelper = new SelectionHelper(this);
            selectionHelper.Attach(SectionModel);

            RelationshipCanvas = Template.FindName("PART_RelationshipCanvas", this) as Canvas;
            Content            = Template.FindName("PART_Content", this) as ContentControl;
            if (Content != null)
            {
                Content.Content = SectionModel.Bindable;
            }
        }
        void DataContextChangedHandler(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (elementModel != null)
            {
                BindingOperations.ClearBinding(this, IsExpandedProperty);
            }

            elementModel = e.NewValue as ElementViewModel;

            if (elementModel == null)
            {
                return;
            }
            selectionHelper.Attach(elementModel);

            CreateElementBindings();
        }
        /// <summary>
        /// Sets the relationship canvas and sets the PART_Content to <see cref="ElementViewModel.Bindable"/>.
        /// </summary>
        public override void OnApplyTemplate()
        {
            Focusable = true;
            base.OnApplyTemplate();
            this.selectionHelper = new SelectionHelper(this);
            selectionHelper.Attach(SectionModel);

            RelationshipCanvas = Template.FindName("PART_RelationshipCanvas", this) as Canvas;
            Content = Template.FindName("PART_Content", this) as ContentControl;
            if (Content != null) Content.Content = SectionModel.Bindable;
        }