public void SelectElement(string selectedName) { _selectedName = selectedName; if (string.IsNullOrWhiteSpace(selectedName) || _drawingDocument == null) { elementImage.Source = null; textEditor.Text = string.Empty; return; } var selecteElement = _drawingDocument.GetSvgById(selectedName); if (selecteElement != null) { textEditor.Text = selecteElement.OuterXml; } else { textEditor.Text = string.Empty; } var selectedDrawing = _drawingDocument.GetById(selectedName); if (selectedDrawing != null) { elementImage.Source = new DrawingImage(selectedDrawing); } else { elementImage.Source = null; } }
public ExpolorerRoot(WpfDrawingDocument doc) { document = doc; foreach (var dn in doc.DrawingNames) { var d = doc.GetById(dn); names.Add(d, dn); } }