A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

39 lines
1.2 KiB

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