Unfortunately, no. The XAML file must be parsed before the assembly is built in order to generate the code implied by the XAML to be included in the assembly. The XAML compiler produces code behind files (the files ending in, for example, .g.cs) and these file then become part of the assembly the XAML file is contained in. Since the assembly hasn't been built yet, the XAML compiler cannot load it to determine XmlnsDeclaration attributes have been specified.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…