public virtual void Synchronize()
        {
            PropertyGridItem item = VisualItem.Data as PropertyGridItem;

            if (item != null)
            {
                if (item.Level == 0)
                {
                    this.Visibility = ElementVisibility.Collapsed;
                }
                else
                {
                    this.Visibility = ElementVisibility.Visible;
                }
            }
            PropertyGridItemElement visualItem = VisualItem as PropertyGridItemElement;

            if (visualItem != null)
            {
                this.SetValue(IsRootItemWithChildrenProperty, visualItem.Data.GridItems.Count > 0 && visualItem.Data.Level == 0);
                this.SetValue(IsInEditModeProperty, visualItem.GetValue(PropertyGridItemElement.IsInEditModeProperty));
            }
        }
        public virtual void Synchronize()
        {
            PropertyGridItem data = this.VisualItem.Data as PropertyGridItem;

            if (data != null)
            {
                if (data.Level == 0)
                {
                    this.Visibility = ElementVisibility.Collapsed;
                }
                else
                {
                    this.Visibility = ElementVisibility.Visible;
                }
            }
            PropertyGridItemElement visualItem = this.VisualItem as PropertyGridItemElement;

            if (visualItem == null)
            {
                return;
            }
            int num1 = (int)this.SetValue(PropertyGridRowHeaderElement.IsRootItemWithChildrenProperty, (object)(bool)(data.GridItems.Count <= 0 ? 0 : (visualItem.Data.Level == 0 ? 1 : 0)));
            int num2 = (int)this.SetValue(PropertyGridRowHeaderElement.IsInEditModeProperty, visualItem.GetValue(PropertyGridItemElement.IsInEditModeProperty));
        }