Expose the XmlnsPrefixAttribute, that can be used by external tools to
support object tree serialixation to Xaml.
- fixes #3191
[assembly: Preserve]
[assembly: XmlnsDefinition("http://xamarin.com/schemas/2014/forms", "Xamarin.Forms")]
+[assembly: XmlnsPrefix("http://xamarin.com/schemas/2014/forms", "xf")]
[assembly: StyleProperty("background-color", typeof(VisualElement), nameof(VisualElement.BackgroundColorProperty))]
[assembly: StyleProperty("background-image", typeof(Page), nameof(Page.BackgroundImageProperty))]
using System;
using System.Diagnostics;
-
namespace Xamarin.Forms
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
XmlNamespace = xmlNamespace;
}
}
-}
\ No newline at end of file
+}
--- /dev/null
+using System;
+
+namespace Xamarin.Forms
+{
+ [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
+ public sealed class XmlnsPrefixAttribute : Attribute
+ {
+ public XmlnsPrefixAttribute(string xmlNamespace, string prefix)
+ {
+ XmlNamespace = xmlNamespace ?? throw new ArgumentNullException(nameof(xmlNamespace));
+ Prefix = prefix ?? throw new ArgumentNullException(nameof(prefix));
+ }
+
+ public string XmlNamespace { get; }
+ public string Prefix { get; }
+ }
+}
\ No newline at end of file