views:

19

answers:

1

Hi ya'll

Consider 3 assemblies:

  • EntryPoint (SL app)
  • ClassLibraryA
  • ClassLibraryB

Where there is a class A in ClassLibraryAand a class B in ClassLibraryB

EntryPoint has a reference to ClassLibraryA, and ClassLibraryAhas a reference to ClassLibraryB.

In the AssemblyInfo of ClassLibrary1 I have the following code:

[assembly: XmlnsPrefix("http://schemas.test.com/sl/", "test")]
[assembly: XmlnsDefinition("http://schemas.test.com/sl/", "ClassLibraryA")]
[assembly: XmlnsDefinition("http://schemas.test.com/sl/", "ClassLibraryB", AssemblyName = "ClassLibraryB")]

A and B are both FrameworkElements

The problem is that in my MainPage, when I have this xaml:

xmlns:test="http://schemas.test.com/sl/"

the following doesn't work:

<test:B x:Name="bar" /> 

while this works:

<test:A x:Name="foo" />

Why not?

+1  A: 

@Snake

In ClassLibraryA's AssemblyInfo.cs you need to have the following

[assembly: XmlnsPrefix("http://schemas.test.com/sl/", "test")]
[assembly: XmlnsDefinition("http://schemas.test.com/sl/", "ClassLibraryA")]

and in ClassLibraryB's AssemblyInfo.cs you need to have the following,

[assembly: XmlnsPrefix("http://schemas.test.com/sl/", "test")]
[assembly: XmlnsDefinition("http://schemas.test.com/sl/", "ClassLibraryB")]
Avatar
Ok thanks :D but then what is the AssemblyName on the XmlnsDefinition for? :)
Snake
I haven't used the AssemblyName before. so no clue. But, seeing this link. http://msdn.microsoft.com/en-us/library/system.workflow.componentmodel.serialization.xmlnsdefinitionattribute.aspx. `It is the name of the current assembly. It defines a mapping between a common language runtime namespace that is defined in the current assembly and an XML namespace`
Avatar
<yoda>Mmmmm, mark your answer as answer, I will </yoda>
Snake