I have a RichTextBox in a WPF Application. I would like to apply alternate coloring to each lines of texts. I have set the Background property to be of the desired color, but due to differences in text length, only the portion containing text gets the background color. How to set properties so that the entire line is set to the desired background color.
One non-elegant solution is to, pad some spaces, but if RichTextBox layout changes, then the code needs to be changed by trial and error basis.
Any better approach?
I wanted to know how to make this work with Items generated dynamically. For my actual case, I used extra spaces. For now, this is the way for me to go.