/// <summary> /// Gets the style layer list item. /// </summary> /// <param name="style">The style.</param> /// <returns></returns> public StyleLayerListItem GetStyleLayerListItem(Style style) { if (style is CompositeStyle) { var componentStyle = style as CompositeStyle; var componentStyleItem = new ComponentStyleItem(componentStyle); componentStyleItem.ConcreteObjectUpdated += (s, e) => { var styleItem = s as StyleLayerListItem; if (styleItem.ConcreteObject == componentStyle) { componentStyle.Styles.Clear(); foreach (var item in (s as StyleLayerListItem).Children) { componentStyle.Styles.Insert(0, item.ConcreteObject as Style); } } }; return(componentStyleItem); } else { return(GetStyleLayerListItemCore(style)); } }
private void InitializeStyleItems(object selectedObject) { if (selectedObject == null) { selectedObject = componentStyle.Styles.FirstOrDefault(); } var actualRootStyleItem = new ComponentStyleItem(componentStyle); rootStyleItem = new StyleItemViewModel(actualRootStyleItem, styleArguments); rootStyleItem.StyleBuilder = this; rootStyleItem.StyleItem.ConcreteObjectUpdated += UpdatePreviewSource; ResetSelectedStyleItem(selectedObject); }