优化更新代码,添加界面功能并整合

This commit is contained in:
GG Z
2025-02-10 20:53:40 +08:00
parent 83b846f15f
commit 978e03a67f
1389 changed files with 95739 additions and 22200 deletions

View File

@@ -0,0 +1,34 @@
using WPFluent.Controls;
namespace WPFluent.Extensions;
/// <summary>
/// Extension that converts the typography type enumeration to the name of the resource that represents it.
/// </summary>
public static class TextBlockFontTypographyExtensions
{
/// <summary>
/// Converts the typography type enumeration to the name of the resource that represents it.
/// </summary>
/// <returns>
/// Name of the resource matching the <see cref="FontTypography"/>. <see cref="ArgumentOutOfRangeException"/>
/// otherwise.
/// </returns>
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),
};
}
}