using WPFluent.Controls;
namespace WPFluent.Extensions;
///
/// Extension that converts the typography type enumeration to the name of the resource that represents it.
///
public static class TextBlockFontTypographyExtensions
{
///
/// 将 typography type 枚举转换为表示它的资源的名称。
///
///
/// 与 匹配的资源名称。否则。
///
public static string ToResourceValue(this FontTypography typography)
{
return typography switch
{
FontTypography.Caption => "CaptionTextBlockStyle",
FontTypography.Body => "BodyTextBlockStyle",
FontTypography.BodyStrong => "BodyStrongTextBlockStyle",
FontTypography.Subtitle => "SubtitleTextBlockStyle",
FontTypography.Title => "TitleTextBlockStyle",
FontTypography.TitleLarge => "TitleLargeTextBlockStyle",
FontTypography.Display => "DisplayTextBlockStyle",
_ => throw new ArgumentOutOfRangeException(nameof(typography), typography, null),
};
}
}