AvaloniaUI
This commit is contained in:
18
Pilz.UI.AvaloniaUI.Symbols/Factories/BasicFactory.cs
Normal file
18
Pilz.UI.AvaloniaUI.Symbols/Factories/BasicFactory.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Reflection;
|
||||
|
||||
namespace Pilz.UI.AvaloniaUI.Symbols.Factories;
|
||||
|
||||
public class BasicFactory<T>(string baseName) : SymbolFactory<T> where T : Enum
|
||||
{
|
||||
private Assembly? assembly;
|
||||
|
||||
public override Assembly GetImageResourceAssembly()
|
||||
{
|
||||
return assembly ??= Assembly.Load(baseName);
|
||||
}
|
||||
|
||||
public override string GetImageRessourcePath(T svgImage)
|
||||
{
|
||||
return $"{baseName}.Files.{svgImage}.svg";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user