//--------------------------------------------------------------------------------------------------

        public void AddPanel(PropertyPanel panel, PropertyPanel insertAfter)
        {
            var index = PropertyPanels.IndexOfFirst(p => p.Panel == insertAfter);

            if (index >= 0)
            {
                PropertyPanels.Insert(index + 1, new PropertyPanelItem(PropertyPanels[index].SortingKey, panel));
            }
            else
            {
                PropertyPanels.Add(new PropertyPanelItem(int.MaxValue, panel));
            }
            panel.OnAddedToPane(this);
        }
        //--------------------------------------------------------------------------------------------------

        #region IPropertyPanelManager

        public void AddPanel(PropertyPanel panel, int sortingKey)
        {
            var index = PropertyPanels.IndexOfFirst(p => p.SortingKey > sortingKey);

            if (index >= 0)
            {
                PropertyPanels.Insert(index, new PropertyPanelItem(sortingKey, panel));
            }
            else
            {
                PropertyPanels.Add(new PropertyPanelItem(sortingKey, panel));
            }
            panel.OnAddedToPane(this);
        }