Open h82258652 opened 5 years ago
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 -->
<RichTextBox IsReadOnly="True"
HorizontalAlignment="Right">
</RichTextBox><!-- this does not work -->
In my project, I'm using this way to solve.
<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.
Since RichTextbox does not support automatic width and height, I also solved it like you, and I hope Microsoft will pay attention to this problem sooner
This feature is already exist in UWP, can it port to WPF?