summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2016-11-17 19:31:05 (GMT)
committerGitHub <noreply@github.com>2016-11-17 19:31:05 (GMT)
commit054ecf2704ac5d736ffb97c2932e1e078041008a (patch)
tree6e11e80a370b9ed96c473a03ecc4bbdfefa62cbe /Xamarin.Forms.Core
parent122f0e3e6060711d6c3b2b8523236b8a057434df (diff)
downloadxamarin-forms-054ecf2704ac5d736ffb97c2932e1e078041008a.zip
xamarin-forms-054ecf2704ac5d736ffb97c2932e1e078041008a.tar.gz
xamarin-forms-054ecf2704ac5d736ffb97c2932e1e078041008a.tar.bz2
[Xaml] cleanup xmlns usage, add XmlnsDefinition (#531)
* [Xaml] cleanup xmlns usage, add XmlnsDefinition * docs
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 49bc4e6..6bbdb60 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 c283364..a6540c1 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 0000000..2d6b075
--- /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