public ElementNodeProxyViewModel(ElementNodeProxy proxy, IElementMapService elementMapService) { _elementMapService = elementMapService; ElementNodeProxy = proxy; _map = elementMapService.ElementMap; ElementMapping = _map.GetBySourceId(proxy.Id); elementMapService.RegisterMapMessages(this, OnElementMapChanged); if (ElementMapping == null) { _elementMapService.ElementMap.ElementMappings.CollectionChanged += ElementMappings_CollectionChanged; } }
public async Task ExportElementNodeProxy(string filePath) { if (string.IsNullOrEmpty(filePath)) { throw new ArgumentNullException(nameof(filePath)); } await Task.Factory.StartNew(() => { var proxy = new ElementNodeProxy(RootNode); ElementTreeWriter writer = new ElementTreeWriter(); writer.WriteFile(filePath, proxy); }); }