In my project, there is inline inside TextBlock that has fontfamily symbol.
So, if text is b then TextBlock contents will be β.
I want retrieve this β as it is and set that β to TextBox.
Is there any way to implement this?
If I am using
var caption = textBlock.Text;
then it is returning b.
Also I tried:
var text = new System.Text.StringBuilder();
foreach (var item in textBlock.Inlines)
{
if(item is Run run)
{
text.Append(run.Text);
}
else if(item is Span span)
{
text.Append(new TextRange(span.ContentStart, span.ContentEnd));
}
}
var abc = text.ToString();
then it is also returning b.
New contributor
Shraddha Sutar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.