I defined a TextBlock object in the form and set a string for it. Now I want to get its actual pixel width. When I use the following method, cs0618 warning appears. Is there any other way to get it?
var fromatted = new FormattedText(
text.Text, CultureInfo.CurrentUICulture, FlowDirection.LeftToRight,
new Typeface(text.FontFamily, text.FontStyle, text.FontWeight, text.FontStretch),
text.FontSize, text.Foreground);