This feature is already exist in UWP, can it port to WPF?
AFAIK the code bases are vastly different, so "porting" means writing it from scratch ... just FYI.
Related: SO discussion
@vatsan-madhavan
But HorizontalAlignment does not work for RichTextBox, even the text is very short.
<TextBlock HorizontalAlignment="Right">
</TextBlock><!-- of course, this is ok -->
```XAML
In my project, I'm using this way to solve.
```XAML
<Grid HorizontalAlignment="Right">
<TextBlock x:Name="TextBlock"
IsHitTestVisible="False"
Opacity="0"
TextWrapping="Wrap" />
<RichTextBox Width="{Binding Element=TextBlock, Path=ActualWidth}"
IsReadOnly="True" />
</Grid>
But I think it is too complex, I hope it will be simpler.
Most helpful comment
AFAIK the code bases are vastly different, so "porting" means writing it from scratch ... just FYI.