private async void btnRender_Click(object sender, RoutedEventArgs e) { // document parameters _doc.Clear(); progressRing.IsActive = true; _doc.Landscape = true; var sz = _doc.PageSize; var rc = new Rect(0, 0, sz.Width - _doc.MainSection.LeftMargin - _doc.MainSection.RightMargin, sz.Height - _doc.MainSection.TopMargin - _doc.MainSection.BottomMargin); // draw every UI elements inside the panel in word document. await _doc.DrawElement(panel, rc); // save document WordUtils.SetDocumentInfo(_doc, Strings.RenderUIDocumentTitle); WordUtils.Save(_doc); progressRing.IsActive = false; }
private void btnSave_Click(object sender, RoutedEventArgs e) { WordUtils.Save(_doc); }