Created
October 6, 2017 17:48
-
-
Save SamedBll/ba857ca2a71a6d782e8fc434e8ee440a to your computer and use it in GitHub Desktop.
B(C) - 26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct FontCalc | |
{ | |
public FontCalc(Label label, double fontSize, double containerWidth) | |
: this() | |
{ | |
// Yazı tipi boyutunu kaydedin. | |
FontSize = fontSize; | |
// Label yüksekliğini yeniden hesaplayın. | |
label.FontSize = fontSize; | |
SizeRequest sizeRequest = | |
label.GetSizeRequest(containerWidth, Double.PositiveInfinity); | |
// Bu yüksekliği kaydedin. | |
TextHeight = sizeRequest.Request.Height; | |
} | |
public double FontSize { private set; get; } | |
public double TextHeight { private set; get; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment