title: How can I measure the Text Size in UWP Apps?
body: <p>In WPF, this was possible using <a href="https://stackoverflow.com/a/9266288/3107430"><code>FormattedText</code></a>, like this:</p>
  
  <pre><code>private Size MeasureString(string candidate)
  {
      var formattedText = new FormattedText(
          candidate,
          CultureInfo.CurrentUICulture,
          FlowDirection.LeftToRight,
          new Typeface(this.textBlock.FontFamily, this.textBlock.FontStyle, this.textBlock.FontWeight, this.textBlock.FontStretch),
          this.textBlock.FontSize,
          Brushes.Black);
  
      return new Size(formattedText.Width, formattedText.Height);
  }
  </code></pre>
  
  <p>But in UWP this class does not exist any more. So how is it possible to calculate text dimensions in universal windows platform?</p>