This question is locked. New answers and comments are not allowed.
Hi,
I'm trying to insert a paragraph, which I want it to have a numbered item as well, to the caret position using Q3 2011 SP1.
DocumentFragment is the only workaround that I found for the paragraph issue. But when I have numbered list in my document fragment it will be a different Document List as soon as I insert fragment to document. Consider the following example
If I use the same NumberedList defined for original document, Numbered List in original document is updated.
The thing is if I export and import the document using XamlFormatProvider the problem seems to be resolved. Is there any other workaround for this issue?
I'm trying to insert a paragraph, which I want it to have a numbered item as well, to the caret position using Q3 2011 SP1.
DocumentFragment is the only workaround that I found for the paragraph issue. But when I have numbered list in my document fragment it will be a different Document List as soon as I insert fragment to document. Consider the following example
originalParagraph.Inlines.Add(new Span("Numbered Item in Original Document")); originalNumberedList.AddParagraph(originalParagraph); originalSection.Blocks.Add(originalParagraph); originalSection.Blocks.Add(new Paragraph()); originalDocument.Sections.Add(originalSection); originalDocument.CaretPosition.MoveToLastPositionInDocument(); RadDocument documentFragment = new RadDocument(); Section sectionFragment = new Section(); NumberedList numberedListForFragment = new NumberedList(documentFragment); Paragraph paragraphFragment = new Paragraph(); paragraphFragment.Inlines.Add(new Span("Numbered Item in Document Fragment")); numberedListForFragment.AddParagraph(paragraphFragment); sectionFragment.Blocks.Add(paragraphFragment); documentFragment.Sections.Add(sectionFragment); originalDocument.InsertFragment(new DocumentFragment(documentFragment));If I use the same NumberedList defined for original document, Numbered List in original document is updated.
RadDocument originalDocument = new RadDocument(); Section originalSection = new Section(); NumberedList originalNumberedList = new NumberedList(originalDocument); Paragraph originalParagraph = new Paragraph(); originalParagraph.Inlines.Add(new Span("Numbered Item in Original Document")); originalNumberedList.AddParagraph(originalParagraph); originalSection.Blocks.Add(originalParagraph); originalSection.Blocks.Add(new Paragraph()); originalDocument.Sections.Add(originalSection); originalDocument.CaretPosition.MoveToLastPositionInDocument(); RadDocument documentFragment = new RadDocument(); Section sectionFragment = new Section(); Paragraph paragraphFragment = new Paragraph(); paragraphFragment.Inlines.Add(new Span("Numbered Item in Document Fragment")); originalNumberedList.AddParagraph(paragraphFragment); sectionFragment.Blocks.Add(paragraphFragment); documentFragment.Sections.Add(sectionFragment); originalDocument.InsertFragment(new DocumentFragment(documentFragment));The thing is if I export and import the document using XamlFormatProvider the problem seems to be resolved. Is there any other workaround for this issue?