private void InitializeCommands() { applyCommand = new ObservedCommand(() => { if (stylePropertyContent != null) { StyleLayerListItem styleListItem = stylePropertyContent.StyleItem; LayerListItem componentLayerListItem = StylePropertyUIPlugin.GetSpecificLayerListItem <CompositeStyle>(styleListItem); if (componentLayerListItem != null) { CompositeStyle oldStyle = (CompositeStyle)componentLayerListItem.ConcreteObject; List <Style> innerStyles = oldStyle.Styles.ToList(); oldStyle.Styles.Clear(); foreach (var innerStyle in componentLayerListItem.Children.OfType <StyleLayerListItem>() .Select(item => item.ConcreteObject).OfType <Style>().Reverse()) { oldStyle.Styles.Add(innerStyle); } if (featureLayer != null) { //GisEditor.ActiveMap.GetOverlaysContaining(featureLayer).ForEach(o => o.Refresh()); GisEditor.ActiveMap.GetOverlaysContaining(featureLayer).ForEach(o => o.RefreshWithBufferSettings()); LayerListUIPlugin layerListUIPlugin = GisEditor.UIManager.GetActiveUIPlugins <LayerListUIPlugin>().FirstOrDefault(); if (layerListUIPlugin != null) { layerListUIPlugin.Refresh(new RefreshArgs(this, "StyleProperties Applied.")); } } } } }, () => stylePropertyContent != null); }
public ValueSubItem(ValueItem valueItem, string columnName) : base(valueItem) { this.CanAddInnerStyle = true; this.valueItem = valueItem; this.columnName = columnName; foreach (var customStyle in valueItem.CustomStyles.Reverse()) { StyleLayerListItem styleItem = GisEditor.StyleManager.GetStyleLayerListItem(customStyle); Children.Add(styleItem); } }
public FilterStyleItem(FilterStyle style) : base(style) { CanRename = true; CanAddInnerStyle = true; filterStyle = style; if (filterStyle != null) { foreach (var innerStyle in filterStyle.Styles.Reverse()) { StyleLayerListItem styleItem = GisEditor.StyleManager.GetStyleLayerListItem(innerStyle); Children.Add(styleItem); } } }
internal static BitmapSource GetPreviewSource(this StyleLayerListItem styleItem, int screenWidth, int screenHeight) { BitmapImage bitmapImage = new BitmapImage(); var imageBuffer = styleItem.GetPreviewImage(screenWidth, screenHeight); if (imageBuffer != null) { bitmapImage.BeginInit(); bitmapImage.StreamSource = new MemoryStream(imageBuffer); bitmapImage.EndInit(); bitmapImage.Freeze(); } return(bitmapImage); }
private void LayerListManager_SelectedLayerListItemChanged(object sender, SelectedLayerListItemChangedLayerListManagerEventArgs e) { StyleUserControl currentStyleUI = null; StyleLayerListItem styleLayerListItem = e.NewValue as StyleLayerListItem; if (styleLayerListItem != null) { Style style = styleLayerListItem.ConcreteObject as Style; FeatureLayer featureLayer = GetConcreteObjectContaining <FeatureLayer>(styleLayerListItem); if (featureLayer != null && featureLayer.IsVisible && style != null) { StyleBuilderArguments argument = new StyleBuilderArguments(); argument.FeatureLayer = featureLayer; argument.StyleToEdit = new CompositeStyle(style); argument.FillRequiredColumnNames(); currentStyleUI = styleLayerListItem.GetUI(argument); stylePropertyViewModel.FeatureLayer = featureLayer; } } stylePropertyViewModel.StylePropertyContent = currentStyleUI; }
protected override bool CanContainStyleItemCore(StyleLayerListItem styleItem) { return(styleItem.ConcreteObject is Style); }
protected override bool CanContainStyleItemCore(StyleLayerListItem styleItem) { return(styleItem.ConcreteObject is IconTextStyle || styleItem.ConcreteObject is TextFilterStyle); }