I have a richtextbox in WPF,
<RichTextBox Name="_RichTextBox" />
And in the code-behind i was able to auto-expand the richtextbox height on the text change
mRichTextBox.SelectionChanged += OnSelectionChanged;
async void OnSelectionChanged(object sender, RoutedEventArgs e)
{
mRichTextBox.Height = mRichTextBox.Document.LineHeight;
}
But, the LineHeight is coming NaN for me and so does the Height ,
Is there any other way to achieve this.
Any help is Appreciated!!
Grid
with aRowDefinition Height="Auto"
and letting that do the resizing?