I used this code to find FlowDirection
of a Text Range:
var d=TextRange.GetPropertyValue(Paragraph.FlowDirectionProperty).ToString();
rtlBtn.IsChecked= d=="RightToLeft";
But it return LeftToRight
always, even for Right To Left paragraphs
How can i do that?
No, it doesn't as the following sample demonstrates:
You need to make sure that the TextRange belongs the Paragraph that you expected and that the property of this reallu is set to RightToLeft.