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

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,67 @@
namespace WPFluent.Controls;
/// <summary>
/// Set of static methods to operate on <see cref="SymbolRegular"/> and <see cref="SymbolFilled"/>.
/// </summary>
public static class SymbolGlyph
{
/// <summary>
/// If the filled icon is not found in some places, this one will be displayed.
/// </summary>
public const SymbolFilled DefaultFilledIcon = SymbolFilled.BorderNone24;
/// <summary>
/// If the icon is not found in some places, this one will be displayed.
/// </summary>
public const SymbolRegular DefaultIcon = SymbolRegular.BorderNone24;
/// <summary>
/// Finds icon based on name.
/// </summary>
/// <param name="name">Name of the icon.</param>
public static SymbolRegular Parse(string name)
{
if(string.IsNullOrEmpty(name))
{
return DefaultIcon;
}
try
{
return (SymbolRegular)Enum.Parse(typeof(SymbolRegular), name);
} catch(Exception)
{
#if DEBUG
throw;
#else
return DefaultIcon;
#endif
}
}
/// <summary>
/// Finds icon based on name.
/// </summary>
/// <param name="name">Name of the icon.</param>
public static SymbolFilled ParseFilled(string name)
{
if(string.IsNullOrEmpty(name))
{
return DefaultFilledIcon;
}
try
{
return (SymbolFilled)Enum.Parse(typeof(SymbolFilled), name);
} catch(Exception)
{
#if DEBUG
throw;
#else
return DefaultFilledIcon;
#endif
}
}
}