namespace WPFluent.Controls; /// /// Set of static methods to operate on and . /// public static class SymbolGlyph { /// /// If the filled icon is not found in some places, this one will be displayed. /// public const SymbolFilled DefaultFilledIcon = SymbolFilled.BorderNone24; /// /// If the icon is not found in some places, this one will be displayed. /// public const SymbolRegular DefaultIcon = SymbolRegular.BorderNone24; /// /// Finds icon based on name. /// /// Name of the icon. 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 } } /// /// Finds icon based on name. /// /// Name of the icon. 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 } } }