xml namespaces - WPF - Combine xmlns -
1) have 3 assemblies. a,b , ui
2) b references a.
3) ui references b , a.
4) in a's assemblyinfo.cs
[assembly: xmlnsdefinition("http://www.cmp.com/a", "a.controls")]
5) in b's assemblyinfo.cs
[assembly: xmlnsdefinition("http://www.cmp.com/b", "b.controls.extensions")]
6) in ui have view
<usercontrol xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:a="http://www.cmp.com/a" xmlns:b="http://www.cmp.com/b"> <textbox a:textboxextensions.ext1="red" b:textboxextensions.ext1="blue" /> </usercontrol>
is there way combine both "http://www.cmp.com/a" , "http://www.cmp.com/b" under same xmlns or atlist under same prefix ?
sure, need map both namespaces same url:
in a's assemblyinfo.cs
[assembly: xmlnsdefinition("http://www.cmp.com/controls", "a.controls")]
in b's assemblyinfo.cs
[assembly: xmlnsdefinition("http://www.cmp.com/controls", "b.controls.extensions")]
then have declare 1 xmlns access types both namespaces:
xmlns:controls="http://www.cmp.com/controls"
Comments
Post a Comment