ITextAlignment Interface Extension Methods

Version: v9.x

In FmgLib.MauiMarkup, all classes that implement the ITextAlignment interface get the following extension methods:

  • TextCenterHorizontal
  • TextCenterVertical
  • TextCenter
  • TextLeft
  • TextRight
  • TextBottom
  • TextBottomLeft
  • TextBottomRight
  • TextTop
  • TextTopLeft
  • TextTopRight
  • TextTopCenter
  • TextBottomCenter
  • TextCenterLeft
  • TextCenterRight
  • AlignText

Usage

To use the extension methods, create a Label object (or any object that implements ITextAlignment), and call the desired method:

new Label().TextCenter()

This example centers the text both horizontally and vertically within the label's containing element.