summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Core')
-rw-r--r--Xamarin.Forms.Core/Properties/AssemblyInfo.cs4
-rw-r--r--Xamarin.Forms.Core/Xamarin.Forms.Core.csproj3
-rw-r--r--Xamarin.Forms.Core/XmlnsDefinitionAttribute.cs25
3 files changed, 30 insertions, 2 deletions
diff --git a/Xamarin.Forms.Core/Properties/AssemblyInfo.cs b/Xamarin.Forms.Core/Properties/AssemblyInfo.cs
index 49bc4e67..6bbdb600 100644
--- a/Xamarin.Forms.Core/Properties/AssemblyInfo.cs
+++ b/Xamarin.Forms.Core/Properties/AssemblyInfo.cs
@@ -56,4 +56,6 @@ using Xamarin.Forms.Internals;
[assembly: InternalsVisibleTo("Xamarin.Forms.Pages")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Pages.UnitTests")]
[assembly: InternalsVisibleTo("Xamarin.Forms.CarouselView")]
-[assembly: Preserve] \ No newline at end of file
+[assembly: Preserve]
+
+[assembly: XmlnsDefinition("http://xamarin.com/schemas/2014/forms", "Xamarin.Forms")] \ No newline at end of file
diff --git a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
index c2833641..a6540c1b 100644
--- a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
+++ b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
@@ -444,6 +444,7 @@
<Compile Include="INativeBindingService.cs" />
<Compile Include="ProvideCompiledAttribute.cs" />
<Compile Include="TypedBinding.cs" />
+ <Compile Include="XmlnsDefinitionAttribute.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<ItemGroup>
@@ -458,4 +459,4 @@
</PostBuildEvent>
</PropertyGroup>
<ItemGroup />
-</Project> \ No newline at end of file
+</Project>
diff --git a/Xamarin.Forms.Core/XmlnsDefinitionAttribute.cs b/Xamarin.Forms.Core/XmlnsDefinitionAttribute.cs
new file mode 100644
index 00000000..2d6b0758
--- /dev/null
+++ b/Xamarin.Forms.Core/XmlnsDefinitionAttribute.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Reflection;
+using System.Diagnostics;
+namespace Xamarin.Forms
+{
+ [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
+ [DebuggerDisplay("{XmlNamespace}, {ClrNamespace}, {AssemblyName}")]
+ public sealed class XmlnsDefinitionAttribute : Attribute
+ {
+ public string XmlNamespace { get; }
+ public string ClrNamespace { get; }
+ public string AssemblyName { get; set; }
+
+ public XmlnsDefinitionAttribute(string xmlNamespace, string clrNamespace)
+ {
+ if (xmlNamespace == null)
+ throw new ArgumentNullException(nameof(xmlNamespace));
+ if (clrNamespace == null)
+ throw new ArgumentNullException(nameof(clrNamespace));
+
+ ClrNamespace = clrNamespace;
+ XmlNamespace = xmlNamespace;
+ }
+ }
+} \ No newline at end of file