private static void AddSubEntitiesToComponentStyleEntity(StyleLayerListItem item)
 {
     //var subEntity = new LayerListItem();
     //subEntity.Parent = componentStyleEntity;
     //subEntity.ConcreteObject = item;
     //subEntity.Name = item.Name;
     //item.CheckBoxVisibility = System.Windows.Visibility.Collapsed;
     item.PreviewImage = new Image {
         Source = item.GetPreviewSource(23, 23)
     };
     AddMenuItems(item);
     item.DoubleClicked = () =>
     {
         GisEditor.LayerListManager.SelectedLayerListItem = item;
         EditStyle(item);
     };
     if (item.Children.Count > 0)
     {
         AddComplicatedStyleInnerStyles(item);
     }
     //componentStyleEntity.Children.Add(subEntity);
 }
        private static void CreateComponentStyleEntity(StyleLayerListItem styleItem)
        {
            var bitmapSource = styleItem.GetPreviewSource(23, 23);

            styleItem.PreviewImage = new Image {
                Source = bitmapSource
            };
            styleItem.IsExpanded = false;

            styleItem.DoubleClicked = () =>
            {
                GisEditor.LayerListManager.SelectedLayerListItem = styleItem;
                GisEditor.ActiveMap.ActiveLayer = GisEditor.LayerListManager.SelectedLayerListItem.Parent.ConcreteObject as Layer;
                EditStyle(styleItem);
            };

            AddMenuItems(styleItem);
            styleItem.ContextMenuItems.Add(LayerListMenuItemHelper.GetSaveStyleMenuItem());

            foreach (var item in styleItem.Children.OfType <StyleLayerListItem>())
            {
                AddSubEntitiesToComponentStyleEntity(item);
            }
        }