using System; namespace Avalonia.Metadata { /// /// Use to predefine the prefix associated to an xml namespace in a xaml file /// /// /// example: /// [assembly: XmlnsPrefix("https://github.com/avaloniaui", "av")] /// xaml: /// xmlns:av="https://github.com/avaloniaui" /// [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] public sealed class XmlnsPrefixAttribute : Attribute { /// /// Constructor /// /// XML namespce /// recommended prefix public XmlnsPrefixAttribute(string xmlNamespace, string prefix) { XmlNamespace = xmlNamespace ?? throw new ArgumentNullException(nameof(xmlNamespace)); Prefix = prefix ?? throw new ArgumentNullException(nameof(prefix)); } /// /// XML Namespace /// public string XmlNamespace { get; } /// /// New Xml Namespace /// public string Prefix { get; } } }