public LegendAdornmentLayerViewModel CloneDeep() { var cloneObject = new LegendAdornmentLayerViewModel(this.coreLayer.CloneDeep() as LegendAdornmentLayer) { fixedSymbolHeight = this.fixedSymbolHeight, fixedSymbolWidth = this.fixedSymbolWidth, Height = this.Height, legendSizeMode = this.legendSizeMode, Location = this.Location, minHeight = this.minHeight, minWidth = this.minWidth, parent = this.parent, previewHeight = this.previewHeight, previewWidth = this.previewWidth, selectedLegendItem = this.selectedLegendItem, simpleCandidates = this.simpleCandidates, symbolSizeMode = this.symbolSizeMode, useTextWrapping = this.useTextWrapping, wordWrapLength = this.wordWrapLength, }; foreach (var item in this.legendItems) { cloneObject.legendItems.Add(item.Clone()); } return(cloneObject); }
public LegendEditor(LegendAdornmentLayerViewModel legendEntity) { this.legendEntity = legendEntity; InitializeComponent(); DataContext = legendEntity; HideNameAndLocationPanel = false; HelpContainer.Content = HelpResourceHelper.GetHelpButton("LegendEditorHelp", HelpButtonMode.Default); Messenger.Default.Register <bool>(this, legendEntity, (message) => { DialogResult = message; }); this.Unloaded += (s, e) => Messenger.Default.Unregister(this); }