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 { /// /// Converts the typography type enumeration to the name of the resource that represents it. /// /// /// Name of the resource matching the . /// otherwise. /// 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), }; } }