private void DocumentLoaded(object sender, DocumentLoadedEventArgs e) { var proxy = new DocumentEditorServiceSoapClient(); Document doc = e.Document; this._activeDocument = new DocumentView(proxy.GetDocumentPattern(doc.DocumentPatternId)); this.LoadRegions(_activeDocument); foreach (DocumentRegion region in _activeDocument.DocumentBoard.Children) { region.RegionContent = proxy.GetDocumentData(doc, region.ContentPattern.Id); } this.documentContainer.Content = this._activeDocument; this._currentlyEditedDocument = doc; }
private void LoadRegions(DocumentView activeDocument) { foreach (ContentPattern contentPattern in activeDocument.DocumentPattern.Contents) { var region = new DocumentRegion { RegionContent = contentPattern.Id }; region.ContentPattern = contentPattern; activeDocument.documentBoard.Children.Add(region); } }
private void NewDocumentPattern_Click(object sender, RoutedEventArgs e) { this.CanAddRegionsToDocument = true; var proxy = new DocumentEditorServiceSoapClient(); var dv = new DocumentView(proxy.CreateDocumentPattern()); this._activeDocument = dv; this.documentContainer.Content = dv; }
private void DocumentPatternLoaded(object sender, DocumentPatternLoadedEventArgs e) { this.CanAddRegionsToDocument = true; this._activeDocument = new DocumentView(e.DocumentPattern); this.documentContainer.Content = this._activeDocument; this.LoadRegions(this._activeDocument); }