Blurry Borderline In FlowDocument
-
It seems no amount of SnapsToDevicePixels="True" and/or UseLayoutRounding="True" can make the border around a Paragraph sharp:
A button A button A button
However i can use RenderOptions.EdgeMode="Aliased" which makes the border sharp, but distorts the Expander:
A button
So, is there any way to make the border sharp without hurting the documents appearance? :-D
-
It seems no amount of SnapsToDevicePixels="True" and/or UseLayoutRounding="True" can make the border around a Paragraph sharp:
A button A button A button
However i can use RenderOptions.EdgeMode="Aliased" which makes the border sharp, but distorts the Expander:
A button
So, is there any way to make the border sharp without hurting the documents appearance? :-D
If you placed the Expanders (with a border) "outside" the FlowDocument (in a FrameworkElement), you could use UseLayoutRounding to get the effect you want. As presented, I don't see why these expanders have to be inside a FlowDocument (which isn't a FrameworkElement).
-
If you placed the Expanders (with a border) "outside" the FlowDocument (in a FrameworkElement), you could use UseLayoutRounding to get the effect you want. As presented, I don't see why these expanders have to be inside a FlowDocument (which isn't a FrameworkElement).
Ok i figured out a way that works, although its a bit ugly:
A button
As for why, my code is based on this: http://stackoverflow.com/questions/3798262/how-to-collapse-a-paragraph although i've been improving it. The idea is add or remove a paragraph block below the expander block based on the state of the expander. That + code to handle the copy to clipboard to convert the uielements to text (in this case, getting the header string of the expander) and the result is an interactive flowdocument with collapsing regions and copy support.